{"vuln_id":"GHSA-v8xr-gpvj-cx9g","aliases":["CVE-2025-1217"],"description":"Header parser of `http` stream wrapper does not handle folded headers","published_at":"2025-03-13T17:43:52Z","modified_at":"2025-03-13T17:43:53Z","first_seen_at":"2026-11-21T19:15:07.667116Z","severity":"medium","severity_source":"ghsa","cvss_score":null,"cvss_vector":null,"cwe":[],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-v8xr-gpvj-cx9g"},"matched_alias":null,"items":[{"id":629,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-mmf9-xm3v-hg2x / CVE-2026-127960: Denial of service through folded HTTP response headers","summary":"Denial of service through folded HTTP response headers\n\n### Summary\r\n\r\nA 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.\r\n\r\n### Details\r\n\r\nWhen 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.\r\n\r\nThis 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.\r\n\r\n### Impact\r\n\r\nAn 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.\r\n\r\nRepeated 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.\r\n\r\n### Affected versions\r\n\r\nThe 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.\r\n\r\n### Mitigation\r\n\r\nUpgrade 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.\r\n\n\nAffected packages: php:ext-standard\nPatched: ext-standard None, ext-standard 8.2.36, ext-standard 8.3.37, ext-standard 8.4.28, ext-standard 8.5.13","url":"https://github.com/php/php-src/security/advisories/GHSA-mmf9-xm3v-hg2x","published_at":"2026-11-19T14:06:08Z","updated_at":"2026-11-19T18:51:52Z","fetched_at":"2026-11-21T19:15:07.553367Z","severity":"high","cvss_score":8.7,"epss":0.00585,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"ext-standard","vuln_id":"CVE-2026-127960","vuln_ids":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","CVE-2026-115560","CVE-2026-126714","CVE-2026-127960","CVE-2026-128064","CVE-2026-128090","CVE-2026-129289","CVE-2026-129291","CVE-2026-129292","CVE-2026-129481","CVE-2026-129496","CVE-2026-129501","CVE-2026-129506","CVE-2026-129538","CVE-2026-15353","GHSA-MMF9-XM3V-HG2X","GHSA-V8XR-GPVJ-CX9G"],"tags":["repo-advisory","php","CWE-400","CWE-407","security","repo:php/php-src"],"cluster_id":455,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/629","html":"https://vulnwatch.ve1ve2.com/item/629"}},{"id":12660,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-v8xr-gpvj-cx9g / CVE-2025-1217: Header parser of `http` stream wrapper does not handle folded headers","summary":"Header parser of `http` stream wrapper does not handle folded headers ### Summary The header parser of the `http` stream wrapper does not handle folded headers and passes incorrect MIME types to an attached stream notifier. ### Details The header parser of the `http` stream parser does not understand that a header line beginning with whitespace continues the previous header and instead considers every newline to be a header separator. This has two consequences: 1. The `STREAM_NOTIFY_MIME_TYPE_IS` notification might report an incorrect MIME type, if the `content-type` header is a folded header. 2. The `$http_response_header` array contains the header continuation lines as they appear on-the-wire, requiring userland code to be aware of folded headers and violating [RFC9112#5.2](https://datatracker.ietf.org/doc/html/rfc9112#section-5.2), which specifies: > A user agent that receives an [obs-fold](https://datatracker.ietf.org/doc/html/rfc9112#line.folding) in a response message that is not within a \"message/http\" container MUST replace each received [obs-fold](https://datatracker.ietf.org/doc/html/rfc9112#line.folding) with one or more [SP](https://datatracker.ietf.org/doc/html/rfc9112#core.rules) octets prior to interpreting the field value. ### PoC ```php \"stream_notification_callback\")); var_dump(file_get_contents(\"http://127.0.0.1:8080\", false, $ctx)); var_dump($http_response_header); ``` Running against: ``` printf \"HTTP/1.0 200 Ok\\r\\nContent-Type: text/html;\\r\\n charset=utf-8\\r\\n\\r\\nbody\\r\\n\" |nc -l 0.0.0.0 8080 ``` results in: ``` Found the mime-type: text/html; string(6) \"body \" array(3) { [0]=> string(15) \"HTTP/1.0 200 Ok\" [1]=> string(24) \"Content-Type: text/html;\" [2]=> string(17) \" charset=utf-8\" } ``` being printed (after killing `nc` with Ctrl+C), thus missing the `charset` within the mime type. ### Impact Users of the `http` stream wrapper might interpret the response with an incorrect MIME type and more generally might misparse the response, for example by incorrectly determining which response headers belong to the final response if a redirect happened. Patched: 8.1.32, 8.2.28, 8.3.19, 8.4.5","url":"https://github.com/php/php-src/security/advisories/GHSA-v8xr-gpvj-cx9g","published_at":"2025-03-13T17:43:52Z","updated_at":"2025-03-13T17:43:53Z","fetched_at":"2026-11-22T14:05:37.431193Z","severity":"medium","cvss_score":3.1,"epss":0.00585,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php-src","vuln_id":"CVE-2025-1217","vuln_ids":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","GHSA-V8XR-GPVJ-CX9G"],"tags":["repo-advisory","security","repo:php/php-src","stack"],"cluster_id":456,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12660","html":"https://vulnwatch.ve1ve2.com/item/12660"}}]}