diff -r 55681baf4cf9 -r 173ecccb9ee7 mercurial/subrepo.py --- a/mercurial/subrepo.py Mon Jul 31 16:04:44 2017 -0700 +++ b/mercurial/subrepo.py Mon Jul 31 16:44:17 2017 -0700 @@ -1274,6 +1274,10 @@ # The revision must be specified at the end of the URL to properly # update to a directory which has since been deleted and recreated. args.append('%s@%s' % (state[0], state[1])) + + # SEC: check that the ssh url is safe + util.checksafessh(state[0]) + status, err = self._svncommand(args, failok=True) _sanitize(self.ui, self.wvfs, '.svn') if not re.search('Checked out revision [0-9]+.', status):