Homec4science

Censor response bodies from Mercurial error messages

Authored by epriestley <git@epriestley.com> on Mar 26 2015, 19:13.

Description

Censor response bodies from Mercurial error messages

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.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6755

Differential Revision: https://secure.phabricator.com/D12170

Details

Committed
epriestley <git@epriestley.com>Mar 26 2015, 19:13
Pushed
aubortJan 31 2017, 17:16
Parents
rPH40fb0f98df6c: Mostly defuse DNS rebinding attack for outbound requests
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHa4bfed8415c7: Censor response bodies from Mercurial error messages (authored by epriestley <git@epriestley.com>).Mar 26 2015, 19:13