Summary
A protocol-confusion vulnerability in Netty's legacy WebSocket handshakers can accept a WebSocket upgrade even when required HTTP upgrade headers are missing. An attacker may exploit this behavior to create differences between how Netty and an intervening proxy interpret the same request, enabling HTTP request smuggling or related protocol-confusion attacks.
Affected context
The issue occurs in Netty deployments that use the affected V07 or V08 WebSocket handshaker behavior and process upgrade requests through a proxy, gateway, load balancer, or other intermediary. Risk is higher when the intermediary requires standard Upgrade headers while the backend accepts a protocol switch based on an incomplete or nonstandard request.
Exploit preconditions
- Attack surface: An HTTP-accessible Netty endpoint that supports WebSocket negotiation
- Required access: Ability to send network requests to the endpoint, typically without privileged application access
- Trigger point: WebSocket handshake processing by the lax V07 or V08 handshaker
- Why exploitation is possible: The backend may switch protocols after receiving a WebSocket version indicator even when
Connection: UpgradeandUpgrade: websocketheaders are absent, allowing a proxy and backend to assign different meanings to the request stream
Why this happens
The underlying bug is inconsistent validation of WebSocket handshake requirements. The handshaker treats the WebSocket version header as sufficient to proceed with a protocol switch instead of requiring the complete HTTP Upgrade semantics expected by intermediaries. This creates divergent parsing and state-transition behavior between a proxy and the backend, mapping to CWE-444, Inconsistent Interpretation of HTTP Requests.
Potential impact
- An attacker may smuggle HTTP requests past intermediary controls
- A proxy and backend could interpret request boundaries or protocols differently
- Access-control, routing, logging, or filtering decisions may be bypassed
- Backend endpoints may receive unintended requests
- Session integrity or application data confidentiality could be affected
General mitigation guidance
Mitigation generally focuses on enforcing complete and standards-aligned
WebSocket handshake validation before any protocol transition occurs.
Common defensive patterns include:
- Require all mandatory Upgrade and Connection semantics before switching protocols
- Reject malformed, incomplete, or unexpected WebSocket handshake combinations
- Ensure proxies, gateways, and backends apply consistent request parsing rules
- Disable legacy handshake paths when they are not required by the application
- Apply least-privilege network exposure and isolate administrative or sensitive endpoints
- Normalize or reject ambiguous requests at the earliest trusted boundary
How teams detect issues like this
Detection approaches commonly include:
- Static analysis and code review for WebSocket handshakes that validate version fields without validating required upgrade headers
- Tests covering missing, duplicated, conflicting, or malformed
ConnectionandUpgradeheaders - Differential testing through each proxy, gateway, and backend combination to identify inconsistent protocol transitions
- Web application firewall or gateway policies that reject incomplete WebSocket upgrade requests
- Monitoring for unexpected protocol switches, malformed handshake patterns, and backend requests absent from proxy logs
- Neutral automated security review tools that flag request-parsing discrepancies and protocol-confusion patterns

