CVE-2026-129538: PHP-CGI reads and writes out of bounds while correcting PATH_INFO

ByLinuxtastic

December 1, 2026 #CVE, #PHP

PHP’s CGI binary, php-cgi, serves both classic CGI and the FastCGI protocol, and with cgi.fix_pathinfo enabled, which is the default, it reconciles the SCRIPT_FILENAME, PATH_TRANSLATED and PATH_INFO variables the web server hands it so that /index.php/extra/path resolves to the script and the trailing part. The PHP record says the binary “can perform an out-of-bounds read and write when the path removed from SCRIPT_FILENAME or PATH_TRANSLATED is longer than the supplied PATH_INFO, or when PATH_INFO is empty”. It takes “a web server mapping that passes such inconsistent values, or a FastCGI listener reachable by untrusted clients”, and then “an unauthenticated remote attacker can crash the process, may obtain process memory if the application exposes PATH_INFO or PATH_TRANSLATED, and may corrupt memory”. PHP-FPM and the Apache module are not affected. PHP scores it 6.9 on CVSS 4.0; Red Hat reads it as 8.1 and Moderate, SUSE as 7.3 and important. Upgrade to PHP 8.2.36, 8.3.37, 8.4.28 or 8.5.13 (the 19 November release) and restart the FastCGI processes; where php-cgi cannot be upgraded yet, make sure no untrusted client can reach its FastCGI socket, and consider the move to PHP-FPM that removes this SAPI from the picture.

CVE-2026-129538 at a glance.

ComponentPHP, the CGI/FastCGI SAPI (php-cgi, the record’s module sapi-cgi) with cgi.fix_pathinfo=1; packaged as php8.x-cgi on Debian and Ubuntu, php-cgi (in the php-common stream) on the Red Hat family, php8-cgi / php8-fastcgi on SUSE. PHP-FPM (php-fpm) and mod_php are not affected
Affected versionsevery PHP release before 8.2.36, 8.3.0 to 8.3.36, 8.4.0 to 8.4.27 and 8.5.0 to 8.5.12; the end-of-life 8.1 and 7.x lines carry the code and the distributions that still support them have backported the fix
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 reads “Fixed [GHSA-5j3f-64r7-f564] (PHP-CGI out-of-bounds read and write during PATH_INFO correction)”; 8.6.0 of the same day carries the fix). Distribution backports: Debian 8.2.36-1~deb12u1 and 8.4.28-1~deb13u1, Ubuntu 8.1.2-1ubuntu2.29 / 8.3.6-0ubuntu0.24.04.14 / 8.5.4-0ubuntu1.6 / 8.5.9-0ubuntu2.2, Red Hat php 8.3.37 and php8.4 8.4.28 on RHEL 10 and the php:8.2/8.3/8.4 streams on RHEL 9, SUSE php8 8.3.37-150700.3.27.1
SeverityPHP CVSS 4.0 6.9 Medium (AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L), CWE-125, CWE-787 and CWE-823; NVD Awaiting Analysis with that metric. Red Hat Moderate but 8.1 on CVSS 3.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H, CWE-787); SUSE important, 7.3 (AC:L, low impacts); Ubuntu Medium, 6.9. The three vendor readings differ on whether the memory corruption is exploitable beyond a crash, and the box carries all of them. Alpine’s tracker refused our reader
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.27). EPSS 0.1282 (97th percentile) on 30 November 2026, the highest of any PHP item from the 19 November release on this site; CISA’s SSVC record marks it not automatable
Who is exposedany host that runs PHP through php-cgi rather than PHP-FPM: Apache with mod_fcgid or mod_proxy_fcgi pointed at a php-cgi spawner, lighttpd and nginx set-ups that spawn php-cgi with spawn-fcgi, shared-hosting panels that run suEXEC CGI, and anything that binds a php-cgi FastCGI listener on a TCP port an outsider can reach. The record’s two routes are a web server mapping that produces inconsistent path variables, which depends on the server’s rewrite and alias rules, and a FastCGI listener reachable directly, where the attacker chooses the variables. Hosts on PHP-FPM or mod_php, the common cases today, are not exposed
PublishedCVE record 19 November 2026 (PHP, updated 19 November); this page built 1 December 2026, last updated 1 December 2026

What it is

cgi.fix_pathinfo exists because web servers disagree about what PATH_INFO and PATH_TRANSLATED should hold for a URL like /app.php/route. With it on, php-cgi takes SCRIPT_FILENAME (or PATH_TRANSLATED) and walks back from the end until it finds a path that exists on disk, treats that as the script, and treats what it removed as the real PATH_INFO, correcting the variables the server gave it. The record describes the arithmetic failing when what was removed is longer than the PATH_INFO the server supplied, or when PATH_INFO is empty: the code computes where the trailing part begins in the server’s PATH_INFO from a length that came from elsewhere, and reads and writes at an offset that is past the end or before the start of its buffer, which is the CWE-823 out-of-range pointer offset the record cites alongside the read and the write.

Getting inconsistent values to php-cgi is the attacker’s problem, and the record names the two ways. A web server mapping can do it on its own, for instance an alias or rewrite that sets SCRIPT_FILENAME to a path that differs from what PATH_INFO was derived from, in which case ordinary requests with long trailing paths are enough. Or the FastCGI listener is reachable, because php-cgi was bound to 0.0.0.0:9000 or the socket is on a shared host, in which case the attacker speaks FastCGI directly and sets every variable. The outcome ranges from a crash of that php-cgi process, to a read of its memory if the application echoes PATH_INFO or PATH_TRANSLATED somewhere, to memory corruption, which is where Red Hat’s 8.1 with high impacts and AC:H comes from, against PHP’s own 6.9 with low impacts.

The fix is in the CGI SAPI only. The GitHub advisory GHSA-5j3f-64r7-f564 that the record and the changelog name refused our reader on 1 December, so the source file and the fix commit are not cited here; PHP’s changelog confirms the 19 November release carries it. The EPSS score is worth a sentence: at 0.128 it is in the 97th percentile and far above every other item of the 19 November release, which reflects how many old php-cgi deployments are reachable rather than any report of exploitation, and nothing in the record or on KEV says it is being used. This CVE is one of the 19 November PHP security release items written up on this site; the siblings linked below share the same four fixed versions.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 1 December 2026; the link in the row is the tracker page, which will be newer than this one.

DistributionStatusFixed package
AlpineTracker page refused our reader on 1 December 2026—
DebianFixed in bookworm’s security update (DLA-4916-1, php8.2), trixie’s (DSA-6641-1, php8.4), forky and sid; the plain bookworm (8.2.32-1~deb12u1) and trixie (8.4.27-1~deb13u1) rows vulnerablebookworm php8.2 8.2.36-1~deb12u1; trixie php8.4 8.4.28-1~deb13u1; forky and sid 8.4.28-3
UbuntuMedium, 6.9; fixed on 22.04 (php8.1), 24.04 (php8.3), 26.04 and 26.10 (php8.5) by USN-9185-1 of 23 November; no php8.4 row22.04 8.1.2-1ubuntu2.29; 24.04 8.3.6-0ubuntu0.24.04.14; 26.04 8.5.4-0ubuntu1.6; 26.10 8.5.9-0ubuntu2.2
RHEL, Rocky, Alma, CentOS StreamModerate, 8.1, CWE-787 (bug 2576597); fixed on RHEL 10.3 and the 10.0/10.2 EUS streams (php 8.3.37, php8.4 8.4.28: RHSA-2026:100821, 101251, 102300, 102302, 102934, 20–24 November), on RHEL 9 for the php:8.2, php:8.3 and php:8.4 streams (RHSA-2026:102261, 102226, 102255) and the base php 8.0.30 (RHSA-2026:102297), on RHEL 8 for php:7.4 and php:8.2 (RHSA-2026:100991, 101276) and on RHEL 7 ELS (RHSA-2026:101337); RHEL 6 out of supportRHEL 10 php8.4-8.4.28-1.el10_3, php-8.3.37-1.el10_3; RHEL 9 and 8 per the stream errata above
openSUSE/SLEimportant, 7.3, Pending (bug 1290682); released for SLE 15 SP7 (php8, SUSE-SU-2026:5389-1, 5390-1, 5398-1, 5399-1 of 20 November) and the 15 SP4/SP5 LTSS lines (php8 8.0.30 backport); SLES 16.0, 16.1 and SLES for NVIDIA 16.1 in progressSLE 15 SP7 php8 8.3.37-150700.3.27.1; SLE 15 SP4/SP5 LTSS php8 8.0.30-150400.4.83.1
Fedora, Arch; builds from source, Docker php:*-cli images that ship php-cgiNot consulted; the upstream releases apply8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 or later

How to check

Three questions, in order: which PHP builds are installed and is php-cgi among them, is anything actually running PHP through the CGI SAPI rather than FPM, and can an outsider reach its FastCGI socket or trip the path mapping. Most hosts stop at the second question.

# 1. installed builds, and whether the CGI binary is present (fixed: 8.2.36 / 8.3.37 / 8.4.28 / 8.5.13, or the backport in the table)
php -v 2>/dev/null | head -1
ls -l /usr/bin/php-cgi* /usr/lib/cgi-bin/php* 2>/dev/null
dpkg -l 'php*-cgi' 2>/dev/null | awk '/^ii/{print $2, $3}'; rpm -qa 'php*-cgi' 'php-common' 2>/dev/null

# 2. is php-cgi what serves PHP? (FPM and mod_php are not affected)
pgrep -a 'php-cgi|spawn-fcgi|fcgid'
pgrep -a php-fpm | head -1
apachectl -M 2>/dev/null | grep -E 'fcgid|proxy_fcgi|php[0-9]*_module'
grep -rnE 'php-cgi|fastcgi_pass|FcgidWrapper|fcgi://' /etc/nginx /etc/apache2 /etc/httpd /etc/lighttpd 2>/dev/null | head

# 3. the two preconditions: fix_pathinfo on (default), and a listener an outsider can reach
php-cgi -i 2>/dev/null | grep -E '^cgi\.fix_pathinfo'
ss -tlnp | grep -E 'php-cgi|:9000\b'

A PHP at or above the fixed version for its series is done once the FastCGI processes have been restarted. A host where step 2 shows only php-fpm or mod_php serving PHP is not exposed to this bug, whatever php-cgi binary sits unused in /usr/bin. A host that spawns php-cgi for its web server, with cgi.fix_pathinfo = 1, is on the path; one that also shows a php-cgi listener on a non-loopback address in step 3 is the case where the attacker needs no cooperation from the web server at all.

How to fix it

Upgrade PHP and restart whatever spawns php-cgi; Debian, Ubuntu, Red Hat and SUSE’s SLE 15 SP7 all shipped before 1 December 2026, with SLES 16 still in progress. A long-running FastCGI spawner keeps the old binary until it is restarted.

# Debian (DLA-4916-1 / DSA-6641-1) / Ubuntu (USN-9185-1)
apt update && apt install --only-upgrade 'php8.*' && systemctl restart apache2 lighttpd 2>/dev/null
# RHEL family (the RHSAs in the table)
dnf upgrade 'php*' && systemctl restart httpd
# SUSE
zypper patch && systemctl restart apache2
# then make sure no old php-cgi is still running
pgrep -a 'php-cgi|spawn-fcgi'; php-cgi -v | head -1

If the upgrade must wait, close the two doors the record names: bind any php-cgi FastCGI listener to a Unix socket or to loopback and firewall port 9000, and review the server’s alias and rewrite rules for mappings that hand php-cgi a SCRIPT_FILENAME unrelated to the PATH_INFO. Setting cgi.fix_pathinfo = 0 takes the correction code out of the request path, but it changes how /script.php/extra resolves and can break applications that depend on it, so test before relying on it. What not to do: do not assume PHP-FPM is in use because the package is installed, since many older set-ups still run php-cgi under mod_fcgid or spawn-fcgi; and do not read the 6.9 as the whole story on a shared host where php-cgi runs as separate users, which is where a memory read in one process is worth the most.

# mitigation A: the FastCGI listener only on loopback or a socket, and 9000 closed from outside
#   spawn-fcgi -a 127.0.0.1 -p 9000 … (or -s /run/php-cgi.sock); nginx: fastcgi_pass 127.0.0.1:9000;
nft add rule inet filter input tcp dport 9000 ip saddr != 127.0.0.1 drop 2>/dev/null
ss -tlnp | grep -E ':9000\b'

# mitigation B (test first; changes PATH_INFO handling): skip the correction code entirely
printf 'cgi.fix_pathinfo = 0\n' > /etc/php/8.4/cgi/conf.d/99-cve-2026-129538.ini    # Debian/Ubuntu layout
php-cgi -i | grep -E '^cgi\.fix_pathinfo'

Sources

  • CVE-2026-129538 at CVE.org — the PHP record (19 November 2026): the description with both preconditions and the FPM/mod_php exclusion, the affected ranges, CVSS 4.0 6.9, CWE-125/787/823
  • PHP 8 ChangeLog — the 8.5.13 (and 8.6.0) CGI entry of 19 November 2026 naming this CVE and the GHSA · GHSA-5j3f-64r7-f564, the PHP advisory the record names, which refused our reader on 1 December
  • NVD entry — Awaiting Analysis, PHP’s CVSS 4.0 vector and the three CWEs; no NVD score or CPE yet
  • Distribution trackers: Debian (DLA-4916-1, DSA-6641-1) · Ubuntu (USN-9185-1) · Red Hat (Moderate, 8.1, the RHSAs) · SUSE (important, 7.3, released for SP7)
  • CISA KEV catalogue 2026.11.27, not listed · EPSS score for this CVE, 30 November 2026

Related reading

This advisory page was assembled from the primary sources listed above on 1 December 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.