Page MenuHomePhabricator

Censor response bodies from Mercurial error messages
ClosedPublic

Authored by epriestley on Mar 26 2015, 4:50 PM.
Tags
None
Referenced Files
F18573497: D12170.diff
Wed, Sep 10, 8:49 AM
F18505233: D12170.id.diff
Fri, Sep 5, 12:30 AM
F18496872: D12170.diff
Thu, Sep 4, 5:46 PM
F18380825: D12170.id.diff
Thu, Aug 28, 6:27 PM
F18359541: D12170.diff
Wed, Aug 27, 9:20 AM
F18342739: D12170.diff
Tue, Aug 26, 5:09 AM
F18189886: D12170.id29244.diff
Aug 16 2025, 10:40 PM
F18162615: D12170.id29253.diff
Aug 15 2025, 4:46 AM
Subscribers

Details

Summary

Ref T6755. In Git and Subversion, running git clone http://google.com/ or svn checkout http://google.com/ does not echo the response body.

In Mercurial, it does. Censor it from the output of hg pull and hg clone. This prevents an attacker from:

  • Creating a Mercurial remote repository with URI http://10.0.0.1/secrets/; and
  • reading the secrets out of the error message after the clone fails.
Test Plan

Set a Mercurial remote URI to a non-Mercurial repository, ran repository update, saw censored error message.

Diff Detail

Repository
rP Phabricator
Branch
dnsrebind3
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 4989
Build 5007: [Placeholder Plan] Wait for 30 Seconds