1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-06 04:41:01 +01:00
phorge-phorge/src/applications/config/check
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
..
PhabricatorAPCSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorAuthSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorBaseURISetupCheck.php Improve "Host" header check 2015-02-26 14:37:48 -08:00
PhabricatorBinariesSetupCheck.php Fix Mercurial command injection vulnerability 2015-03-20 09:26:32 -07:00
PhabricatorDaemonsSetupCheck.php Examine fewer daemons for variant config 2015-03-15 11:31:07 -07:00
PhabricatorDatabaseSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorElasticSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorExtensionsSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorExtraConfigSetupCheck.php Improve granluarity and defaults of security.allow-outbound-http 2015-03-23 10:44:03 -07:00
PhabricatorFileinfoSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorGDSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorImagemagickSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorInvalidConfigSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorMailSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorMySQLSetupCheck.php Rewrite file documentation to be chunk-aware 2015-03-15 11:37:47 -07:00
PhabricatorPathSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorPHPConfigSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorPygmentSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorRepositoriesSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorSecuritySetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00
PhabricatorSetupCheck.php Show open setup issue keys in "title" attribute of setup issues warning 2015-02-11 13:00:59 -08:00
PhabricatorStorageSetupCheck.php Fix improper selection of the chunk engine as a writable engine 2015-03-18 19:06:39 -07:00
PhabricatorTimezoneSetupCheck.php Split Setup Issues into Groups 2015-02-10 12:53:00 -08:00