VYPR
Unrated severityNVD Advisory· Published Jun 17, 2026

PHP Standard Library: HTTP/2 server-side missing content-length validation enables request smuggling

CVE-2026-48979

Description

PHP Standard Library (PSL) is set of APIs covering async, collections, networking, I/O, cryptography, terminal UI, etc. In versions 6.1.0, 6.1.1 and 6.2.0, the Psl\H2\ServerConnection does not validate that the total bytes received in DATA frames match the content-length header declared in the HEADERS frame, allowing request smuggling. This is in violation of RFC 9113 §8.1.1. A malicious client is able to send more DATA bytes than declared, smuggling additional content past application-level size limits and send fewer DATA bytes than declared and close the stream early, causing applications that trust the declared length to behave incorrectly. The vulnerability is only reachable for consumers using Psl\H2\ServerConnection directly to accept untrusted client traffic. Consumers of documented high-level PSL APIs are not affected. This issue has been fixed in versions 6.1.2 and 6.2.1.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

1

Patches

Vulnerability mechanics

Root cause

"Missing validation that total bytes in HTTP/2 DATA frames match the content-length header declared in the HEADERS frame."

Attack vector

A malicious HTTP/2 client can send DATA frames whose total payload size does not match the `content-length` header sent in the preceding HEADERS frame. By sending more bytes than declared, the attacker smuggles additional content past application-level size limits; by sending fewer bytes and closing the stream early, the attacker causes applications that trust the declared length to behave incorrectly. This violates RFC 9113 §8.1.1 and is only reachable when `Psl\H2\ServerConnection` is used directly to accept untrusted client traffic.

Affected code

The vulnerability resides in `Psl\H2\ServerConnection` (and the underlying `Psl\H2\Internal\StateMachine`), which failed to validate that the total bytes received in HTTP/2 DATA frames match the `content-length` header declared in the HEADERS frame. The patch adds a new test file `packages/h2/tests/unit/StateMachine/ContentLengthValidationTest.php` that exercises the missing validation logic, confirming the defect is in the server-side state machine's handling of content-length enforcement.

What the fix does

The patch introduces a comprehensive test suite (`ContentLengthValidationTest.php`) that validates content-length enforcement in the server-side state machine. The tests verify that DATA frames matching the declared content-length succeed, while frames exceeding or falling short of the declared length throw a `StreamException` with the message 'content-length mismatch'. Additionally, malformed content-length values (non-digit, empty, negative, hex, whitespace) are rejected, and the validation is correctly skipped when no content-length header is present. The patch does not show the production code changes, but the test expectations confirm that the fix enforces RFC 9113 §8.1.1 by rejecting mismatched payload sizes.

Preconditions

  • configThe consumer must use Psl\H2\ServerConnection directly to accept untrusted client traffic.
  • networkThe attacker must be able to establish an HTTP/2 connection and send arbitrary HEADERS and DATA frames.

Generated on Jun 18, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

3

News mentions

0

No linked articles in our index yet.