CVE-2026-97687
HTTPS proxy TLS settings leak into target TLS, enabling MITM on the proxy.
- CVSS 7.6
- CWE-295
- Configuration Issues
- Remote
urllib3 is an HTTP client library for Python. From 1.26.0 until 2.8.0, the proxy_ssl_context, proxy_assert_hostname, proxy_assert_fingerprint, ssl_context, cert_reqs, verify_mode, use_forwarding_for_https=True, and CERT_NONE configuration paths fail to remain separated because target-server TLS settings are incorrectly applied to the HTTPS proxy connection. The trigger is that an application uses an HTTPS proxy and configures target-server TLS settings that must remain separate from the proxy TLS handshake, including HTTPS forwarding with target-specific identity or credentials. Applying cert_reqs=CERT_NONE can overwrite proxy_ssl_context.verify_mode in place, and the mutation persists so later connections reusing the same context may connect to the HTTPS proxy without certificate verification. The attack mechanism is that an attacker intercepts and impersonates the HTTPS proxy after the effective proxy policy accepts the attacker's certificate. The impact is that the attacker can observe or modify forwarded traffic or receive a target TLS client certificate, while CONNECT tunneling still preserves the separate end-to-end target TLS connection. This issue is fixed in version 2.8.0.
- CWE
- CWE-295
- CVSS base score
- 7.6
- Published
- 2026-09-29
- OWASP
- A02 Cryptographic Failures
- Orthogonal defect classification
- Assignment
- Code defect classification
- Incorrect Assignment
- Category
- Configuration Issues
- Subcategory
- Server-Side Request Forgery (SSRF)
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- urllib3
- Fixed by upgrading
- Yes
Solution
Upgrade urllib3 to version 2.8.0 or newer.
Vulnerable code sample
import ssl
import urllib3
def fetch_via_proxy(url: str, proxy_url: str) -> bytes:
# VULNERABLE: cert_reqs=CERT_NONE overwrites proxy SSL verification
http = urllib3.ProxyManager(
proxy_url,
ssl_context=ssl.create_default_context(),
cert_reqs=ssl.CERT_NONE, # disables verification for both target and proxy
proxy_ssl_context=ssl.create_default_context(),
)
resp = http.request('GET', url)
return resp.dataPatched code sample
import ssl
import urllib3
def fetch_via_proxy(url: str, proxy_url: str) -> bytes:
# FIX: keep proxy verification separate from target verification
target_ctx = ssl.create_default_context()
proxy_ctx = ssl.create_default_context()
http = urllib3.ProxyManager(
proxy_url,
ssl_context=target_ctx,
proxy_ssl_context=proxy_ctx,
cert_reqs=ssl.CERT_REQUIRED,
)
resp = http.request('GET', url)
return resp.dataPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Isolate HTTPS proxy TLS settings from target TLS (#5093) (urllib3/urllib3)
src/urllib3/connection.py · HTTPSConnection.connect,src/urllib3/connection.py · HTTPSConnection._connect_tls_proxy,src/urllib3/poolmanager.py · ProxyManager.__init__ - Fix `proxy_ssl_context` ignored for HTTPS forwarding proxies (#3786) (urllib3/urllib3)
src/urllib3/connection.py · HTTPSConnection.connect,src/urllib3/poolmanager.py · ProxyManager.__init__
Cite this entry
@misc{vaitp:cve202697687,
title = {{HTTPS proxy TLS settings leak into target TLS, enabling MITM on the proxy.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-97687},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-97687/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
