Skip to content

react/http: A malformed HTTP chunked body can lead to a denial-of-service and peg the CPU

High severity GitHub Reviewed Published Sep 9, 2026 in reactphp/http • Updated Sep 17, 2026

Package

composer react/http (Composer)

Affected versions

>= 0.6.0, <= 1.11.0

Patched versions

1.11.1

Description

Summary

A malformed HTTP message using Transfer-Encoding: chunked can drive React\Http\Io\ChunkedDecoder into an infinite loop, pegging a CPU core and freezing the event loop. Because ReactPHP is single-threaded, one such message stalls the entire process for every client until it is killed.

Both directions are affected. ChunkedDecoder decodes chunked request bodies for React\Http\HttpServer and chunked response bodies for React\Http\Browser, so a server can be attacked by a malicious client and a client can be attacked by a malicious or compromised server.

Details

ChunkedDecoder::handleData() loops while ($this->buffer !== '') and relies on the buffer shrinking each iteration. Two states leave the buffer unchanged while the loop condition stays true.

Terminal-chunk trailer. After the terminating 0 chunk, any remaining buffer is treated as trailer data to skip:

} elseif ($this->chunkSize === 0) {
    $this->buffer = (string)\substr($this->buffer, $positionCrlf);
}

When the trailer holds no CRLF yet, strpos() returns false, PHP coerces that to 0 in substr(), and the buffer is never advanced. Neither the error guard (which requires a non-zero chunk size) nor the wait guard (which requires fewer than two bytes remaining) can fire, so the loop re-enters with identical state.

Off-by-one after a completed chunk. Once a non-terminal chunk has been fully transferred, the "chunk does not end with a CRLF" error guard requires strlen($this->buffer) > 2 while the wait guard requires < 2. Exactly two non-CRLF bytes slip past both, and because the chunk is already complete nothing is consumed on the next iteration.

PoC

Run the example server from the reactphp/reactphp README and send a malformed request. Note the missing trailing \r\n:

POST / HTTP/1.1\r\nHost: x\r\nTransfer-Encoding: chunked\r\n\r\n0\r\nab

The PHP process pegs at 100% CPU and stops answering legitimate requests. A body of 1\r\nAAB triggers the second state.

The client side is reachable the same way: a Browser request to a server that answers with Transfer-Encoding: chunked and either malformed body shape hangs the client process.

Impact

Denial of service. The affected process stops responding entirely and has to be killed.

Servers behind a reverse proxy that parses and re-frames HTTP, such as a typical nginx setup, are not affected on the server side, because the proxy normalises the request before it reaches PHP. That mitigation does not extend to the client side: outbound requests made with Browser reach the remote server directly, so an application fetching attacker-influenced URLs is affected regardless of what sits in front of it.

References

@clue clue published to reactphp/http Sep 9, 2026
Published by the National Vulnerability Database Sep 16, 2026
Published to the GitHub Advisory Database Sep 17, 2026
Reviewed Sep 17, 2026
Last updated Sep 17, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(50th percentile)

Weaknesses

Loop with Unreachable Exit Condition ('Infinite Loop')

The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. Learn more on MITRE.

CVE ID

CVE-2026-84997

GHSA ID

GHSA-x424-64qh-5j54

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.