CVE-2016-3105: Mercurial - Arbitrary Code Execution via Crafted Git Repository Name
Summary
CVE-2016-3105: The convert extension in Mercurial before 3.8 might allow context-dependent attackers to execute arbitrary code via a crafted git repository name. Affects mercurial versions < 3.8-rc. Fixed in 3.8-rc. How to fix ↓
Also tracked for
- mercurial · Debian:11
The same CVE-2016-3105 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Mercurial is a distributed version control system (DVCS) written in Python. It provides users with the ability to efficiently handle projects of any size and kind. Mercurial is widely used for source code management and version control. However, prior to version 3.8, Mercurial is vulnerable to an arbitrary code execution vulnerability when processing a specially crafted git repository name.
Vulnerability Detail
The vulnerability, identified as CVE-2016-3105, exists in the convert extension of Mercurial. It allows context-dependent attackers to execute arbitrary code by providing a malicious git repository name. This vulnerability can be exploited by an attacker to execute arbitrary commands on the target system, potentially leading to remote code execution or other malicious activities. The vulnerability was fixed in version 3.8-rc of Mercurial.
How To Fix
Latest published version: 7.2.4 as of 22 Oct 2026
pip install --upgrade "mercurial==7.2.4"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
3.8-rc
This is the first release that contains the fix.
pip install --upgrade "mercurial==3.8-rc"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability. However, users can minimize the risk by avoiding the use of untrusted git repository names or by exercising caution when interacting with git repositories from unknown or untrusted sources.
Conclusion
The vulnerability CVE-2016-3105 in Mercurial allowed context-dependent attackers to execute arbitrary code by providing a crafted git repository name. It is crucial to update Mercurial to version 3.8 or later to mitigate the risk of exploitation. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for mercurial →
FAQ
Mercurial is a distributed version control system (DVCS) used for source code management and version control.
The convert extension in Mercurial allows users to convert repositories from other version control systems to Mercurial.
The vulnerability allows attackers to execute arbitrary code, potentially leading to remote code execution or other malicious activities.
Yes, the vulnerability has been fixed in version 3.8-rc of Mercurial.
To protect yourself, it is recommended to update Mercurial to version 3.8 or later and exercise caution when interacting with git repositories from unknown or untrusted sources.
Related vulnerabilities
Recent vulnerabilities recorded for mercurial.