Page MenuHomePhabricator

Censor response bodies from Mercurial error messages
ClosedPublic

Authored by epriestley on Mar 26 2015, 4:50 PM.
Tags
None
Referenced Files
F19078671: D12170.id.diff
Dec 1 2025, 6:46 PM
F19067675: D12170.diff
Nov 30 2025, 9:33 AM
F18853743: D12170.id.diff
Oct 31 2025, 7:12 PM
F18849364: D12170.diff
Oct 30 2025, 9:22 AM
F18830482: D12170.diff
Oct 25 2025, 7:01 AM
F18821155: D12170.id.diff
Oct 22 2025, 7:44 PM
F18778226: D12170.id.diff
Oct 11 2025, 8:34 AM
F18771922: D12170.diff
Oct 8 2025, 10:57 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable