Remote code execution in Mercurial - CVE-2017-9462

 

Remote code execution in Mercurial - CVE-2017-9462

Published: June 28, 2017 / Updated: September 14, 2018


Vulnerability identifier: #VU7220
CSH Severity: High
CVSS v4: 8.7 [CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2017-9462
CWE-ID: CWE-20
Exploitation vector: Remote access
Exploit availability: Public exploit is available

Vulnerability details

The vulnerability allows a remote authenticated attacker to execute arbitrary code on the target system.

The weakness exists due to improper input validation in "hg serve --stdio". A remote attacker can use --debugger as a repository name and consequently execute arbitrary code with privileges of the current user.

Successful exploitation of the vulnerability may result in system compromise.

Affected software

Mercurial
Amazon Linux AMI
Gentoo Linux
Red Hat Enterprise Linux for x86_64
Fedora
mercurial

How to mitigate CVE-2017-9462

Update to version 4.1.3 or later.

mercurial - addressed in versions 3.7.3-2.fc24, 3.8.1-3.fc25

Links to Public Exploits and PoC-codes

External References

Related Security Bulletins