CVE-2016-3068: Mercurial Remote Code Execution

mercurial Updated 02 Oct 2025

Summary

13/04/2016
Yes i
High
8.8

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback