HomePhorge

Filter and reject "--config" and "--debugger" flags to Mercurial in any position

Description

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

Details

Provenance
epriestleyAuthored on Nov 9 2017, 7:23 AM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP759c757264c8: Include "Draft" revisions in Differential legacy status queries
Branches
Unknown
Tags
Unknown

Event Timeline