1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/applications/auth/controller
epriestley 1c32c9b965 Improve granluarity and defaults of security.allow-outbound-http
Summary:
Ref T6755. This is a partial fix, but:

  - Allow netblocks to be blacklisted instead of making the feature all-or-nothing.
  - Default to disallow requests to all reserved private/local/special IP blocks. This should generally be a "safe" setting.
  - Explain the risks better.
  - Improve the errors rasied by Macro when failing.
  - Removed `security.allow-outbound-http`, as it is superseded by this setting and is somewhat misleading.
    - We still make outbound HTTP requests to OAuth.
    - We still make outbound HTTP requests for repositories.

From a technical perspective:

  - Separate URIs that are safe to link to or redirect to (basically, not "javascript://") from URIs that are safe to fetch (nothing in a private block).
  - Add the default blacklist.
  - Be more careful with response data in Macro fetching, and don't let the user see it if it isn't ultimately valid.

Additionally:

  - I want to do this check before pulling repositories, but that's enough of a mess that it should go in a separate diff.
  - The future implementation of T4190 needs to perform the fetch check.

Test Plan:
  - Fetched a valid macro.
  - Fetched a non-image, verified it didn't result in a viewable file.
  - Fetched a private-ip-space image, got an error.
  - Fetched a 404, got a useful-enough error without additional revealing response content (which is usually HTML anyway and not useful).
  - Fetched a bad protocol, got an error.
  - Linked to a local resource, a phriction page, a valid remote site, all worked.
  - Linked to private IP space, which worked fine (we want to let you link and redierect to other private services, just not fetch them).
  - Added and executed unit tests.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6755

Differential Revision: https://secure.phabricator.com/D12136
2015-03-23 10:44:03 -07:00
..
config Fix a few minor bugs in Auth Providers 2015-03-08 11:04:57 -07:00
PhabricatorAuthConfirmLinkController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
PhabricatorAuthController.php Move PHUIErrorView to PHUIInfoView 2015-03-01 14:45:56 -08:00
PhabricatorAuthDowngradeSessionController.php Shorten buttons on Leaving High Security Page 2015-03-14 07:35:01 -07:00
PhabricatorAuthFinishController.php Improve granluarity and defaults of security.allow-outbound-http 2015-03-23 10:44:03 -07:00
PhabricatorAuthInviteController.php Support invites in the registration and login flow 2015-02-11 06:06:28 -08:00
PhabricatorAuthLinkController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
PhabricatorAuthLoginController.php More crumb borders 2015-02-01 20:12:13 -08:00
PhabricatorAuthNeedsApprovalController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
PhabricatorAuthNeedsMultiFactorController.php Move PHUIErrorView to PHUIInfoView 2015-03-01 14:45:56 -08:00
PhabricatorAuthOldOAuthRedirectController.php Whitelist controllers which can receive a 'code' parameter 2014-03-12 11:30:04 -07:00
PhabricatorAuthOneTimeLoginController.php Allow passwords to be edited even if account.editable is false 2014-08-21 15:35:43 -07:00
PhabricatorAuthRegisterController.php Move PHUIErrorView to PHUIInfoView 2015-03-01 14:45:56 -08:00
PhabricatorAuthRevokeTokenController.php Invalidate outstanding password reset links when users adjust email addresses 2014-08-04 12:04:23 -07:00
PhabricatorAuthSSHKeyController.php Separate SSH key management from the settings panel 2014-11-11 08:18:26 -08:00
PhabricatorAuthSSHKeyDeleteController.php Separate SSH key management from the settings panel 2014-11-11 08:18:26 -08:00
PhabricatorAuthSSHKeyEditController.php Allow device SSH keys to be trusted 2014-11-20 17:33:30 -08:00
PhabricatorAuthSSHKeyGenerateController.php Allow device SSH keys to be trusted 2014-11-20 17:33:30 -08:00
PhabricatorAuthStartController.php Support invites in the registration and login flow 2015-02-11 06:06:28 -08:00
PhabricatorAuthTerminateSessionController.php Make dialogs a little easier to use 2014-03-21 14:40:05 -07:00
PhabricatorAuthUnlinkController.php Terminate other sessions on credential changes 2014-08-04 12:04:35 -07:00
PhabricatorAuthValidateController.php Legalpad - allow for legalpad documents to be required to be signed for using Phabricator 2015-02-12 15:22:56 -08:00
PhabricatorDisabledUserController.php Update AphrontRequestFailure to common display libs 2014-09-26 17:40:09 -07:00
PhabricatorEmailLoginController.php Move PHUIErrorView to PHUIInfoView 2015-03-01 14:45:56 -08:00
PhabricatorEmailVerificationController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
PhabricatorLogoutController.php Legalpad - allow for legalpad documents to be required to be signed for using Phabricator 2015-02-12 15:22:56 -08:00
PhabricatorMustVerifyEmailController.php Move PHUIErrorView to PHUIInfoView 2015-03-01 14:45:56 -08:00
PhabricatorRefreshCSRFController.php Delete license headers from files 2012-11-05 11:16:51 -08:00