GHSA-mmf9-xm3v-hg2x / CVE-2026-127960: Denial of service through folded HTTP response headers
- Published:
- Fetched:
- Updated:
- Affects:
- php ext-standard
https://github.com/php/php-src/security/advisories/GHSA-mmf9-xm3v-hg2x ↗
Denial of service through folded HTTP response headers ### Summary A malicious HTTP server can cause PHP's built-in HTTP stream wrapper to consume excessive CPU while reading a response. Applications using `file_get_contents()`, `fopen()` or other stream functions to fetch an HTTP or HTTPS URL may become slow or unavailable if the response contains a header split across a large number of continuation lines. ### Details When PHP receives a folded response header, it joins each continuation line to the accumulated header value. The vulnerable implementation allocates a new string and copies the entire value for every line. A response containing many short continuation lines therefore takes disproportionately more time to process as its size grows. PHP performs this work before returning the response body to the application. This behaviour was introduced by the fix for GHSA-v8xr-gpvj-cx9g (CVE-2025-1217). The new fix accumulates the header in a growing buffer, avoiding a full copy for every continuation line while preserving the existing handling of folded headers. ### Impact An attacker must control an HTTP response fetched by the application through PHP's built-in HTTP or HTTPS stream wrapper. Enabling `allow_url_fopen` alone does not make an application vulnerable to a remote attack. the attacker must also be able to trigger a suitable outbound request or influence a server that the application already contacts. Repeated or concurrent requests can keep PHP workers busy and deny service to other users. Testing confirmed that two malicious responses could occupy both workers in a two-worker PHP-FPM pool and temporarily prevent an unrelated request from completing. The demonstrated impact is denial of service through excessive CPU consumption. No confidentiality or integrity impact was observed. ### Affected versions The affected code was introduced by the fix for GHSA-v8xr-gpvj-cx9g, first released in PHP 8.1.32, 8.2.28, 8.3.19 and 8.4.5. Earlier versions are not affected. ### Mitigation Upgrade to the fixed release for your PHP branch when it becomes available. Until then, restrict outbound requests to trusted destinations, including redirect targets. An egress proxy that enforces response-header size and count limits can reject malicious responses before PHP processes them. Request execution limits and PHP-FPM's `request_terminate_timeout` can limit how long workers remain occupied, but do not remove the vulnerable parsing behaviour. Affected packages: php:ext-standard Patched: ext-standard None, ext-standard 8.2.36, ext-standard 8.3.37, ext-standard 8.4.28, ext-standard 8.5.13