On November 19, 2026, PHP released updates fixing CVE-2026-126714, a critical flaw in file-based sessions. The vulnerability can allow remote code execution in the PHP process if an attacker manages to influence session data and interrupt a write; it affects the file handler, which is the default, not sessions stored in Redis or a database for this specific flaw.
The flaw affects PHP, not a specific framework: applications built with different frameworks may be exposed if they use a vulnerable version and store sessions in files. It is not enough to check the version declared in a repository: you need to confirm which version is deployed in production and serving requests.
Check the version and storage
The vulnerability is known as phpAfterShell and has CVE-2026-126714. PHP and Depthfirst describe the flaw in the file-based session handler. An interrupted write can leave parts of two serialized sessions in the same file; a subsequent read may interpret bytes that were previously string content as objects.
The easiest way described to influence this data is the file upload progress feature, but the scope is not limited to it: it can also arise if an application stores large user-controlled strings in a session. Exploitation depends on server and application conditions; achieving code execution requires, among other things, a suitable gadget chain in the application.
| Installed branch | Patched version |
|---|---|
| PHP 8.5 | 8.5.13 |
| PHP 8.4 | 8.4.28 |
| PHP 8.3 | 8.3.37 |
| PHP 8.2 | 8.2.36 |
| PHP 8.6 | 8.6.0, with the fix included |
Versions earlier than these patches are affected if they use the file handler. PHP 8.1 and earlier are no longer supported; the official mitigation branches for end-of-life versions, which disable writing during upload progress, are not affected by this flaw, according to PHP and Depthfirst. The October fix—for example, PHP 8.5.12, 8.4.27, 8.3.36, or 8.2.35—is not enough.
Steps to reduce exposure
Identify the version in production. Check the PHP version used by the processes receiving web requests; do not assume it matches the version on your development machine or the one declared by the project. Depthfirst warns that a repository manifest may differ from the actual deployment. If you manage multiple services, include internal tools and legacy applications that may run PHP.
Confirm the session handler. Check the effective server and application configuration to find out whether sessions are stored in files or another backend. The file handler is PHP's default. Redis, a database, or another handler is not affected by this specific flaw, but that distinction does not amount to a security assessment of those systems.
Compare both details with the table. If the server runs a version earlier than the patched one and stores sessions in files, treat that installation as affected. Do not rule it out because it uses WordPress, Laravel, or another framework: the flaw is in PHP and can affect applications using the file handler.
Update to the patched version. Install the release corresponding to your branch: PHP 8.5.13, 8.4.28, 8.3.37, or 8.2.36. PHP 8.6.0 also includes the fix. If you are on PHP 8.1 or earlier, move to a supported branch; unsupported versions will not receive this fix as a regular update.
Deploy and verify again. If PHP is distributed in container images, rebuild and redeploy the images, as Depthfirst recommends. Then check which version is actually handling production requests. Updating the repository or a local image does not by itself prove that the service is now running the patched version.
Apply a mitigation if you cannot update yet. If you do not need file upload progress, disable it in PHP's administrative configuration and restart the PHP processes, as PHP recommends in its security advisory and Depthfirst. The directive is:
session.upload_progress.enabled = 0This measure removes one entry point, but does not fix the flaw if the application can introduce untrusted data into sessions through other means. Keep the update plan in place.
Review the use of untrusted data in sessions. While preparing the patch, check whether the application stores large strings or user-controlled content in sessions. Limiting this data is an additional mitigation listed in PHP's GitHub advisory; it does not replace the update. Do not assume that disabling upload progress makes an application safe if it builds sessions from untrusted input through another route.
Check progress features after updating. The new releases disable upload progress by default, according to Hardware Upgrade. If your application depends on this feature, verify its behavior after deployment and manually re-enable it if necessary. Do not re-enable it routinely: do so only when the application needs it.
Mistakes to avoid
Do not confuse the October patch with this fix. The updates released on October 21 stopped an earlier attack, but did not fix the interrupted write that causes phpAfterShell. Having installed PHP 8.5.12, 8.4.27, 8.3.36, or 8.2.35 does not prove that this installation is protected.
Do not rely only on the declared version. A dependency file or repository configuration may indicate a different version from the one the server runs. Check the deployed environment and all services receiving traffic, including those that are not part of the main application.
Do not treat Redis or a database as general proof of security. Those backends are outside this specific flaw in the file handler, but PHP notes that the atomicity of writes in other systems must be assessed separately. The correct conclusion is limited to CVE-2026-126714.
Do not leave the mitigation in place as a permanent solution. Disabling upload progress reduces the most direct attack path, but does not fix the faulty write or cover applications that store attacker-controlled data in other ways. The final measure is to install the appropriate patch.
PHP and Depthfirst had not reported exploitation of phpAfterShell in real-world environments. Depthfirst also chained the flaw with another memory corruption vulnerability to demonstrate code execution; details remained reserved for coordinated disclosure.
Sources: Hardware Upgrade, vim-classic.org, SecurityWeek, GitHub, depthfirst