Summary
A request smuggling flaw in PSL's Psl\H2\ServerConnection allows HTTP/2 clients to send DATA frames whose size does not match the content-length declared in HEADERS frames.
When applications trust the declared content length, a malicious client can sneak additional bytes past application-level limits or truncate requests early, leading to confused message boundaries and incorrect server behavior.
Affected context
This vulnerability affects deployments that:
- Use PHP Standard Library (PSL) versions 6.1.0, 6.1.1, or 6.2.0
- Call
Psl\H2\ServerConnectiondirectly to accept untrusted HTTP/2 client traffic - Rely on the
content-lengthheader for enforcing request size limits or parsing message bodies
Environments that only use higher-level, documented PSL APIs which wrap HTTP/2 handling are described as not affected, assuming they do not expose raw ServerConnection semantics.
Exploit preconditions
- Attack surface: Network-exposed HTTP/2 endpoints implemented using
Psl\H2\ServerConnection - Required access: Ability to establish a client connection and send crafted HTTP/2 HEADERS and DATA frames
- Trigger point: The server receives a
content-lengthin HEADERS that is inconsistent with the total number of DATA frame bytes on the stream - Why exploitation is possible: The implementation does not enforce that the cumulative DATA payload length exactly matches the declared
content-length, violating RFC 9113 §8.1.1 and allowing extra or missing bytes to be interpreted incorrectly by application code.
Why this happens
The core issue is a protocol validation flaw in the HTTP/2 server implementation.
Psl\H2\ServerConnection accepts incoming HEADERS with a content-length header but fails to track and enforce that the sum of all DATA frames on the stream equals this value.
This maps to CWE-444: Inconsistent Interpretation of HTTP Requests, where lower-level parsing and higher-level application logic disagree on message boundaries and size, enabling request smuggling and confusion between layers.
Potential impact
- Bypassing application-level request size limits or payload validation by smuggling additional bytes after the declared
content-length - Causing application logic to parse concatenated or partially hidden requests as a single request
- Triggering incorrect business logic decisions due to truncated bodies or mismatched metadata
- Facilitating cache pollution or cache poisoning when smuggled data influences how upstream or downstream components interpret requests
- Potential abuse of downstream services that rely on the original
content-lengthfor parsing
General mitigation guidance
Mitigation patterns focus on strict protocol compliance and reducing trust in client-declared metadata:
- Enforce that the total DATA bytes for a stream exactly match the
content-lengthdeclared in HEADERS before exposing the body to application code. - Reject or abort streams where more bytes than declared are received, or where the stream ends before the declared count is met.
- Normalize and validate HTTP/2 semantics at a single layer, ensuring that higher layers never reinterpret request boundaries independently.
- Implement conservative maximum request body sizes at the protocol handler layer, independent of client-declared lengths.
- Prefer using well-vetted, higher-level HTTP server abstractions instead of directly handling low-level HTTP/2 frames where possible.
How teams detect issues like this
Organizations can approach detection and verification using:
- Code review: Inspect HTTP/2 server code paths to ensure that body length accounting is tied to
content-lengthand that mismatches cause hard failures. - Static analysis: Define rules that flag I/O code which trusts
content-lengthor similar metadata without enforcing correspondence with actual bytes read. - Dynamic testing: Use integration or fuzz testing to send HEADERS/DATA combinations with mismatched lengths and confirm that the server rejects them consistently.
- Security testing policies: Require protocol compliance test suites for custom transport or framing layers, especially when implementing HTTP/2 or other multiplexed protocols.

