CVE-2017-17458: Mercurial vulnerable to arbitrary code injection
9.8
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.94714%
CWE
Published
5/13/2022
Updated
9/25/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
mercurial | pip | < 4.4.1 | 4.4.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from Mercurial's handling of Git subrepositories, where a malicious .git/hooks/post-update
script could be executed. The functions in the Git subrepo module (gitsubrepo) that process
updates or checkouts (e.g., _update
, get
) are directly responsible for interacting with the subrepo's configuration and hooks. The fixes in Mercurial 4.4.1 (e.g., disallowing symlink traversal and adding subrepo operation restrictions) imply these functions lacked proper validation. The CWE-78 classification confirms the issue involves improper neutralization of OS commands, aligning with the described attack vector.