Summary
The PHP project has released fixes for a new set of critical vulnerabilities, led by CVE-2026-126714, known as phpAfterShell, a flaw in PHP’s default file-based session handler that can lead to remote code execution. The same release fixes CVE-2026-129289, a PHP-FPM request smuggling flaw that can give an unauthenticated attacker code execution. Both are rated CVSS 9.2.
Fixed releases were published on 19 November 2026: 8.5.13, 8.4.28, 8.3.37 and 8.2.36. PHP 8.6.0, released the same day, also contains the fixes. PHP 8.1 and older are end of life and receive no official release.
Servers patched for PHP2Shell are still affected. The October releases (8.5.12, 8.4.27, 8.3.36 and 8.2.35) do not contain these fixes. Every PHP host needs to be updated again.
Impact
Exploitability signals: CVSS 9.2 (v4.0) for both vulnerabilities · unauthenticated · PHP-FPM attack demonstrated by the reporters · no exploitation in the wild reported as of 25 November 2026 · no public exploit code known.
CVE-2026-126714 (phpAfterShell) affects the default files session handler. When PHP updates a session file, it writes the new data over the old without clearing the file first. If the write is interrupted, for example when a worker hits its memory or time limit, the file is left holding part of the new session and part of the old one. The next request that reads the session deserializes this mixed data. An attacker who can influence session contents, which the upload progress feature allows without logging in, can use this to create objects of their choice. Turning that into code execution depends on a suitable gadget chain in the application, which many large PHP applications provide.
CVE-2026-129289 affects PHP-FPM behind a front end that reuses FastCGI connections. PHP does not always discard the unread part of a request body before the connection is reused. An attacker can hide a second FastCGI request inside the body, and PHP-FPM runs it as a new request with attacker-chosen settings. The reporters demonstrated code execution with no special PHP configuration. Standard nginx and Apache setups that close the FastCGI connection after each request are not affected.
Successful exploitation gives an attacker code execution on the web server under the account that runs PHP. Member services at risk include learning management systems, journal platforms, institutional websites, webmail, federation identity providers, and network monitoring tools. A compromised PHP host typically exposes application databases, stored credentials, and a foothold into the wider campus network.
The release also fixes five further critical vulnerabilities and several high and medium ones, mostly memory safety flaws in sessions, error handling and PHP-FPM. Updating covers all of them.
Affected systems
All PHP installations on versions earlier than the fixed releases below:
- PHP 8.5 fixed in 8.5.13
- PHP 8.4 fixed in 8.4.28
- PHP 8.3 fixed in 8.3.37
- PHP 8.2 fixed in 8.2.36 (PHP 8.2 itself reaches end of life on 31 December 2026)
- PHP 8.1 and older have no official release. Upgrade to a supported branch, or use a distribution or LTS vendor backport if one is available.
CVE-2026-126714 only affects sites that store sessions in files, which is PHP’s default. Sites that keep sessions in Redis, Memcached or a database are not affected by this specific flaw, but still need the update for the rest of the release.
CVE-2026-129289 only affects PHP-FPM (and LiteSpeed LSAPI) behind a front end that keeps backend connections open between requests: nginx with fastcgi_keep_conn on, Apache mod_proxy_fcgi with enablereuse=on, or HAProxy with connection reuse.
Temporary mitigations
These are partial measures for hosts that cannot be updated straight away. Set them in php.ini, the FPM pool or the web server configuration, not with ini_set() or .user.ini, and restart every PHP worker afterwards.
- Set
session.upload_progress.enabled=0. This removes the easiest path to CVE-2026-126714, but not the flaw itself. Applications that store large amounts of user-supplied data in sessions remain exposed. - If the application can use it, move sessions to Redis, Memcached or a database. This avoids CVE-2026-126714.
- On nginx, make sure
fastcgi_keep_connis off (the default). On Apache, make sureenablereuseis off forproxy_fcgibackends. On HAProxy or other FastCGI front ends, close the backend connection after every request. This blocks CVE-2026-129289. - Never expose PHP-FPM or LSAPI listeners to untrusted networks. Bind them to a Unix socket or to localhost.
- On PHP 8.5, set
zend.exception_ignore_args=1, which blocks one of the other critical flaws in this release (CVE-2026-129474).
Action
-
Update PHP now to 8.5.13, 8.4.28, 8.3.37 or 8.2.36, or install your distribution’s patched package. Restart every PHP process afterwards (PHP-FPM pools, Apache, LiteSpeed, FrankenPHP), because running workers keep the vulnerable code in memory until they restart.
-
Re-check hosts you patched for PHP2Shell. Being on 8.5.12, 8.4.27, 8.3.36 or 8.2.35 is no longer enough. Use the list of PHP hosts you built for advisory GARNET-CSIRT-2026-010, and add any you have found since. Common examples include Moodle, Open Journal Systems (OJS), WordPress, Joomla, Drupal, SimpleSAMLphp, Roundcube, Nextcloud, phpMyAdmin, LimeSurvey, GLPI, osTicket, and monitoring frontends such as Zabbix, LibreNMS, Cacti and phpIPAM.
-
Check your FastCGI connection reuse settings on nginx, Apache and any load balancer in front of PHP-FPM, and turn reuse off until the host is updated.
-
Deal with end of life versions. Hosts on PHP 8.1 or older should be upgraded to a supported branch. Any host that cannot be fixed quickly should be taken offline or restricted to trusted networks until it is.
-
Apply the temporary mitigations above only where you cannot update immediately. They reduce exposure but do not fully fix the vulnerabilities.
-
Restrict access while you patch. Limit administrative and internal-only PHP applications to the campus network or VPN.
-
Watch for advisories from PHP application projects such as Moodle, WordPress, Joomla, Drupal and SimpleSAMLphp, and from hosting providers for externally hosted sites.
-
Report suspected compromise. Signs include web server or PHP-FPM processes spawning shells, PHP workers crashing repeatedly, malformed or unusually large session files in the session directory, and unexpected files appearing in web or temporary directories. Report these to GARNET CSIRT so we can correlate activity across the constituency.
References
- PHP · PHP 8.5.13 Released (security release)php.net
- PHP · GHSA-fm2m-fjf5-v3cp (CVE-2026-126714)github.com
- PHP · GHSA-qc49-hpvq-g2w6 (CVE-2026-129289)github.com
- PHP · ChangeLog for PHP 8php.net
- depthfirst · phpAfterShelldepthfirst.com
- GARNET CSIRT · PHP2Shell advisory (GARNET-CSIRT-2026-010)csirt.garnet.edu.gh
Think a system at your institution is affected or already compromised? Report an incident
TLP:CLEAR