Summary
PHP's HTTP stream wrapper handles folded response headers inefficiently, which can consume excessive CPU and lead to denial of service. The vendor released fixes in versions 8.2.36, 8.3.37, 8.4.28 and 8.5.13.
What happened
PHP's HTTP stream wrapper joins each continuation line of a folded response header to the accumulated value by allocating a new string and copying the whole value, so a response with many short continuation lines takes disproportionate CPU time to parse. An attacker who controls an HTTP or HTTPS response fetched through file_get_contents(), fopen() or other stream functions (by making the application request a chosen URL or by influencing a server it already contacts) can keep PHP workers busy. Repeated or concurrent requests can cause a denial of service. The vulnerability is associated with CWE-400 and CWE-407. The CVE record references advisory GHSA-mmf9-xm3v-hg2x.
Why it matters
The flaw can degrade or interrupt the availability of PHP applications that fetch HTTP/HTTPS content through stream functions. The PHP CNA assigns it a CVSS 4.0 score of 8.7 (high severity), with vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N, indicating impact on availability and none on confidentiality or integrity. The source does not state active exploitation.
Affected products and versions
PHP (PHP Group): from 8.1.32 through 8.1.34; from 8.2.28 before 8.2.36; from 8.3.18 before 8.3.37; from 8.4.5 before 8.4.28; and 8.5.x before 8.5.13 (from 8.5.0).
| Product | Versions | Fixed in |
|---|---|---|
| PHP Group PHP | 8.5.x before 8.5.13 | 8.5.13 |
| PHP Group PHP | 8.4.x before 8.4.28 | 8.4.28 |
| PHP Group PHP | 8.3.x before 8.3.37 | 8.3.37 |
| PHP Group PHP | 8.2.x before 8.2.36 | 8.2.36 |
| PHP Group PHP | >= 8.1.32, <= 8.1.34 | — |
| PHP Group PHP | >= 8.2.28, < 8.2.36 | — |
| PHP Group PHP | >= 8.3.18, < 8.3.37 | — |
| PHP Group PHP | >= 8.4.5, < 8.4.28 | — |
| PHP Group PHP | >= 8.5.0, < 8.5.13 | — |
Action recommended by the source
The vendor lists fixed versions 8.2.36, 8.3.37, 8.4.28 and 8.5.13, with release notes in the php.net ChangeLog. For the 8.1 branch (8.1.32 through 8.1.34), the source does not state a fixed version or a mitigation.
Fixed in: 8.2.36, 8.3.37, 8.4.28, 8.5.13
Sources and references
- https://www.php.net/ChangeLog-8.php#8.5.13 — PHP
- https://www.php.net/ChangeLog-8.php#8.4.28 — PHP
- https://www.php.net/ChangeLog-8.php#8.3.37 — PHP
- https://www.php.net/ChangeLog-8.php#8.2.36 — PHP
- https://github.com/php/php-src/security/advisories/GHSA-mmf9-xm3v-hg2x — CVE Program
Weaknesses (CWE): CWE-400, CWE-407
Relevant change history
Published
Advisory published.