Summary
A critical flaw in PHP's default session handler can let an attacker plant their own data inside a server-side session and, in the right conditions, run code with the privileges of the PHP worker process. PHP rates it 9.2, critical.
It affects PHP applications that store sessions as files, which is PHP's default. The framework does not matter. WordPress, Drupal, Laravel and custom applications are all in scope if the PHP underneath them is affected.
If you updated PHP in October for PHP2Shell, you are still affected. That release does not contain this fix. Update again to PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0, rebuild any container images, and restart your PHP workers.
What happened
On 19 November 2026, PHP released security updates addressing multiple vulnerabilities across its supported release branches (PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0). One of these vulnerabilities is CVE-2026-126714, nicknamed phpAfterShell, discovered by the security research firm Depthfirst.
PHP's default session handler stores session data in files and updates those files in place when session data changes. This update involves two operations: writing the new session contents and truncating the file to remove any remaining data. These operations are not guaranteed to complete together.
If a PHP worker is interrupted between these operations, the session file can be left in an inconsistent state. It may contain the beginning of the new session data followed by leftover bytes from the previous session.
PHP's session format records the length of each stored value. This makes the leftover data dangerous. Content that was previously harmless inside a stored value can become meaningful session data when new content is written in front of it. When PHP subsequently loads that session, it can interpret the malformed file as valid serialized data and reconstruct attacker-influenced objects.
This creates an arbitrary deserialization primitive that, when combined with a suitable PHP deserialization-to-RCE gadget chain, can lead to remote code execution on the server.
There is an attack path that does not require the application to do anything unusual. PHP's session upload-progress feature updates session data while PHP is still processing an incoming file upload, before the application's own code runs. When this feature is enabled, an unauthenticated request can reach the session-handling functionality directly.
Why October's update does not cover it
The PHP2Shell fixes released on 21 October 2026 restricted which classes PHP could instantiate during the RFC1867 upload-progress callback. This closed the specific object-instantiation route exploited in PHP2Shell.
However, those changes did not address the underlying session-file write mechanism. PHP could still leave partially overwritten session files containing a mixture of new and old serialized data.
As a result, environments running PHP 8.2.35, 8.3.36, 8.4.27 or 8.5.12 remain vulnerable to phpAfterShell.
Disabling session upload progress removes the easiest attack path, but does not fix the underlying vulnerability. Applications that independently store attacker-controlled data in file-based sessions may remain exposed.
Two other session-related vulnerabilities, CVE-2026-115560 and CVE-2026-129481, were also addressed in the 19 November security releases. Organizations should apply the complete security update for their respective PHP branch rather than relying on partial mitigations.
Impacted packages and versions
PHP branch | Affected |
8.5 | below 8.5.13 |
8.4 | below 8.4.28 |
8.3 | below 8.3.37 |
8.2 | below 8.2.36 |
8.1 and older | end of life, No regular upstream fix |
8.6 | 8.6.0 GA includes the fix |
Important: The official PHP 7.4, 8.0 and 8.1 EOL mitigation branches disable upload progress in the callback and are reported as unaffected by phpAfterShell itself. However, these versions remain unsupported and may be exposed to other security vulnerabilities.
Distribution packages may carry security fixes under their own package revision numbers without changing the upstream PHP version string. Check the relevant distribution's security advisory and package changelog before concluding that a package is vulnerable.
Am I affected?
Your environment is potentially affected if both of the following conditions are true:
1. The PHP runtime serving web traffic is below the fixed version for its branch.
Check the actual PHP runtime handling production requests, not just the container tag or package declaration.
Running php -v on a host reports the command-line build, which may differ from the PHP-FPM or web-server runtime answering HTTP requests. Verify the version used by the actual production workers.
2. PHP uses file-based session storage.
This is PHP's default configuration. Check session.save_handler in the effective web runtime configuration.
If it is set to files, your deployment is within the scope of this vulnerability.
What if sessions are stored elsewhere?
Deployments using Redis, databases or other non-file session handlers are not affected by this specific file-write vulnerability.
What if session upload progress is disabled?
Disabling session.upload_progress.enabled removes the easiest attack path, but does not resolve the underlying vulnerability if the application independently stores attacker-controlled data in file-based sessions.
If you do not run PHP yourself, check anyway. PHP arrives inside products you bought: Drupal and WordPress sites, admin consoles on appliances, hosting panels, and vendor base images sitting under your own. You cannot rebuild those. Ask the vendor for a fixed build and a date.
Resolution
Update to the fixed release for your branch, then rebuild and redeploy any container images. Updating packages on the host does not change a running image.
PHP branch | Update to |
8.5 | 8.5.13 |
8.4 | 8.4.28 |
8.3 | 8.3.37 |
8.2 | 8.2.36 |
8.1 and older | migrate to a supported branch |
After updating, restart PHP workers (php-fpm, Apache, or your container's process) and confirm the version actually serving requests.
CleanStart images
CleanStart has published fixed php images for every branch it carries.
Branch | Fixed tag |
8.6 | php:8.6.0 |
8.5 | php:8.5.13 |
8.4 | php:8.4.28 |
8.3 | php:8.3.37 |
There is no CleanStart php 8.2 tag in this set. PHP 8.2 reaches the end of its security support on 31 December 2026, so move those workloads to 8.3 or later rather than planning around a short-lived 8.2 build.
CVE IDs, CWE and references
Identifier | Detail |
CVE-2026-126714 | phpAfterShell. Partially overwritten session files can lead to remote code execution. CVSS v4.0 9.2, critical. |
Weakness class | CWE-502, deserialization of untrusted data. Reached through an incomplete file update rather than through application input. |
Related | CVE-2026-115560 and CVE-2026-129481, two further session flaws fixed in the same 19 November 2026 release. |
Does not cover this | CVE-2026-109618 and CVE-2026-109619, PHP2Shell, fixed 21 October 2026. |
