1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-07 13:21:02 +01:00
phorge-phorge/src/applications/diffusion/exception
epriestley a7921a4448 Filter and reject "--config" and "--debugger" flags to Mercurial in any position
Summary:
Ref T13012. These flags can be exploited by attackers to execute code remotely. See T13012 for discussion and context.

Additionally, harden some Mercurial commands where possible (by using additional quoting or embedding arguments in other constructs) so they resist these flags and behave properly when passed arguments with these values.

Test Plan:
  - Added unit tests.
  - Verified "--config" and "--debugger" commands are rejected.
  - Verified more commands now work properly even with branches and files named `--debugger`, although not all of them do.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13012

Differential Revision: https://secure.phabricator.com/D18769
2017-11-10 08:42:07 -08:00
..
DiffusionCommitHookRejectException.php Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
DiffusionDaemonLockException.php Make repository daemon locks more granular and forgiving 2016-05-13 05:17:27 -07:00
DiffusionMercurialFlagInjectionException.php Filter and reject "--config" and "--debugger" flags to Mercurial in any position 2017-11-10 08:42:07 -08:00
DiffusionRefNotFoundException.php Throw a more tailored exception after failing to resolve a ref 2014-05-13 13:52:33 -07:00
DiffusionSetupException.php Replace AphrontUsageException with AphrontMalformedRequestException 2015-09-03 10:04:17 -07:00