Skip to content

PHP2Shell and the November 2026 PHP Security Release: What Happened and How It Was Fixed

A primary-source analysis of PHP2Shell (CVE-2026-109618, CVE-2026-109619) and the 19 November 2026 security release: timeline, root causes, fixes, affected setups, version checks, update steps and interim mitigations.

Published:

PHP2Shell is the name given to two critical remote code execution flaws, CVE-2026-109618 and CVE-2026-109619, that PHP fixed on 21 October 2026: half-initialized request memory after an out-of-memory error and stale internal state leaking from one request into the next could let an unauthenticated attacker run code on the server. The regular security release of 19 November 2026 (8.5.13, 8.4.28, 8.3.37 and 8.2.36) then closed a new set of issues, including PHP-FPM request smuggling, a session upload progress flaw and a PHP-CGI memory bug. The complete fix is to move to the latest release of your branch and restart every PHP process; configuration changes only narrow specific attack paths.

This article is for developers, system administrators and engineering leads who run PHP web applications. It is based on primary sources: php.net announcements and the ChangeLog, the GitHub security advisories (GHSA) in the php-src repository, and the CISA catalog. Secondary coverage disagrees on counts and details in places; anything we could not verify is either attributed to its source or left out. This is not security advice for your specific environment, so treat the official PHP and distribution advisories as authoritative.

What happened? The October and November 2026 timeline

This was not a single bug but two security releases four weeks apart. The first was an emergency response; the second was part of PHP's regular four-week release cycle. Dates come from the announcements in the php.net 2026 news archive and from the CISA record.

DateEvent
20 October 2026The PHP security team pre-announced an upcoming critical security release.
21 October 2026PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 shipped, with an "update now" advisory for CVE-2026-109618 and CVE-2026-109619. Minimal source backports were also published for the unsupported 7.4, 8.0 and 8.1 branches.
23 October 2026An informational advisory recommended session.upload_progress.enabled=0 until the next release because of a possible code execution path in session upload progress (CVE-2026-115560).
26 October 2026CISA, the US cybersecurity agency, added both PHP2Shell CVEs to its catalog of known exploited vulnerabilities.
18 November 2026Pre-announcement of another critical security release, noting that the critical issues require non-default configuration or uncommon setups.
19 November 2026Security releases 8.5.13, 8.4.28, 8.3.37 and 8.2.36 shipped. PHP 8.6.0 was released the same day.

"PHP2Shell" is not a name used by the PHP project; it comes from security researchers and vendors. Palo Alto Networks uses it in its Unit 42 threat brief, which also says its telemetry identified over 22.6 million exposed instances potentially vulnerable to the two CVEs. That figure is Palo Alto Networks' own measurement, not a number published by PHP. In the same brief, the company reports that PHP2Shell is being actively exploited against PAN-OS management interfaces exposed to the internet. The CISA Known Exploited Vulnerabilities catalog lists both CVEs from 26 October, which is an official record that they have been exploited in the wild.

Why did PHP2Shell happen? Root causes in plain words

Both flaws sit in the moments when PHP abandons a request and jumps to cleanup. On a fatal condition such as running out of memory, PHP stops what it is doing and jumps straight to request shutdown, using the C longjmp() mechanism. The problem was that this jump could happen at an unexpected moment and leave inconsistent data behind.

CVE-2026-109618, request memory corrupted on out-of-memory. While a request was being processed, some memory was briefly reachable before it had been fully initialized. If any allocation failed at exactly that point, PHP abandoned the request and the shutdown step then read the half-initialized memory as if it were valid. An attacker could trigger the out-of-memory condition on purpose: multipart requests without a usable content length, an unlimited number of headers inside one part, or empty file fields that are not counted against upload limits could exhaust memory_limit while the request still looked within PHP's limits. According to PHP's advisory, the risk was highest for Apache mod_php, where the attack could run during body parsing before any application code executed. For PHP-FPM, source analysis supports the flaw, but the advisory states that no complete FPM exploit was demonstrated.

CVE-2026-109619, stale state carried into the next request. A PHP worker handles many requests in sequence. Some global state, such as error, session and extension state, kept pointing to memory owned by a request that had already finished. After that memory was freed, the next request on the same worker could touch the stale state before normal initialization reset it. That is a use-after-free, and with a carefully prepared heap layout it could lead to code execution. The advisory names two confirmed paths: fatal error backtraces in PHP 8.5 (fatal_error_backtraces) and session upload progress, which is enabled by default. The session path was validated against both mod_php and PHP-FPM.

What did the 19 November release fix?

The PHP 8.5.13 ChangeLog lists 18 CVE identifiers, one of which is an update of the bundled uriparser library. Seven of the php-src security advisories are rated critical. Not every flaw affects every branch: some exist only in features new to 8.5, others only in 8.3 and later, so the 8.2.36 list is shorter. Severity values below are the CVSS 4.0 scores from the GitHub advisories.

CVEWhat it isWho is affectedSeverity
CVE-2026-129289Request smuggling through PHP-FPMFront ends that reuse backend connections, plus an application that opens php://input without reading it fullyCritical, 9.2
CVE-2026-115560Code execution via session serializer mismatchSetups with upload progress enabled where the same session is read with a different serializerCritical, 9.2
CVE-2026-126714Code execution via a partially overwritten session fileThe default files session handlerCritical, 9.2
CVE-2026-129291Use-after-free in the PHP-FPM master, local privilege escalationFPM pools with catch_workers_output enabledHigh, 8.8
CVE-2026-129538Out-of-bounds read and write during PATH_INFO correctionphp-cgi only, with particular web server mappingsMedium, 6.9

PHP-FPM request smuggling (CVE-2026-129289)

A FastCGI connection can carry more than one request. Before accepting the next one, PHP must either read the previous request body completely or close the connection. The php://input stream is lazy, so opening it does not read the body. At shutdown, PHP treated the mere existence of that stream as proof the body had been handled and skipped the step that discards unread bytes. If the front end kept the connection open (fastcgi_keep_conn on in nginx, enablereuse=on in Apache mod_proxy_fcgi), the leftover bytes could be parsed by PHP-FPM as a brand new FastCGI request. Because that forged request controls parameters such as SCRIPT_FILENAME and PHP_ADMIN_VALUE, it could end in executing attacker-supplied PHP code. The advisory says the code had been present since PHP 5.6.0. Standard nginx and Apache configurations that close the FastCGI connection after each request are not affected by the demonstrated attack.

Session upload progress (CVE-2026-115560 and CVE-2026-126714)

The upload progress feature writes progress data into the session while a multipart upload is running. In CVE-2026-115560, when data was written with one serialization format (php_binary or php_serialize) and later read with another (php), part of a session key could be interpreted as serialized object data. If the application had a suitable gadget chain, that became code execution; the advisory mentions demonstrations using Guzzle and Monolog classes. In CVE-2026-126714, the default file-based session handler could leave a file containing the start of new data followed by the tail of old data after an interrupted write. As reported by SecurityWeek, the firm Depthfirst, which found this second issue, calls it "phpAfterShell".

Other PHP-FPM and PHP-CGI flaws

CVE-2026-129291 is a use-after-free in the FPM master process when worker output capture (catch_workers_output) is enabled. It is not triggered directly from the network: the attacker first needs code execution inside an FPM worker, but if the master runs as root this can mean escalation to root. The advisory notes that the official PHP-FPM Docker images enable this setting. CVE-2026-129538 affects only the php-cgi binary; PHP-FPM and the Apache module are not affected. Finally, CVE-2026-129481 is described in its advisory as an incomplete fix for CVE-2026-109619, so the October update alone is not enough.

How were the flaws fixed?

The patches target the mechanism behind each bug rather than its symptoms, which is also why updating covers more ground than any configuration workaround.

  • Out-of-memory (CVE-2026-109618): PHP no longer uses longjmp() when memory runs out. A soft limit now stops execution gracefully at the next safe point in the virtual machine, and a hard limit at a second, higher threshold ends the process immediately. Shutdown no longer sees half-initialized state.
  • Stale state (CVE-2026-109619 and follow-ups): request-owned global state is reset completely before the next request. The November release also covered the session filename and PHP 8.5 backtrace scenarios that the October patch had missed.
  • FPM request smuggling: unread input is drained based on whether the body was actually consumed, regardless of whether a php://input stream exists. If the previous FastCGI record is incomplete, PHP-FPM closes the connection instead of accepting another request.
  • Upload progress: session.upload_progress.enabled is now off by default; we checked in the php-src source that the default moved from "1" in 8.3.36 to "0" in 8.3.37. Runtime changes to session settings are rejected while the feature is on. The file session handler now truncates the file before writing.
  • FPM master and PHP-CGI: event registrations are removed before their descriptors are closed, and lengths are checked before PATH_INFO is recalculated.

One detail matters: the new default does not protect you if your configuration explicitly enables upload progress. An explicit setting overrides the new default.

Who was affected, and how to check your servers

PHP's October advisory considered every PHP installation serving web requests at risk: PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. The November flaws depend more on specific configurations. Three questions settle your position: which PHP version is actually running, which server API (SAPI) runs it, and whether the risky settings are on.

Check the version in the right place. Running php -v only reports the CLI binary; web requests may be served by a different one. For FPM, run the branch-specific binary such as php-fpm8.3 -v (or whichever php-fpm binary your setup uses). The version string itself can mislead: Debian and Ubuntu backport fixes into older packages without changing the upstream version. For example, Ubuntu's page for CVE-2026-129289 shows the fix for Ubuntu 24.04 in package 8.3.6-0ubuntu0.24.04.14, so a patched server still prints 8.3.6. Search the package changelog for the CVE instead: zcat /usr/share/doc/php8.3-common/changelog.Debian.gz | grep CVE-2026-129289 (adjust the branch number to your install). On RPM-based systems, rpm -q --changelog php-fpm | grep CVE-2026 does the same job. If you build PHP from source, compare directly against the upstream versions.

Look for risky settings. Scan the php.ini files and FPM pool files under /etc/php and your nginx or Apache configuration for: session.upload_progress.enabled, session.serialize_handler, catch_workers_output, fastcgi_keep_conn, enablereuse and, if you use php-cgi, cgi.fix_pathinfo. The CLI php.ini and the FPM php.ini are separate files; checking one says nothing about the other.

Unsupported branches. PHP 8.1 and older receive no updates from the PHP project. Minimal source backports for 7.4, 8.0 and 8.1 were published as an exception for the October flaws, but the November release does not cover those branches. Your options there are a distribution or long-term support vendor that ships the fixes, or a move to a supported branch.

How to patch and restart PHP-FPM

An update is complete only when every running PHP process has restarted on the new binary, not when the package is installed. The steps below assume a Debian or Ubuntu server; on other distributions the package manager command changes but the logic does not.

  1. Build an inventory. List which servers, containers and virtual machines run which PHP branch under which SAPI. One host can have several branches installed.
  2. Try staging first. These releases contain bug and security fixes, not new features, but the new upload progress default and the ban on changing session settings at runtime are behaviour changes. If any screen relies on them, find out in staging.
  3. Upgrade the packages. Run sudo apt update and then a command such as sudo apt install --only-upgrade php8.3-fpm php8.3-cli php8.3-common to update every installed PHP package. If you build from source, use your branch's 19 November release (8.5.13, 8.4.28, 8.3.37 or 8.2.36).
  4. Restart the service. sudo systemctl restart php8.3-fpm, or sudo systemctl restart apache2 for mod_php. Most package managers restart the service for you, but do not assume it.
  5. Verify. Confirm in systemctl status php8.3-fpm that the service started after the upgrade, check the package changelog for the CVE identifiers, and run your critical flows (login, payment, file upload).
  6. Rebuild containers. With Docker, rebuild the image from an updated base image and redeploy instead of patching a running container. Tags pinned to a specific patch version (for example 8.3.36) stay on old code.

Interim mitigations if you cannot update yet

PHP's advisories are explicit that updating is the only complete fix. The measures below only block specific attack paths, and all of them come from the advisories. Apply each setting somewhere that takes effect before request input is processed, such as php.ini, php_admin_value in an FPM pool, or server configuration; ini_set() in the application or an FPM .user.ini file comes too late. Then restart every worker.

  • Set session.upload_progress.enabled=0. It blocks the October session path and the published attack path of CVE-2026-115560, but not other paths. If you do not use the feature, keeping it off after the update is reasonable.
  • Turn off backend connection reuse. Leave fastcgi_keep_conn disabled in nginx and enablereuse disabled in Apache. The demonstrated CVE-2026-129289 attack depends on it.
  • On PHP 8.5, set fatal_error_backtraces=0 and zend.exception_ignore_args=1 to block the demonstrated paths of the 8.5-only backtrace flaws.
  • Disable catch_workers_output in affected FPM pools. Running the FPM master without root limits the impact but does not fix the bug.
  • If you use php-cgi, set cgi.fix_pathinfo=0 and check that routing still works.
  • For the October flaws, the advisory recommends a conservative post_max_size and request size and multipart part limits enforced at the front end. Measures such as memory_limit=-1 and pm.max_requests=1 directly affect capacity, so do not ship them without measuring under load. We describe how bottlenecks and capacity are measured on our Backend Scaling page.

Lasting hardening and the patch process: lessons learned

The lesson from these two releases is not specific to PHP: in a critical vulnerability, what usually makes the difference is less the flaw itself than how quickly and safely a team can update. The four habits below turn the next security release into routine maintenance.

Never expose FPM or FastCGI listeners to untrusted networks. PHP's November advisories call this out explicitly. PHP-FPM should listen on a Unix socket or on a local address such as 127.0.0.1, and if it must be reachable over the network, the firewall should allow only the front-end servers. An open FastCGI port lets an attacker send parameters such as SCRIPT_FILENAME directly.

Stay on supported branches. According to the php.net supported versions table, security support for PHP 8.2 ends on 31 December 2026. Flaws found after that date will get no upstream fix, so plan the migration now rather than during the next emergency.

Make patching routine, not an event. This incident needed two rollouts, and the second closed gaps left by the first. The way to handle that calmly is a pipeline that rebuilds the image, tests it and can roll back to the previous version when needed. We describe the parts of such a pipeline on our DevOps and CI/CD page. Naming an owner who follows php.net announcements and your distribution's security list belongs to the same routine.

Watch dependencies and unused features. In the session flaws, code execution relied on object chains built from classes in the application's libraries. Running composer audit regularly and switching off features you do not use (such as upload progress) shrinks the attack surface. Cleaning up repeated warnings and deprecated settings in your error logs matters too; the October advisory explains that diagnostics raised before a request starts could be a link in the exploit chain. We cover placing these checks in the pipeline as a permanent security gate in our Vibe-Code to Production service and in our pre-launch security checklist.

If you want to inventory your PHP estate, put update and rollback steps into a pipeline, or have your FPM configuration reviewed, tell us about your setup through the quick quote form.

Frequently Asked Questions

What is PHP2Shell? PHP2Shell is the name security researchers gave to CVE-2026-109618 and CVE-2026-109619, which PHP fixed on 21 October 2026 in 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Both are critical flaws scored 9.2 under CVSS 4.0 that can allow unauthenticated remote code execution, and both are listed in the CISA catalog of exploited vulnerabilities.

I installed the October update. Do I still need the November one? Yes. The 19 November release fixes different flaws, and at least one of them, CVE-2026-129481, is described in its advisory as an incomplete fix for CVE-2026-109619. The November releases also include the October fixes, so moving straight to the latest release covers both.

php -v still shows an old version. Am I unpatched? Not necessarily. Debian and Ubuntu backport fixes without changing the version number; on Ubuntu 24.04, for example, the patched package still reports 8.3.6. To decide, search the package changelog for the relevant CVE and make sure you are checking the FPM or Apache binary that serves web requests.

I run PHP-FPM behind nginx with default settings. Does CVE-2026-129289 affect me? According to PHP's advisory, standard nginx and Apache configurations that close the connection after each request are not affected by the demonstrated attack; the risk arises when connection reuse is on, such as fastcgi_keep_conn on or enablereuse=on. You should still update, because the same release fixes other critical flaws.

Will turning off session.upload_progress break my application? Only screens that read upload progress from the progress key in the PHP session are affected. Upload interfaces that measure progress in the browser do not depend on this setting. In current releases the feature is off by default anyway; if you enable it explicitly, make sure every application reading and writing those sessions uses the same serializer.

I am on PHP 8.1 or older. What should I do? These branches get no updates from the PHP project. Minimal source backports for 7.4, 8.0 and 8.1 were published as an exception for the October flaws, but the November release does not cover them. Check whether your distribution or long-term support vendor ships fixes, and plan a move to a supported branch.

I use the official Docker images. What should I watch for? According to the CVE-2026-129291 advisory, the official PHP-FPM Docker images enable catch_workers_output. Rebuild your images from an updated base image and redeploy, update old tags pinned to a specific patch version, and temporarily disable that setting in pools you cannot update yet.

Have a project in mind?

Let's bring the technologies from this article to life in your project.

Request a Free Discovery Call