CVE-2016-3068: Mercurial : URL Vulnerability

HIGH
Advisory Identifier: GHSA-j7c2-rqm3-c97m
CVSS 8.8
CWE-20
Published
Advisory Summary

CVE-2016-3068 is a HIGH (CVSS 8.8) : url vulnerability (CWE-20: Improper Input Validation) affecting Mercurial libraries in the PyPI ecosystem. The issue involves : url. Remediation is available by upgrading affected packages to version 3.7.3.

CVE-2016-3068 at a Glance

CVE Identifier CVE-2016-3068
GHSA Identifier GHSA-j7c2-rqm3-c97m
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Mercurial
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2016-3068

To remediate this vulnerability, upgrade all affected Mercurial dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mercurial fixed: 3.7.3
pip install mercurial>=3.7.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show mercurial

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2016-3068, inspect your installed packages using pip:

pip show mercurial

Analyze the terminal output to locate any version of Mercurial in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.3), your application is affected.

Note: The pip show mercurial command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Mercurial, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Mercurial before 3.7.3 allows remote attackers to execute arbitrary code via a crafted git ext:: URL when cloning a subrepository.

CVE-2016-3068 Affected Mercurial Versions

1 component(s)
Fixed Versions:
3.7.3
Product / Package Ecosystem Affected Versions Fixed Version
mercurial
PyPI
< 3.7.3
3.7.3

References

NVD — CVE-2016-3068 NVD
https://nvd.nist.gov/vuln/detail/CVE-2016-3068
Mercurial Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/mercurial/PYSEC-2016-26.yaml
Mercurial Security Information SECURITY
https://security.gentoo.org/glsa/201612-19
selenic.com/repo/hg-stable/rev/... WEB
https://selenic.com/repo/hg-stable/rev/34d43cb85de8
Mercurial Security Information SECURITY
https://web.archive.org/web/20200228003737/http://www.securityfocus.com/bid/85733
Mercurial Security Information SECURITY
https://www.mercurial-scm.org/wiki/WhatsNew#Mercurial_3.7.3_.282016-3-29.29
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-April/181505.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-April/181542.html
Mercurial Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00016.html
Mercurial Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00017.html
Mercurial Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00018.html
Mercurial Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00043.html
rhn.redhat.com/errata/rhsa-2016-07... WEB
http://rhn.redhat.com/errata/RHSA-2016-0706.html
Mercurial Security Information SECURITY
http://www.debian.org/security/2016/dsa-3542
Mercurial Security Information SECURITY
http://www.oracle.com/technetwork/topics/security/bulletinapr2016-2952098.html
Mercurial Security Information SECURITY
http://www.oracle.com/technetwork/topics/security/linuxbulletinapr2016-2952096.html

Frequently Asked Questions

What is CVE-2016-3068?
CVE-2016-3068 is a security vulnerability in Mercurial involving : URL under CWE-20: Improper Input Validation.
Which Mercurial versions are affected?
Affected versions include releases prior to 3.7.3 across affected packages: mercurial.
What version fixes CVE-2016-3068?
Upgrading to 3.7.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mercurial affected?
Yes, mercurial is affected in releases prior to 3.7.3. Upgrade your dependency to 3.7.3 or later.
What is the CVSS score of CVE-2016-3068?
CVE-2016-3068 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2016-3068?
CVE-2016-3068 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check PyPI dependencies for CVE-2016-3068?
Run the dependency tree command: 'pip show mercurial'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-j7c2-rqm3-c97m",
  "modified" : "2024-09-24T20:41:59Z",
  "published" : "2022-05-14T02:08:47Z",
  "aliases" : [ "CVE-2016-3068" ],
  "summary" : "Mercurial arbitrary code execution via a crafted git ext:: URL ",
  "details" : "Mercurial before 3.7.3 allows remote attackers to execute arbitrary code via a crafted git ext:: URL when cloning a subrepository.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mercurial"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.7.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-3068"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/mercurial/PYSEC-2016-26.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/201612-19"
  }, {
    "type" : "WEB",
    "url" : "https://selenic.com/repo/hg-stable/rev/34d43cb85de8"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200228003737/http://www.securityfocus.com/bid/85733"
  }, {
    "type" : "WEB",
    "url" : "https://www.mercurial-scm.org/wiki/WhatsNew#Mercurial_3.7.3_.282016-3-29.29"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-April/181505.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-April/181542.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00016.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00017.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00018.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2016-04/msg00043.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2016-0706.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2016/dsa-3542"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/topics/security/bulletinapr2016-2952098.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/topics/security/linuxbulletinapr2016-2952096.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-01T16:53:44Z",
    "nvd_published_at" : "2016-04-13T16:59:00Z"
  }
}