New: Citizen Developer Security | Let everyone develop. Securely.

See how

Blog

PHPAfterShell (CVE-2026-126714): critical flaw in PHP’s default session handler

4 MIN

PHPAfterShell (CVE-2026-126714) is a flaw in PHP’s default file session handler that can let an attacker run code on a PHP server. PHP rates it 9.2 on CVSS 4.0 and fixed it on November 19, 2026 in 8.2.36, 8.3.37, 8.4.28 and 8.5.13 (PHP advisory). The October PHP2Shell releases do not contain this fix, so servers patched for PHP2Shell are still affected (The Hacker News).
Key highlights

  • What it is: a flaw in how PHP saves sessions to files that can let an attacker run code as the PHP worker.
  • Severity: CVSS 4.0 9.2, critical (PHP).
  • Affected: PHP below 8.2.36, 8.3.37, 8.4.28 or 8.5.13. Every 8.1 and older release too.
  • Affected configuration: sessions stored with the files handler, PHP’s default.
  • Fix: PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0.
  • Stopgap: session.upload_progress.enabled = 0 closes one path only.
  • Exploitation: neither the PHP maintainers nor the reporter report attacks (The Hacker News).

Who is exposed

A PHP application is exposed when it runs an affected version and keeps sessions in files, which PHP does by default. Sessions stored in Redis, a database or another store that replaces records in one step are not affected by this flaw, though PHP advises checking how each store handles an interrupted update.

Shift to AI podcast hosted by Roland Cloutier. Listen nowShift to AI podcast hosted by Roland Cloutier. Listen nowShift to AI podcast hosted by Roland Cloutier. Listen now

Fix status

Source Status Builds
PHP 8.5 Fixed 8.5.13
PHP 8.4 Fixed 8.4.28
PHP 8.3 Fixed 8.3.37
PHP 8.2 Fixed 8.2.36
PHP 8.6 Fixed 8.6.0, released the same day
PHP 8.1 and older No fix planned end of life
Debian 12 and 13 (security) Fixed 8.2.36-1~deb12u1, 8.4.28-1~deb13u1
Debian testing and unstable No fix yet 8.4.27-1
Ubuntu Needs evaluation
Alpine No advisory yet
Red Hat No advisory yet

Distribution packages can include the fix without a change in the PHP version number, so check your vendor’s advisory, not only the version.

Upload progress is now off by default

The Hacker News compared the PHP source of the October and November releases and found that the fixed releases switch session.upload_progress.enabled off by default. The release notes do not mention the change. A php.ini file, distribution package or hosting panel that switches the setting on keeps it on. Applications that rely on upload progress and set nothing need to switch it back on after the update.

See Cycode in action. Book a demoSee Cycode in action. Book a demoSee Cycode in action. Book a demo

How to check

  1. Run php -v on each host. For a container image: docker run --rm --entrypoint php <image> -v.
  2. Check session.save_handler in the configuration that serves web requests, for example the PHP-FPM pool configuration or phpinfo() on a test page that you remove afterwards. files is the affected handler.
  3. Check that the PHP version serving web requests, not only the command line, is the new one.

How Cycode helps

Two items on the Threat Intelligence dashboard query the Context Intelligence Graph:

  • Image runtimes: scanned container images with a PHP runtime below the fixed versions, from an official php image or a distribution package. Images patched only for PHP2Shell are listed. The count is the number of images.
  • Dockerfiles: Dockerfiles that reference a PHP runtime or PHP application image. The item does not read the PHP version, so check the version in the built image.
Your complete Post-Mythos toolkit. Learn moreYour complete Post-Mythos toolkit. Learn moreYour complete Post-Mythos toolkit. Learn more

What to do

  1. Install the fixed release for your branch: 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0. Move PHP 8.1 and older to a supported branch. If your application uses upload progress, set session.upload_progress.enabled = 1 after the update.
  2. Rebuild container images that bundle PHP with a fresh base image (docker build --pull) and redeploy them.
  3. If you cannot update yet and your application does not use upload progress, set session.upload_progress.enabled = 0 in php.ini or the PHP-FPM pool (php_admin_flag) and restart the PHP workers. Also limit the untrusted data your application stores in sessions. This is not a full fix: applications that put attacker-controlled data into sessions in other ways stay affected. Servers that kept the setting off since PHP2Shell still need the update.

Sources

See Cycode in actionBook a demo

FAQ

Frequently asked questions

What is PHPAfterShell?

A critical flaw in PHP's default file session handler, tracked as CVE-2026-126714.

Which versions are affected?

PHP below 8.2.36, 8.3.37, 8.4.28 or 8.5.13. Every 8.1 and older release is affected too.

I patched for PHP2Shell. Am I safe?

No. The October releases do not contain this fix.

Am I affected if I store sessions in Redis?

Not by this flaw. Only the files handler is affected. Check how your store handles an interrupted update.

Is it exploited?

Neither the PHP maintainers nor the reporter report attacks.

Is there a workaround?

Turning off upload progress closes one path only. Update PHP.