comparison tests/test-clone.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 8cb9e921ef8c
children 6c1a9fd8361b
comparison
equal deleted inserted replaced
33659:8cb9e921ef8c 33660:3fee7f7d2da0
1109 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' 1109 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1110 [255] 1110 [255]
1111 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path' 1111 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1112 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' 1112 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1113 [255] 1113 [255]
1114 $ hg clone 'ssh://fakehost|shellcommand/path' 1114 $ hg clone 'ssh://fakehost|touch%20owned/path'
1115 abort: potentially unsafe url: 'ssh://fakehost|shellcommand/path' 1115 abort: no suitable response from remote hg!
1116 [255] 1116 [255]
1117 $ hg clone 'ssh://fakehost%7Cshellcommand/path' 1117 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1118 abort: potentially unsafe url: 'ssh://fakehost|shellcommand/path' 1118 abort: no suitable response from remote hg!
1119 [255] 1119 [255]
1120 1120
1121 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path' 1121 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1122 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path' 1122 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1123 [255] 1123 [255]