Page MenuHomePhabricator

Censor response bodies from Mercurial error messages
ClosedPublic

Authored by epriestley on Mar 26 2015, 4:50 PM.
Tags
None
Referenced Files
F18778226: D12170.id.diff
Sat, Oct 11, 8:34 AM
F18771922: D12170.diff
Wed, Oct 8, 10:57 PM
F18717822: D12170.id29244.diff
Mon, Sep 29, 2:31 PM
F18704938: D12170.id29253.diff
Sun, Sep 28, 9:25 AM
F18697271: D12170.diff
Sat, Sep 27, 9:22 AM
F18573497: D12170.diff
Sep 10 2025, 8:49 AM
F18505233: D12170.id.diff
Sep 5 2025, 12:30 AM
F18496872: D12170.diff
Sep 4 2025, 5:46 PM
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