Remote code executionin the mercurial package.
Weaponized: a Metasploit exploit is public.
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and consequently execute arbitrary code, by using --debugger as a repository name.
- Upgrade mercurial (PyPI) to 4.1.3 or later.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 18 Apr 2017Metasploit module: Mercurial Custom hg-ssh Wrapper Remote Code Exec.
- 6 Jun 2017CVE ID reserved by mitre.
- 6 Jun 2017Published in the CVE List.
- 5 Aug 2024CVE record last updated.
Attack code anyone can find
Exploit maturity: Weaponized (Metasploit).
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Other vulnerabilities in this package
- access.redhat.com vendor-advisory, x_refsource_REDHAT
- www.mercurial-scm.org x_refsource_CONFIRM
- www.mercurial-scm.org x_refsource_CONFIRM
- lists.debian.org mailing-list, x_refsource_MLIST
- www.debian.org vendor-advisory, x_refsource_DEBIAN
- security.gentoo.org vendor-advisory, x_refsource_GENTOO
- bugs.debian.org x_refsource_CONFIRM
- www.securityfocus.com vdb-entry, x_refsource_BID
Patchminder. CVE-2017-9462: Remote code execution in the mercurial package. https://patchminder.com/cve/cve-2017-9462/ (accessed 5 December 2026).