CVE-2026-127960

Denial of Service
Affects
PHP
in
PHP
No items found.
Versions
>=8.1.32 <8.2.0, >=8.2.28 <8.2.36, >=8.3.18 <8.3.37, >=8.4.5 <8.4.28, >=8.5.0 <8.5.13

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

PHP is a general-purpose scripting language used mostly for web development. It runs behind web servers through server APIs such as Apache mod_php and PHP-FPM, and powers content management systems and frameworks such as WordPress, Drupal, Moodle and Laravel. PHP's HTTP stream wrapper lets functions such as file_get_contents() and fopen() fetch http:// and https:// URLs, and parses the response headers before it returns the body.

A Denial of Service (DoS) vulnerability (CVE-2026-127960) has been identified in how the HTTP stream wrapper joins folded response headers, which allows a malicious HTTP server to make PHP consume excessive CPU time while reading a response that splits a header across a large number of continuation lines. The PHP project tracks this issue as GHSA-mmf9-xm3v-hg2x and states that it was introduced by the fix for CVE-2025-1217.

Per MITRE CWE-407: An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.

This issue affects PHP 8.1 from 8.1.32 through its final release (8.1.34), PHP 8.2 from 8.2.28 before 8.2.36, PHP 8.3 from 8.3.18 before 8.3.37, PHP 8.4 from 8.4.5 before 8.4.28 and PHP 8.5 before 8.5.13. Stock PHP 8.0 and earlier never received the change that introduced the issue, but End-of-Life release lines that carry a backport of the CVE-2025-1217 fix, including NES for PHP, contain the same code and are affected.

Details

Module Info

Vulnerability Info

This High-severity vulnerability is found in the HTTP stream wrapper of PHP 8.1 from 8.1.32 through its final release (8.1.34), PHP 8.2 from 8.2.28 before 8.2.36, PHP 8.3 from 8.3.18 before 8.3.37, PHP 8.4 from 8.4.5 before 8.4.28 and PHP 8.5 before 8.5.13. The PHP project scores it 8.7 under CVSS 4.0 (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). The PHP project classifies it as CWE-400 and CWE-407.

When PHP receives a folded response header, it joins each continuation line to the header value collected so far. In PHP 8.5.12, the code reads:

/* Concatenate last header line, space and current header line. */
zend_string *extended_header_str = zend_string_concat3(
        last_header_line, last_header_line_length,
        " ", 1,
        http_folded_header_line, http_folded_header_line_length);
zend_string_efree(last_header_line_str);
last_header_line_str = extended_header_str;
/* Return new header line. */
return last_header_line_str;

Every continuation line allocates a new string and copies the whole accumulated value into it. A response with many short continuation lines therefore takes time that grows much faster than its size, and PHP does this work before it returns the response body to the application.

The attacker must control an HTTP response that the application fetches through PHP's built-in HTTP or HTTPS stream wrapper, either by triggering a suitable outbound request or by influencing a server the application already contacts. Enabling allow_url_fopen alone does not expose an application. Repeated or concurrent requests can keep PHP workers busy and deny service to other users: testing showed two malicious responses occupying both workers of a two-worker PHP-FPM pool. No confidentiality or integrity impact was observed.

This code was added by the fix for CVE-2025-1217, which shipped in PHP 8.1.32, 8.2.28 and 8.4.5; the advisory gives 8.3.18 as the first affected 8.3 version. Earlier releases in each line, and stock PHP 8.0 and earlier, do not contain it. Builds of PHP 8.0 and earlier that carry a backport of the CVE-2025-1217 fix, including NES for PHP, do contain it and are affected. PHP 8.1 reached End-of-Life without a fix for this issue.

The fix accumulates the header in a growing buffer, so the cost of folding is linear in the total header size:

/* Append space and current header line to the last header line. */
smart_str_appendc(last_header, ' ');
smart_str_appendl(last_header, http_folded_header_line, http_folded_header_line_length);
return true;

Mitigation

The PHP project publishes security fixes only for its supported release lines. PHP 8.1 is End-of-Life and will not receive any public updates to address this issue. Older End-of-Life lines are affected only where a backport of the CVE-2025-1217 fix has been applied, and they will not receive any public updates either.

Until an upgrade is possible, restrict outbound requests to trusted destinations, including redirect targets. An egress proxy that enforces limits on response header size and count can reject malicious responses before PHP processes them. Request execution limits and PHP-FPM's request_terminate_timeout limit how long a worker stays occupied, but they do not remove the parsing behavior.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, or later.
  • Leverage a commercial support partner like HeroDevs (NES for PHP) for post-EOL security support.

Credits

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2026-127960
PROJECT Affected
PHP
Versions Affected
>=8.1.32 <8.2.0, >=8.2.28 <8.2.36, >=8.3.18 <8.3.37, >=8.4.5 <8.4.28, >=8.5.0 <8.5.13
NES Versions Affected
Published date
November 19, 2026
≈ Fix date
November 19, 2026
Fixed in
Category
Denial of Service
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
PHP
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.