Sploitus

Exploit for Mercurial patch.py文件目录遍历漏洞

seebug · 2008-07-17

Exploit Code

MARKDOWN25 lines
## https://sploitus.com/exploit?id=SSV:3666
BUGTRAQ  ID: 30072
CVE(CAN) ID: CVE-2008-2942

Mercurial是分布式的源码管理控制系统。

Mercurial的mercurial/patch.py文件中没有正确地过滤对applydiff()函数的输入参数,如果远程攻击者提交了恶意请求的话,就可以通过目录遍历攻击重新命名代码库外任意文件的名称。

Mercurial 1.0.1
 Gentoo
------
Gentoo已经为此发布了一个安全公告(GLSA-200807-09)以及相应补丁:
GLSA-200807-09:Mercurial: Directory traversal
链接:<a href=http://security.gentoo.org/glsa/glsa-200807-09.xml target=_blank>http://security.gentoo.org/glsa/glsa-200807-09.xml</a>

所有Mercurial用户都应升级到最新版本:

    # emerge --sync
    # emerge --ask --oneshot --verbose &quot;&gt;=3Ddev-util/mercurial-1.0.1-r2&quot;

Mercurial
---------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

<a href=http://www.selenic.com/hg/rev/87c704ac92d4 target=_blank>http://www.selenic.com/hg/rev/87c704ac92d4</a>