# HG changeset patch # User Sean Farley # Date 1501285652 25200 # Node ID 92b583e3e5223a1836f9c72c68703d7e2724ce08 # Parent f9134e96ed0f03271296e7659e887fbfe5857f90 pull: add tests for unsafe ssh url (SEC) diff -r f9134e96ed0f -r 92b583e3e522 tests/test-pull.t --- a/tests/test-pull.t Fri Jul 28 16:36:36 2017 -0700 +++ b/tests/test-pull.t Fri Jul 28 16:47:32 2017 -0700 @@ -105,4 +105,23 @@ $ URL=`$PYTHON -c "import os; print 'file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` $ hg pull -q "$URL" +SEC: check for unsafe ssh url + + $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path' + pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path + abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' + [255] + $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path' + pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path + abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' + [255] + $ hg pull 'ssh://fakehost|shellcommand/path' + pulling from ssh://fakehost%7Cshellcommand/path + abort: potentially unsafe url: 'ssh://fakehost|shellcommand/path' + [255] + $ hg pull 'ssh://fakehost%7Cshellcommand/path' + pulling from ssh://fakehost%7Cshellcommand/path + abort: potentially unsafe url: 'ssh://fakehost|shellcommand/path' + [255] + $ cd ..