CVE-2026-127960: PHP HTTP stream wrapper burns CPU on folded response headers

ByLinuxtastic

November 30, 2026 #CVE, #PHP

PHP’s HTTP stream wrapper is what runs underneath file_get_contents('https://…'), fopen() on a URL and the other stream functions, and in PHP 8.2.28 to 8.2.35, 8.3.18 to 8.3.36, 8.4.5 to 8.4.27 and 8.5.0 to 8.5.12 (and the end-of-life 8.1.32 to 8.1.34) it parses a folded response header by allocating a new string and copying the whole accumulated value for every continuation line. A server that answers with one header split across thousands of short continuation lines therefore costs the PHP worker a disproportionate amount of CPU, and an attacker who can make the application fetch a URL of their choosing, or who controls a server it already talks to, can keep its workers busy until nothing else is served. Upgrade to PHP 8.2.36, 8.3.37, 8.4.28 or 8.5.13, or the distribution package carrying the fix, and restart PHP-FPM; until then, restrict the destinations the application may fetch, including redirect targets. The flaw arrived with the fix for CVE-2025-1217 and is one of the 19 November 2026 PHP security set.

CVE-2026-127960 at a glance.

ComponentPHP, the HTTP/HTTPS stream wrapper in ext/standard that serves file_get_contents(), fopen(), copy() and friends on URLs. Packaged as php8.x / php-common on every distribution; cURL-based code is a different path
Affected versionsPHP 8.2.28 to 8.2.35, 8.3.18 to 8.3.36, 8.4.5 to 8.4.27 and 8.5.0 to 8.5.12; the CVE record and NVD add the end-of-life 8.1.32 to 8.1.34, which the GitHub advisory omits. Earlier releases lack the code that introduced the bug
Fixed inPHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13, released 19 November 2026 (the 8.5.13 changelog entry names the CVE; the advisory says the fix accumulates the header in a growing buffer). No fix for 8.1, which is end of life upstream
SeverityPHP Group (CNA) CVSS 4.0 8.7 High (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H); NVD Awaiting Analysis with the same vector. Red Hat Important but scores it 5.9 (AV:N/AC:H, CWE-770); SUSE important, 7.5. CWE-400 and CWE-407 per the CNA
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 30 November 2026 (catalogue 2026.11.27). EPSS 0.0043 (38th percentile) on 22 November 2026. CISA’s SSVC on the record: exploitation none, automatable yes, technical impact partial
Who is exposedPHP applications that fetch HTTP or HTTPS responses through the stream wrapper from a server an attacker controls or can redirect them to: URL-fetching features, webhooks, feed readers, link previews, “import from URL”. The advisory is explicit that allow_url_fopen alone is not enough; the attacker must get a chosen response in front of the wrapper. Code that uses cURL is not on this path. Availability only: the advisory’s test filled a two-worker FPM pool with two responses
PublishedCVE record 19 November 2026 (PHP CNA); GitHub advisory GHSA-mmf9-xm3v-hg2x the same day; credits benzdeus and Stephan Lipp (Ada Logics / Anthropic) as reporters, Jakub Zelenka and Arnaud Le Blanc; this page built 30 November 2026, last updated 30 November 2026

What it is

HTTP/1.1 once allowed a header value to continue onto the next line if that line began with a space or tab, and PHP’s wrapper still honours the form. The fix for CVE-2025-1217, in the March 2025 releases, changed how those continuation lines are joined to the value, and it did so by allocating a fresh string and copying the whole accumulated value each time a continuation line arrived. A header of n short continuation lines therefore costs on the order of n² byte copies: the record calls it “disproportionate CPU time to parse”, and files it as both uncontrolled resource consumption (CWE-400) and inefficient algorithmic complexity (CWE-407). The fix in the November releases accumulates into a growing buffer instead, so the work is linear again.

The attacker’s job is to get a crafted response in front of the wrapper, and the advisory is careful about what that takes. A PHP application that fetches a URL supplied by a user, or that follows redirects from a site it trusts to one it does not, or that polls a third-party server the attacker has compromised, is in reach; a server that merely has allow_url_fopen on but never fetches anything is not. The demonstrated impact is availability: two malicious responses occupied both workers of a two-worker PHP-FPM pool in the advisory’s test, and a pool whose workers are all parsing headers serves nobody. Nothing is read or written out of place.

It is one of the 19 November 2026 PHP security releases, which also fixed the session-serializer and PHP-FPM bugs we have written up separately, so the upgrade is one you want for more than this. Red Hat rates the set Important while scoring this item 5.9 on the grounds that the attack complexity is high, a reasonable reading of “you must control the response”; the CNA’s 8.7 treats the fetch of an attacker-chosen URL as a common application feature, which it is.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 30 November 2026; the link in the row is the tracker page, which will be newer than this one. The distributions shipped the whole 19 November set in one package update.

DistributionStatusFixed package
AlpineTracker unreachable on 30 November 2026not read; look for php83 / php84 at 8.3.37 / 8.4.28
DebianFixed in bookworm (DLA-4916-1), trixie (DSA-6641-1), forky and sidbookworm php8.2 8.2.36-1~deb12u1; trixie php8.4 8.4.28-1~deb13u1; sid 8.4.28-3
UbuntuFixed by USN-9185-1 of 23 November 2026 (the CVE page itself refused automated readers on 30 November)26.10 php8.5 8.5.9-0ubuntu2.2; 26.04 php8.5 8.5.4-0ubuntu1.6; 24.04 php8.3 8.3.6-0ubuntu0.24.04.14; 22.04 php8.1 8.1.2-1ubuntu2.29; 20.04 and older through Ubuntu Pro
RHEL, Rocky, Alma, CentOS StreamImportant (score 5.9); errata of 20–25 November 2026 for RHEL 8, 9 and 10 and their EUS/E4S streams; RHEL 7 not affected, RHEL 6 out of supportRHEL 10 php8.4-8.4.28-1.el10_3 (RHSA-2026:100821) and php-8.3.37-1.el10_3 (RHSA-2026:102300); RHEL 9 php:8.3 / php:8.4 / php:8.2 streams and php-8.0.30-8.el9_9.2 (RHSA-2026:102226/102255/102261/102297); RHEL 8 php:8.2 and php:7.4 streams (RHSA-2026:101276/100991)
openSUSE/SLEimportant, 7.5 / 8.7; SUSE-SU-2026:5389-1, 5390-1, 5398-1, 5399-1 of 20 November 2026SLES 15 SP6 LTSS php8 8.2.36-150600.3.46.1; SLES for NVIDIA 16.1 php8 8.5.13-160100.1.1; Liberty 8/9/10 the RHEL builds above
Fedora, Arch; php.net source builds and Docker imagesNot consulted; upstream fixed versions applyPHP 8.2.36 / 8.3.37 / 8.4.28 / 8.5.13

How to check

Three questions: which PHP is running, does the application fetch URLs through the stream wrapper at all, and can an attacker influence where those fetches go. The second is a code question, and the grep below only points you at the places to read.

# 1. the running interpreter(s); FPM and CLI can differ
php -v | head -1
for p in $(pgrep -f 'php-fpm: master'); do readlink /proc/$p/exe; done | sort -u
dpkg -l 'php8*' 2>/dev/null | awk '/^ii/{print $2, $3}'; rpm -qa 'php*' 2>/dev/null | sort

# 2. is the wrapper in use for remote fetches? (cURL calls are not this bug)
php -r 'echo "allow_url_fopen=", ini_get("allow_url_fopen"), PHP_EOL;'
grep -rnE '\b(file_get_contents|fopen|copy|file|readfile|simplexml_load_file)\s*\(' --include='*.php' /var/www 2>/dev/null | grep -iE "https?://|\\\$" | head -30

# 3. do those fetches take a URL from a user, or follow redirects from one?
grep -rnE 'follow_location|max_redirects|stream_context_create' --include='*.php' /var/www 2>/dev/null | head

An interpreter at 8.2.36, 8.3.37, 8.4.28, 8.5.13 or a distribution build at or above the table’s version is fixed, provided FPM was restarted after the upgrade. No stream-wrapper fetches in the code means the vulnerable path is not reachable, whatever allow_url_fopen says. Fetches whose URL, or whose redirect chain, an outsider can steer are the exposed case; a nightly poll of your own API is the low-risk case, until that API’s host is someone else’s.

How to fix it

Upgrade the package and restart PHP-FPM; running workers keep the old code until the master is restarted, and reload is enough on FPM because it respawns the workers from the new binary.

# Debian / Ubuntu
apt update && apt install --only-upgrade 'php8.*' && systemctl restart 'php8*-fpm'
# RHEL family (module streams keep their stream)
dnf upgrade 'php*' && systemctl restart php-fpm
# SUSE
zypper patch && systemctl restart php-fpm
# containers: rebuild on php:8.4.28 / 8.3.37 / 8.2.36 / 8.5.13 and redeploy
php -v | head -1

If you cannot upgrade yet, the advisory’s mitigations are about where the application may send requests: restrict outbound fetches to trusted destinations, including the targets of redirects, and put an egress proxy in front that enforces limits on response header size and count. request_terminate_timeout in the FPM pool and max_execution_time cap how long one worker stays busy, which limits the damage without removing the parsing behaviour, and the advisory says so. Do not switch allow_url_fopen off and call it done: that breaks every legitimate URL fetch and, if the code falls back to cURL, changes nothing about the attacker’s reach.

# damage limiting on the FPM pool while the upgrade is scheduled
grep -nE '^\s*(request_terminate_timeout|pm\.max_children)' /etc/php/*/fpm/pool.d/*.conf /etc/php-fpm.d/*.conf 2>/dev/null
# a fetch that must not follow redirects into the unknown
#   $ctx = stream_context_create(['http' => ['follow_location' => 0, 'timeout' => 5]]);
#   $body = file_get_contents($url, false, $ctx);

Sources

  • CVE-2026-127960 at CVE.org — the PHP Group CNA record (19 November 2026): the description, the five affected ranges including 8.1, CVSS 4.0 8.7, CWE-400 and CWE-407, the credits
  • GHSA-mmf9-xm3v-hg2x — the PHP advisory: the quadratic copy, the link to the CVE-2025-1217 fix that introduced it, the two-worker test, the mitigations
  • PHP 8 ChangeLog — the 8.5.13 entry of 19 November 2026 naming the CVE (the 8.4.28, 8.3.37 and 8.2.36 entries were beyond what we could read of the page)
  • NVD entry — Awaiting Analysis; the CNA vector, the per-branch ranges, SSVC exploitation none / automatable yes
  • Distribution trackers: Debian (DLA-4916-1, DSA-6641-1) · Ubuntu USN-9185-1 · Red Hat (Important, 5.9, RHSA-2026:100821 and siblings) · SUSE (important) · Alpine (unreachable on 30 November)
  • EPSS score for this CVE, 22 November 2026

Related reading

This advisory page was assembled from the primary sources listed above on 30 November 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.