VYPR
Low severity3.7NVD Advisory· Published Jan 11, 2017· Updated May 6, 2026

CVE-2016-9015

CVE-2016-9015

Description

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.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
urllib3PyPI
>= 1.17, < 1.18.11.18.1

Affected products

2
  • cpe:2.3:a:python:urllib3:1.17:*:*:*:*:*:*:*+ 1 more
    • cpe:2.3:a:python:urllib3:1.17:*:*:*:*:*:*:*
    • cpe:2.3:a:python:urllib3:1.18:*:*:*:*:*:*:*

Patches

1
c32cdbc16a96

CVE-2016-9015: Correct set verify flags.

https://github.com/urllib3/urllib3Cory BenfieldOct 24, 2016via ghsa
1 file changed · +9 4
  • urllib3/contrib/pyopenssl.py+9 4 modified
    @@ -88,12 +88,15 @@
     except AttributeError:
         pass
     
    -_openssl_verify = {
    +_stdlib_to_openssl_verify = {
         ssl.CERT_NONE: OpenSSL.SSL.VERIFY_NONE,
         ssl.CERT_OPTIONAL: OpenSSL.SSL.VERIFY_PEER,
         ssl.CERT_REQUIRED:
             OpenSSL.SSL.VERIFY_PEER + OpenSSL.SSL.VERIFY_FAIL_IF_NO_PEER_CERT,
     }
    +_openssl_to_stdlib_verify = dict(
    +    (v, k) for k, v in _stdlib_to_openssl_verify.items()
    +)
     
     #: The list of supported SSL/TLS cipher suites.
     DEFAULT_SSL_CIPHER_LIST = util.ssl_.DEFAULT_CIPHERS.encode('ascii')
    @@ -367,11 +370,13 @@ def options(self, value):
     
         @property
         def verify_mode(self):
    -        return self._ctx.get_verify_mode()
    +        return _openssl_to_stdlib_verify[self._ctx.get_verify_mode()]
     
         @verify_mode.setter
         def verify_mode(self, value):
    -        self._ctx.set_verify(value, _verify_callback)
    +        self._ctx.set_verify(
    +            _stdlib_to_openssl_verify[value], _verify_callback
    +        )
     
         def set_default_verify_paths(self):
             self._ctx.set_default_verify_paths()
    @@ -440,7 +445,7 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
         if keyfile:
             ctx.use_privatekey_file(keyfile)
         if cert_reqs != ssl.CERT_NONE:
    -        ctx.set_verify(_openssl_verify[cert_reqs], _verify_callback)
    +        ctx.set_verify(_stdlib_to_openssl_verify[cert_reqs], _verify_callback)
         if ca_certs or ca_cert_dir:
             try:
                 ctx.load_verify_locations(ca_certs, ca_cert_dir)
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.