CVE-2016-3630: Mercurial Binary Delta Decoder Remote Code Execution
Summary
CVE-2016-3630: The binary delta decoder in Mercurial before 3.7.3 allows remote attackers to execute arbitrary code via a (1) clone, (2) push, or (3) pull command, related to (a) a list sizing rounding error and (b) short records. Affects mercurial versions < 3.7.3. Fixed in 3.7.3. How to fix ↓
Also tracked for
- mercurial · Debian:11
The same CVE-2016-3630 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) used for managing and tracking changes to files. It provides a way for multiple developers to collaborate on a project by keeping track of changes made to the codebase. The Mercurial package, available on PyPI, is vulnerable to a remote code execution vulnerability in its binary delta decoder. This vulnerability allows an attacker to execute arbitrary code by exploiting a list sizing rounding error and short records in the clone, push, or pull commands.
Vulnerability Detail
The vulnerability in Mercurial arises from a flaw in the binary delta decoder. By manipulating the list sizing rounding error and short records, an attacker can craft a malicious delta file that triggers arbitrary code execution when processed by the clone, push, or pull commands. This can lead to unauthorized access, data leakage, or even complete compromise of the affected system. The vulnerability affects versions prior to 3.7.3 of the Mercurial package.
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 crucial to update the Mercurial package to the latest version to mitigate the risk of exploitation.
Conclusion
The Mercurial package is vulnerable to a remote code execution vulnerability in its binary delta decoder. To mitigate the risk, it is important to update the package to version 3.7.3 or later. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for mercurial →
FAQ
Mercurial is a distributed version control system used for managing and tracking changes to files. It provides a way for multiple developers to collaborate on a project by keeping track of changes made to the codebase.
This vulnerability allows an attacker to execute arbitrary code on the affected system. This can lead to unauthorized access, data leakage, or complete compromise of the system.
To fix this vulnerability, update the Mercurial package to version 3.7.3 or later by running the command 'pip install --upgrade mercurial'.
There is no known workaround for this vulnerability. It is crucial to update the Mercurial package to the latest version to mitigate the risk of exploitation.
For more information about this vulnerability, you can refer to the official advisory at https://github.com/pypa/advisory-database/blob/main/vulns/mercurial/PYSEC-2016-29.yaml
Related vulnerabilities
Recent vulnerabilities recorded for mercurial.