CVE-2026-127960: PHP HTTP stream wrapper DoS via folded headers
PHP versions 8.2.28-8.2.35, 8.3.18-8.3.36, 8.4.5-8.4.27, and 8.5.0-8.5.12 are vulnerable to a denial of service when parsing HTTP responses with many short folded continuation headers. An attacker who can influence an HTTP/HTTPS response fetched via file_get_contents(), fopen(), or other stream functions can cause high CPU consumption and worker exhaustion. Fixed in 8.2.36, 8.3.37, 8.4.28, and 8.5.13.
Grounding
The NVD entry and PHP security advisory describe a CPU-inefficient header parsing path in PHP's HTTP stream wrapper. When a response header is folded, each continuation line is appended to the accumulated value by allocating a new string and copying the whole value. A response with many short continuation lines therefore forces O(n²) copying, consuming disproportionate CPU time per request.
An attacker who can make an affected PHP application request a chosen URL, or who can influence a server the application already contacts, can deliver such an HTTP/HTTPS response. Repeated or concurrent requests can tie up PHP workers and result in denial of service.
Affected versions: - PHP 8.2.28 through 8.2.35 - PHP 8.3.18 through 8.3.36 - PHP 8.4.5 through 8.4.27 - PHP 8.5.0 through 8.5.12
Fixed versions: - PHP 8.2.36 - PHP 8.3.37 - PHP 8.4.28 - PHP 8.5.13
What to do
1. Identify PHP versions in use across web/DevOps stacks (e.g., php -v in containers, CI runners, and runtime images). 2. Upgrade affected PHP installations to the first patched release for their branch: 8.2.36, 8.3.37, 8.4.28, or 8.5.13. If an exact production version cannot be changed immediately, verify the official PHP advisory before applying a workaround. 3. Rebuild or repull any PHP-based container images or platform-managed runtimes that pin an affected version. 4. Where feasible, review outbound HTTP/fetch destinations in application code for attacker-influenced URLs; restrict or validate them to reduce the ability to trigger crafted responses. 5. Monitor CPU usage and PHP-FPM/worker saturation for unexpected spikes after confirming exposure. 6. Re-scan or re-test after patching to confirm the vulnerable header parsing path is no longer present.