Mercurial > public > mercurial-scm > hg
diff tests/test-subrepo-svn.t @ 33660:3fee7f7d2da0 stable 4.3.1
ssh: unban the use of pipe character in user@host:port string
This vulnerability was fixed by the previous patch and there were more ways
to exploit than using '|shellcmd'. So it doesn't make sense to reject only
pipe character.
Test cases are updated to actually try to exploit the bug. As the SSH bridge
of git/svn subrepos are not managed by our code, the tests for non-hg subrepos
are just removed.
This may be folded into the original patches.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 07 Aug 2017 22:22:28 +0900 |
parents | 60ee7af2a2ba |
children | 846942fd6d15 |
line wrap: on
line diff
--- a/tests/test-subrepo-svn.t Fri Aug 04 23:54:12 2017 -0700 +++ b/tests/test-subrepo-svn.t Mon Aug 07 22:22:28 2017 +0900 @@ -668,30 +668,6 @@ abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned nested' (in subrepository "s") [255] -also check for a pipe - - $ cd ssh-vuln - $ echo "s = [svn]svn+ssh://fakehost|sh%20nested" > .hgsub - $ hg ci -m3 - $ cd .. - $ rm -r ssh-vuln-clone - $ hg clone ssh-vuln ssh-vuln-clone - updating to branch default - abort: potentially unsafe url: 'svn+ssh://fakehost|sh nested' (in subrepository "s") - [255] - -also check that a percent encoded '|' (%7C) doesn't work - - $ cd ssh-vuln - $ echo "s = [svn]svn+ssh://fakehost%7Csh%20nested" > .hgsub - $ hg ci -m3 - $ cd .. - $ rm -r ssh-vuln-clone - $ hg clone ssh-vuln ssh-vuln-clone - updating to branch default - abort: potentially unsafe url: 'svn+ssh://fakehost|sh nested' (in subrepository "s") - [255] - also check that hiding the attack in the username doesn't work: $ cd ssh-vuln