CVE-2016-3068: Mercurial Remote Code Execution
Summary
CVE-2016-3068: Mercurial before 3.7.3 allows remote attackers to execute arbitrary code via a crafted git ext:: URL when cloning a subrepository. Affects mercurial versions < 3.7.3. Fixed in 3.7.3. How to fix ↓
Also tracked for
- mercurial · Debian:11
The same CVE-2016-3068 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 developers with a fast, scalable, and easy-to-use solution for managing source code. Mercurial allows users to clone repositories, track changes, and collaborate with others. However, versions prior to 3.7.3 are vulnerable to a remote code execution vulnerability when cloning a subrepository using a crafted git ext:: URL.
Vulnerability Detail
The vulnerability (CVE-2016-3068) in Mercurial allows remote attackers to execute arbitrary code. This can be exploited by providing a specially crafted git ext:: URL when cloning a subrepository. The vulnerability arises due to improper input validation, allowing the execution of arbitrary commands. An attacker could exploit this vulnerability to execute malicious code on the target system, potentially leading to unauthorized access, data theft, or further compromise of the system.
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.7.3
This is the first release that contains the fix.
pip install --upgrade "mercurial==3.7.3"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is essential to update to the patched version of Mercurial to mitigate the risk of remote code execution.
Conclusion
The vulnerability (CVE-2016-3068) in Mercurial allows remote code execution, posing a significant risk to systems using vulnerable versions. It is crucial to update to Mercurial version 3.7.3 or later to mitigate this vulnerability. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for mercurial →
FAQ
Mercurial is a distributed version control system (DVCS) used for managing source code.
The vulnerability allows remote attackers to execute arbitrary code on the target system, potentially leading to unauthorized access, data theft, or further compromise.
To fix this vulnerability, update Mercurial to version 3.7.3 or later.
No, there is no known workaround. Updating to the patched version is necessary.
The latest version of Mercurial can be downloaded from the official website or through package managers like pip.
Related vulnerabilities
Recent vulnerabilities recorded for mercurial.