MercurialProject
ActivePublic

Recent Activity

Tue, Nov 21

quark.zju added a comment to T13012: Mercurial "--config" and "--debugger" command injection vulnerability.

That's a good point! I wish it was designed like that since the beginning. I guess it won't happen with the current compatibility rules since it is likely to break automation.

Tue, Nov 21, 11:03 PM · Mercurial, Security
epriestley added a comment to T13012: Mercurial "--config" and "--debugger" command injection vulnerability.

In theory, you could require --config appear between hg and foo in hg foo .... This is already a valid position for --config (for example, hg --config x=y foo is valid), and already not a valid position for foo flags (for example, hg --branch default log is not valid).

Tue, Nov 21, 9:26 PM · Mercurial, Security
quark.zju added a comment to T13012: Mercurial "--config" and "--debugger" command injection vulnerability.

https://phab.mercurial-scm.org/D1483 should make it possible to use -- to defend non-flag user input. For inputs that are flags, use the form --flag=X and avoid --flag X.

Tue, Nov 21, 9:09 PM · Mercurial, Security

Mon, Nov 13

epriestley closed T13012: Mercurial "--config" and "--debugger" command injection vulnerability as Resolved.

We'll use the hardened mode once it's available, but I don't think we expect to take any further action here until then.

Mon, Nov 13, 9:01 PM · Mercurial, Security

Nov 10 2017

epriestley updated the task description for T13012: Mercurial "--config" and "--debugger" command injection vulnerability.
Nov 10 2017, 5:04 PM · Mercurial, Security
epriestley updated the task description for T13012: Mercurial "--config" and "--debugger" command injection vulnerability.
Nov 10 2017, 5:03 PM · Mercurial, Security
epriestley updated the task description for T13012: Mercurial "--config" and "--debugger" command injection vulnerability.
Nov 10 2017, 4:58 PM · Mercurial, Security
epriestley updated the task description for T13012: Mercurial "--config" and "--debugger" command injection vulnerability.
Nov 10 2017, 4:46 PM · Mercurial, Security
epriestley added a comment to T13012: Mercurial "--config" and "--debugger" command injection vulnerability.

This is now in master so I've made the task public.

Nov 10 2017, 4:42 PM · Mercurial, Security
epriestley changed the visibility for T13012: Mercurial "--config" and "--debugger" command injection vulnerability.
Nov 10 2017, 4:42 PM · Mercurial, Security
epriestley added a commit to T13012: Mercurial "--config" and "--debugger" command injection vulnerability: rPa7921a444809: Filter and reject "--config" and "--debugger" flags to Mercurial in any position.
Nov 10 2017, 4:42 PM · Mercurial, Security
epriestley added a revision to T13012: Mercurial "--config" and "--debugger" command injection vulnerability: D18769: Filter and reject "--config" and "--debugger" flags to Mercurial in any position.
Nov 10 2017, 4:22 PM · Mercurial, Security
epriestley added a comment to T13012: Mercurial "--config" and "--debugger" command injection vulnerability.

I don't want to leave RCE in Phabricator for 3 weeks, so I'm planning to land, deploy and disclose some version of the patch above today.

Nov 10 2017, 4:05 PM · Mercurial, Security
epriestley added a comment to T13012: Mercurial "--config" and "--debugger" command injection vulnerability.

(I change visibility for this to @epriestley, @amckinley and @durin42 for now -- note that I intend to eventually make this issue public once the fix hits the commit log, so don't stockpile all your 0-days here.)

Nov 10 2017, 3:50 PM · Mercurial, Security
epriestley shifted T13012: Mercurial "--config" and "--debugger" command injection vulnerability from the Restricted Space space to the S1 Core space.
Nov 10 2017, 3:48 PM · Mercurial, Security

Sep 27 2017

cspeckmim added a comment to T12842: Some improvements to Mercurial, Arcanist, and Dependent Revisions.

I missed your question in (1). A typical scenario for this would be when working on a feature which requires some refactoring work to be done. A revision is created with just the refactoring work and then a dependent revision is made which includes the actual feature work. During feature work additional refactoring might be made and need to update to that changeset and either add/amend changes, rebase the dependent revision back on top. Having the bookmarks auto created would help especially when using arc:bookmark when updating revisions back to phab.

Sep 27 2017, 8:48 PM · Arcanist, Mercurial, Feature Request

Sep 19 2017

franjesus added a comment to T9548: Support Mercurial's bundle2 wire protocol.

https://www.mercurial-scm.org/repo/hg/file/default/contrib/phabricator.py is a Mercurial extension that allows you to send a series of changesets to Phabricator by calling Conduit APIs directly. The extension is currently tailored for the use cases of the Mercurial project itself, isn't distributed with Mercurial, and may require Mercurial 4.3. And it obviously bypasses Phabricator's built-in Mercurial server. But if you are willing to live with the caveats, you may find it a suitable workaround.

Sep 19 2017, 11:26 AM · Diffusion, Mercurial

Sep 5 2017

epriestley added a comment to T9948: Modernize "arc land" for Mercurial: bookmark-to-branch, branch-to-self, multiple heads.

See also PHI45.

Sep 5 2017, 2:24 PM · Mercurial, Arcanist

Aug 27 2017

epriestley added a comment to T12972: Ignoring missing version information on binaries doesn't seem to work.

The behavior may have changed, but the change is from "we sometimes silently do the wrong thing" to "we explicitly refuse to do the wrong thing".

Aug 27 2017, 5:26 PM · Mercurial, Diffusion
chad merged task T12972: Ignoring missing version information on binaries doesn't seem to work into T7339: Raise a setup warning when the "en_US.UTF-8" locale is unavailable.
Aug 27 2017, 4:05 PM · Mercurial, Diffusion
chad added a comment to T12972: Ignoring missing version information on binaries doesn't seem to work.

Ah, it sounded like a regression from the report. I haven't tried to bisect to determine if that was true.

Aug 27 2017, 4:05 PM · Mercurial, Diffusion
epriestley added a comment to T12972: Ignoring missing version information on binaries doesn't seem to work.

That is, specifically, it expected that hg commands do not work in Phabricator if it can not determine the version of hg, so this is not a bug. Ignoring the setup warning might mean "we used to do Mercurial stuff but don't anymore, leaving us with some archived Mercurial repositories which we don't really need to look at, so it's okay that hg commands won't be able to run".

Aug 27 2017, 4:03 PM · Mercurial, Diffusion
epriestley added a comment to T12972: Ignoring missing version information on binaries doesn't seem to work.

The version is strictly required because different versions of hg use different command syntax. If we can not determine which version of hg is installed, we can not run hg commands.

Aug 27 2017, 4:01 PM · Mercurial, Diffusion
chad created T12972: Ignoring missing version information on binaries doesn't seem to work.
Aug 27 2017, 3:58 PM · Mercurial, Diffusion

Aug 14 2017

epriestley closed T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`) as Resolved.

There doesn't seem to be anything actionable remaining on our end.

Aug 14 2017, 8:07 PM · Subversion, Mercurial, Git, Security

Aug 11 2017

epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

This cropped up in the HN thread -- works in my browsers (although Phabricator does not recognize it as a valid link):

Aug 11 2017, 8:07 PM · Subversion, Mercurial, Git, Security
avivey added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

Thanks for the writeup :)

Aug 11 2017, 7:04 PM · Subversion, Mercurial, Git, Security
indygreg added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

The reason the upstream projects aren't using -- is that it isn't portable. For example, Putty's ssh doesn't support it.

Aug 11 2017, 3:45 PM · Subversion, Mercurial, Git, Security
epriestley updated the task description for T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).
Aug 11 2017, 1:41 PM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

The full set of mitigations is now available in stable, and I've promoted 2017 Week 32 (Mid August).

Aug 11 2017, 1:36 PM · Subversion, Mercurial, Git, Security
epriestley renamed T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`) from Assess Impact of CVE-2017-1000117 et al (`ssh://-...` executing code) to [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).
Aug 11 2017, 1:31 PM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

See also this enormously valuable contribution I made to the Git LFS upstream in connection with T7789 some time ago:

Aug 11 2017, 1:19 PM · Subversion, Mercurial, Git, Security
epriestley updated the task description for T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).
Aug 11 2017, 1:14 PM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

So, all three major VCS had the exact same CVE, which was "we invoke ssh command line, don't sanitize input, and don't specify -- anywhere"?

Aug 11 2017, 12:50 PM · Subversion, Mercurial, Git, Security
quark.zju added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

Thanks for the detailed explanations! I should have thought more carefully. Note old Mercurial also fails to do correct shell quoting on Windows (It uses ' where Windows needs "). But Phabricator does not run on Windows, it shouldn't be an issue.

Aug 11 2017, 3:22 AM · Subversion, Mercurial, Git, Security
avivey added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

So, all three major VCS had the exact same CVE, which was "we invoke ssh command line, don't sanitize input, and don't specify -- anywhere"?

Aug 11 2017, 2:53 AM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

@indygreg Thanks for the heads up about subrepos -- I would not have otherwise guessed that hg pull might run git.

Aug 11 2017, 2:40 AM · Subversion, Mercurial, Git, Security
epriestley updated the task description for T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).
Aug 11 2017, 2:24 AM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

From this writeup:

Aug 11 2017, 2:21 AM · Subversion, Mercurial, Git, Security
epriestley added a commit to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`): rP41e823796ac1: (stable) Stop populating or updating working copies in observed Mercurial….
Aug 11 2017, 2:17 AM · Subversion, Mercurial, Git, Security
epriestley added a commit to T4416: Drop "-u" flag from `hg pull` in daemons?: rP41e823796ac1: (stable) Stop populating or updating working copies in observed Mercurial….
Aug 11 2017, 2:17 AM · Mercurial, Diffusion
epriestley added a commit to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`): rP2c150076b00f: Stop populating or updating working copies in observed Mercurial repositories.
Aug 11 2017, 2:15 AM · Subversion, Mercurial, Git, Security
epriestley closed T4416: Drop "-u" flag from `hg pull` in daemons? as Resolved by committing rP2c150076b00f: Stop populating or updating working copies in observed Mercurial repositories.
Aug 11 2017, 2:15 AM · Mercurial, Diffusion
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

The magic incantation I arrived at was slightly modified from one of the hg test cases:

Aug 11 2017, 2:14 AM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

Never mind, I was able to get hg pull -u to interact. I'm going to land, cherry-pick, and hotfix D18390.

Aug 11 2017, 2:12 AM · Subversion, Mercurial, Git, Security
cspeckmim added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

I think this is related:
https://www.mercurial-scm.org/wiki/Subrepository#Synchronizing_in_subrepositories

Aug 11 2017, 2:10 AM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

And here's an extension which appears to be aimed at solving this problem, by adding a new command to execute hg pull -u in subrepositories:

Aug 11 2017, 2:04 AM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

Also, although ui.ssh appears inneffective against the [git] and [svn] variants of subrepos (Mercurial does not appear to populate GIT_SSH or SVN_SSH based on the ui.ssh setting), I can't get hg to actually interact with remotes using hg clone --noupdate ... or hg pull -u -- <uri>, which are the only relevant commands we run. I can get it to interact with remotes with hg up or hg clone (without --noupdate).

Aug 11 2017, 1:56 AM · Subversion, Mercurial, Git, Security
epriestley added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

In the example above, I put malicious content in .hgsub, like this:

Aug 11 2017, 1:32 AM · Subversion, Mercurial, Git, Security
quark.zju added a comment to T12961: [CVE-2017-1000117, et al] Git, Mercurial and Subversion could all execute arbitrary commands when interacting with malicious SSH URIs (`ssh://-...`).

The subrepo issue is when .hgsub has malicious content (ex. foo = ssh://-oProxyCommand=touch%20BAR/). It's not related to command line or config files.

Aug 11 2017, 1:25 AM · Subversion, Mercurial, Git, Security