cbcvebase.
CVE-2017-9462
published 2017-06-06

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

PriorityP273high8.8CVSS 3.1
AVNACLPRLUINSUCHIHAH
EXPLOIT
EPSS
21.68%
97.6th percentile
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.

Affected

24 ranges
VendorProductVersion rangeFixed in
debiandebian_linux——
debiandebian_linux——
debianmercurial< mercurial 4.3.1-1 (bookworm)mercurial 4.3.1-1 (bookworm)
mercurialmercurial< 4.1.34.1.3
mercurialmercurial>= 0 < 4.3.1-14.3.1-1
mercurialmercurial>= 0 < 4.3.1-14.3.1-1
mercurialmercurial>= 0 < 4.3.1-14.3.1-1
mercurialmercurial>= 0 < 4.3.1-14.3.1-1
mercurialmercurial>= 0 < 4.1.34.1.3
redhatenterprise_linux_desktop——
redhatenterprise_linux_desktop——
redhatenterprise_linux_server——
redhatenterprise_linux_server——
redhatenterprise_linux_server_aus——
redhatenterprise_linux_server_aus——
redhatenterprise_linux_server_aus——
redhatenterprise_linux_server_eus——
redhatenterprise_linux_server_eus——
redhatenterprise_linux_server_eus——
redhatenterprise_linux_server_eus——
redhatenterprise_linux_server_tus——
redhatenterprise_linux_server_tus——
redhatenterprise_linux_workstation——
redhatenterprise_linux_workstation——

Detection & IOCsextracted from sources · hover to see the quote

commandhg serve --stdio --debugger↗
  • →Detect SSH sessions invoking 'hg serve --stdio' with '--debugger' passed as a repository name or argument, which triggers the Python debugger (pdb) and allows arbitrary code execution. ↗
  • →Monitor for exploitation via custom hg-ssh wrapper scripts that fail to sanitize parameters; look for '--debugger' appearing in SSH command arguments passed to the hg binary. ↗
  • →Alert on Mercurial versions prior to 4.1.3 running 'hg serve --stdio', as these are vulnerable to this debugger injection attack. ↗
  • ·Exploitation requires the attacker to be a remote authenticated user; unauthenticated access is not sufficient to trigger this vulnerability. ↗
  • ·The vulnerability is specifically triggered through the 'hg serve --stdio' code path; deployments not exposing this interface (e.g., not using hg-ssh or SSH-based Mercurial serving) have reduced exposure. ↗

CVSS provenance

nvdv3.18.8HIGHCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
nvdv2.09.0CRITICALAV:N/AC:L/Au:S/C:C/I:C/A:C
osv8.8HIGH
vendor_debian8.8HIGH
vendor_redhat8.8HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.