Page MenuHomePhabricator

Censor response bodies from Mercurial error messages
ClosedPublic

Authored by epriestley on Mar 26 2015, 4:50 PM.
Tags
None
Referenced Files
F18189886: D12170.id29244.diff
Sat, Aug 16, 10:40 PM
F18162615: D12170.id29253.diff
Fri, Aug 15, 4:46 AM
F18102393: D12170.id29244.diff
Sat, Aug 9, 8:31 PM
F17879729: D12170.id.diff
Mon, Jul 28, 8:59 PM
F17861435: D12170.diff
Sun, Jul 27, 10:49 PM
F17850725: D12170.diff
Sun, Jul 27, 10:22 AM
F17824718: D12170.diff
Sat, Jul 26, 5:41 AM
F17817267: D12170.diff
Fri, Jul 25, 11:25 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