/

CVE-2026-97687

Severity:

HIGH RISK

(8.1)

TLS Verification Bypass (CWE-295) in urllib3 Proxies

CVE-2026-97687

Analyzed

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295, CWE-440

Impact:

HTTPS Proxy Man-in-the-Middle and Credential Exposure

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A TLS configuration separation flaw in urllib3 can cause target-server verification settings to be applied to an HTTPS proxy connection. In affected proxy configurations, an attacker who can impersonate the proxy may observe or modify forwarded traffic and may receive a target TLS client certificate.

A TLS configuration separation flaw in urllib3 can cause target-server verification settings to be applied to an HTTPS proxy connection. In affected proxy configurations, an attacker who can impersonate the proxy may observe or modify forwarded traffic and may receive a target TLS client certificate.

Affected context

The issue occurs in urllib3 applications that use HTTPS proxies while configuring TLS options for the target server, particularly when forwarding HTTPS traffic or using target-specific identity and verification settings. Risk is higher when shared SSL contexts are reused and settings such as CERT_NONE can mutate the effective proxy verification policy.

The issue occurs in urllib3 applications that use HTTPS proxies while configuring TLS options for the target server, particularly when forwarding HTTPS traffic or using target-specific identity and verification settings. Risk is higher when shared SSL contexts are reused and settings such as CERT_NONE can mutate the effective proxy verification policy.

Exploit preconditions

  • Attack surface: HTTPS proxy connection handling in urllib3
  • Required access: The attacker must be able to intercept or impersonate the configured HTTPS proxy, typically through control of the network path or proxy endpoint
  • Trigger point: Creation or reuse of an HTTPS proxy connection with target-specific TLS settings
  • Why exploitation is possible: Target-server TLS options can overwrite or mutate proxy TLS verification settings, potentially causing the proxy certificate to be accepted without proper validation
  • Attack surface: HTTPS proxy connection handling in urllib3
  • Required access: The attacker must be able to intercept or impersonate the configured HTTPS proxy, typically through control of the network path or proxy endpoint
  • Trigger point: Creation or reuse of an HTTPS proxy connection with target-specific TLS settings
  • Why exploitation is possible: Target-server TLS options can overwrite or mutate proxy TLS verification settings, potentially causing the proxy certificate to be accepted without proper validation

Why this happens

The underlying bug is a failure to keep TLS configuration domains separate. Settings intended for the target server, including disabled certificate verification, can be applied to the HTTPS proxy handshake or mutate a shared proxy SSL context.

This maps primarily to CWE-295: Improper Certificate Validation, because the proxy certificate may not be validated according to the intended policy. It also relates to CWE-440: Expected Behavior Violation, since configuration reuse and forwarding behavior do not preserve the required distinction between proxy and target TLS semantics.

The underlying bug is a failure to keep TLS configuration domains separate. Settings intended for the target server, including disabled certificate verification, can be applied to the HTTPS proxy handshake or mutate a shared proxy SSL context.

This maps primarily to CWE-295: Improper Certificate Validation, because the proxy certificate may not be validated according to the intended policy. It also relates to CWE-440: Expected Behavior Violation, since configuration reuse and forwarding behavior do not preserve the required distinction between proxy and target TLS semantics.

Potential impact

  • An attacker may observe forwarded HTTP or HTTPS traffic handled through the compromised proxy connection
  • An attacker may modify traffic before it reaches the target service
  • A target TLS client certificate may be exposed to the impersonating proxy
  • Subsequent connections reusing a mutated context may continue without effective proxy certificate verification
  • Confidentiality and integrity of communications through the affected proxy may be reduced
  • An attacker may observe forwarded HTTP or HTTPS traffic handled through the compromised proxy connection
  • An attacker may modify traffic before it reaches the target service
  • A target TLS client certificate may be exposed to the impersonating proxy
  • Subsequent connections reusing a mutated context may continue without effective proxy certificate verification
  • Confidentiality and integrity of communications through the affected proxy may be reduced

General mitigation guidance

Mitigation generally focuses on preserving independent TLS policies for the target server and HTTPS proxy.

Common defensive patterns include:

  • Keep proxy and target SSL contexts separate and immutable after construction
  • Apply certificate verification settings only to the connection for which they were intended
  • Avoid disabling certificate verification, especially in configurations that reuse contexts
  • Use explicit proxy certificate validation and trusted certificate authorities
  • Restrict access to proxy configuration and protect network paths to trusted proxy endpoints
  • Avoid exposing client certificates to intermediaries unless that behavior is explicitly required
  • Run applications with least privilege and minimize the sensitivity of credentials available to proxied requests

Mitigation generally focuses on preserving independent TLS policies for the target server and HTTPS proxy.

Common defensive patterns include:

  • Keep proxy and target SSL contexts separate and immutable after construction
  • Apply certificate verification settings only to the connection for which they were intended
  • Avoid disabling certificate verification, especially in configurations that reuse contexts
  • Use explicit proxy certificate validation and trusted certificate authorities
  • Restrict access to proxy configuration and protect network paths to trusted proxy endpoints
  • Avoid exposing client certificates to intermediaries unless that behavior is explicitly required
  • Run applications with least privilege and minimize the sensitivity of credentials available to proxied requests

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis of code that combines HTTPS proxy settings with target-specific TLS options
  • Code review checks for shared or mutable SSL contexts used across proxy and target connections
  • Tests that verify proxy certificate validation remains enabled when target verification is relaxed
  • Runtime telemetry identifying unexpected proxy certificate changes or connections accepted without verification
  • Policy enforcement that disallows CERT_NONE and equivalent verification bypasses in production
  • Automated dependency and security review tools that flag vulnerable HTTP client behavior

Organizations can look for this issue through:

  • Static analysis of code that combines HTTPS proxy settings with target-specific TLS options
  • Code review checks for shared or mutable SSL contexts used across proxy and target connections
  • Tests that verify proxy certificate validation remains enabled when target verification is relaxed
  • Runtime telemetry identifying unexpected proxy certificate changes or connections accepted without verification
  • Policy enforcement that disallows CERT_NONE and equivalent verification bypasses in production
  • Automated dependency and security review tools that flag vulnerable HTTP client behavior

Sources

SourceLink
github.comgithub.com/urllib3/urllib3/commit/07408cec79d1856d81bb42c74a904a24fdb9e465
github.comgithub.com/urllib3/urllib3/commit/b6447295fff7b38fdffc67e0df9712d60cef3cc3
github.comgithub.com/urllib3/urllib3/pull/5093
github.comgithub.com/urllib3/urllib3/releases/tag/2.8.0
github.comgithub.com/urllib3/urllib3/security/advisories/GHSA-8988-9cw3-xx77

Frequently asked

questions

Potentially. Exploitation generally requires the attacker to intercept or impersonate the HTTPS proxy, rather than directly attacking the target application.

The attacker needs a position that allows proxy impersonation or traffic interception, such as control of the proxy endpoint or a suitable network path. Application-level access alone may not be sufficient.

Keep proxy and target TLS configuration fully separate, preserve proxy certificate verification, and avoid mutable shared SSL contexts.

Test proxy and target TLS behavior independently, prohibit verification bypasses in production policies, protect proxy endpoints, and review connection-pooling code for configuration mutation.

Potentially. Exploitation generally requires the attacker to intercept or impersonate the HTTPS proxy, rather than directly attacking the target application.

The attacker needs a position that allows proxy impersonation or traffic interception, such as control of the proxy endpoint or a suitable network path. Application-level access alone may not be sufficient.

Keep proxy and target TLS configuration fully separate, preserve proxy certificate verification, and avoid mutable shared SSL contexts.

Test proxy and target TLS behavior independently, prohibit verification bypasses in production policies, protect proxy endpoints, and review connection-pooling code for configuration mutation.

Find out what's already
exploitable in your codebase.