/

CVE-2026-84381

Severity:

HIGH RISK

(8.1)

Cleartext Transmission (CWE-319) in HTTPX2 WebSockets

CVE-2026-84381

Awaiting Analysis

Vulnerability type

Category:

Cleartext Transmission

CWE:

CWE-319

Impact:

Confidentiality and integrity compromise of WebSocket communications

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

HTTPX2 can fail to establish TLS for secure WebSocket connections routed through a SOCKS5 proxy because the underlying httpcore2 logic recognizes only HTTPS during the TLS upgrade decision. When affected clients connect through such a proxy, sensitive WebSocket handshake data and later frames may travel without encryption or certificate verification, allowing an attacker who can observe or control the proxy path to read, alter, or impersonate traffic.

Affected context

The issue occurs in HTTPX2 WebSocket clients that use a SOCKS5 proxy while connecting to a secure WebSocket origin identified by the wss scheme. It affects deployments using the vulnerable httpcore2 SOCKS proxy handling, where TLS is not initiated before the WebSocket handshake. Requests may expose query parameters, authorization headers, cookies, and subsequent frames on the proxy path.

Exploit preconditions

  • Attack surface: WebSocket connections routed through a SOCKS5 proxy
  • Required access: Ability to observe or influence traffic on the proxy or network path
  • Trigger point: Opening a wss connection through the affected synchronous or asynchronous client path
  • Why exploitation is possible: The TLS upgrade condition recognizes https but not wss, so encrypted transport may not be established and certificate verification may be absent

Why this happens

The underlying bug is an incomplete scheme check in the SOCKS proxy connection logic. The implementation treats HTTPS as the signal for a TLS upgrade but does not apply equivalent handling to secure WebSocket origins using the wss scheme. This causes application data intended for encrypted transport to be sent over a cleartext proxy connection, mapping to CWE-319, Cleartext Transmission of Sensitive Information.

Potential impact

  • An attacker may read WebSocket handshakes, headers, cookies, query parameters, and frames
  • An attacker could modify messages or inject data into an active connection
  • An attacker may impersonate the intended WebSocket server
  • Credentials, session tokens, or application data could be exposed
  • WebSocket-based workflows could be disrupted or manipulated

General mitigation guidance

Mitigation generally focuses on ensuring that secure WebSocket schemes always trigger TLS establishment and certificate verification before application data is exchanged. Secure-by-default client behavior should reject a connection when the requested confidentiality properties cannot be provided. Organizations can reduce input and transport trust by validating URL schemes, proxy behavior, and negotiated security state rather than relying solely on proxy configuration. TLS verification should remain enabled, sensitive connections should use trusted proxy paths, and client processes should run with only the network and credential privileges they require.

How teams detect issues like this

Static analysis and code review can look for scheme-condition branches that handle https but omit wss, as well as proxy connection paths that send protocol handshakes before TLS negotiation. Integration tests should exercise secure WebSocket connections through each supported proxy type and verify certificate validation and encrypted transport. Network monitoring and policy enforcement can flag WebSocket credentials or handshake data appearing in cleartext on proxy interfaces. Automated security review tools may help identify incomplete transport-security checks.

Sources

SourceLink
github.comgithub.com/pydantic/httpx2/commit/fb008dd700b761d955210d9692475c3e2f379453
github.comgithub.com/pydantic/httpx2/pull/1104
github.comgithub.com/pydantic/httpx2/releases/tag/v2.10.0
github.comgithub.com/pydantic/httpx2/security/advisories/GHSA-7mj9-2mp8-4m2p

Frequently asked

questions

It can be exploitable when a client establishes a secure WebSocket connection through an affected SOCKS5 proxy and an attacker can observe or control the proxy or network path. It is not generally triggered by an unrelated direct WebSocket connection.

The attacker needs visibility into or influence over the traffic path, such as control of the proxy, a compromised intermediary, or a position on the relevant network. No application-level account is necessarily required to observe exposed traffic.

Ensure that wss connections always initiate TLS before the WebSocket handshake, require certificate verification, and fail closed when those protections cannot be established.

Test every secure application protocol scheme across supported proxy paths, enforce transport-security policies, monitor for sensitive cleartext traffic, and review scheme-handling logic for incomplete protocol mappings.

Find out what's already
exploitable in your codebase.