CVE-2016-9015: Urllib3 Urllib3 Incorrect Certificate Validation Vulnerability

MODERATE
Advisory Identifier: GHSA-v4w5-p2hg-8fh6
CVSS 3.7
CWE-295
Published
Advisory Summary

CVE-2016-9015 is a MODERATE (CVSS 3.7) urllib3 incorrect certificate validation vulnerability (CWE-295: Improper Certificate Validation) affecting Urllib3 libraries in the PyPI ecosystem. The issue involves urllib3 incorrect certificate validation. Remediation is available by upgrading affected packages to version 1.18.1.

CVE-2016-9015 at a Glance

CVE Identifier CVE-2016-9015
GHSA Identifier GHSA-v4w5-p2hg-8fh6
Severity MODERATE
CVSS v3.1 Base Score 3.7
CWE Classification CWE-295: Improper Certificate Validation
Affected Product Urllib3
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2016-9015

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

urllib3 fixed: 1.18.1
pip install urllib3>=1.18.1
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 urllib3

How to Check if You Are Affected

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

pip show urllib3

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. In Urllib3, 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

Versions 1.17 and 1.18 of the Python urllib3 library suffer from a vulnerability that can cause them, in certain configurations, to not correctly validate TLS certificates. This places users of the library with those configurations at risk of man-in-the-middle and information leakage attacks. This vulnerability affects users using versions 1.17 and 1.18 of the urllib3 library, who are using the optional PyOpenSSL support for TLS instead of the regular standard library TLS backend, and who are using OpenSSL 1.1.0 via PyOpenSSL. This is an extremely uncommon configuration, so the security impact of this vulnerability is low.

CVE-2016-9015 Affected Urllib3 Versions

1 component(s)
Fixed Versions:
1.18.1
Product / Package Ecosystem Affected Versions Fixed Version
urllib3
PyPI
≥ 1.17
< 1.18.1
1.18.1

References

Frequently Asked Questions

What is CVE-2016-9015?
CVE-2016-9015 is a security vulnerability in Urllib3 involving Urllib3 Incorrect Certificate Validation under CWE-295: Improper Certificate Validation.
Which Urllib3 versions are affected?
Affected versions include releases prior to 1.18.1 across affected packages: urllib3.
What version fixes CVE-2016-9015?
Upgrading to 1.18.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is urllib3 affected?
Yes, urllib3 is affected in releases prior to 1.18.1. Upgrade your dependency to 1.18.1 or later.
What is the CVSS score of CVE-2016-9015?
CVE-2016-9015 has a CVSS v3.1 base score of 3.7 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2016-9015?
CVE-2016-9015 is classified under CWE-295: Improper Certificate Validation (The product does not validate, or incorrectly validates, a certificate.).
How can I check PyPI dependencies for CVE-2016-9015?
Run the dependency tree command: 'pip show urllib3'. 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-v4w5-p2hg-8fh6",
  "modified" : "2024-11-18T22:58:27Z",
  "published" : "2022-05-17T03:05:04Z",
  "aliases" : [ "CVE-2016-9015" ],
  "summary" : "Urllib3 Incorrect Certificate Validation",
  "details" : "Versions 1.17 and 1.18 of the Python urllib3 library suffer from a vulnerability that can cause them, in certain configurations, to not correctly validate TLS certificates. This places users of the library with those configurations at risk of man-in-the-middle and information leakage attacks. This vulnerability affects users using versions 1.17 and 1.18 of the urllib3 library, who are using the optional PyOpenSSL support for TLS instead of the regular standard library TLS backend, and who are using OpenSSL 1.1.0 via PyOpenSSL. This is an extremely uncommon configuration, so the security impact of this vulnerability is low.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "urllib3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.17"
      }, {
        "fixed" : "1.18.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.18"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-9015"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/urllib3/urllib3/commit/c32cdbc16a9634fa0f8c829d1270301570158715"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2017-98.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/urllib3/urllib3"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20210123184150/http://www.securityfocus.com/bid/93941"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/10/27/6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-295" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-31T20:59:18Z",
    "nvd_published_at" : "2017-01-11T16:59:00Z"
  }
}