Patch-now · Breaking

PHP patches critical “phpAfterShell” bug (CVE-2026-126714) that can turn its default file-based sessions into remote code execution; upgrade to 8.5.13, 8.4.28, 8.3.37 or 8.2.36

PHP shipped security releases on Nov 19 that fix CVE-2026-126714, a critical flaw (CVSS 4.0 score 9.2) found by depthfirst and nicknamed phpAfterShell. It sits in PHP's default way of storing user sessions as files on disk: an interrupted write can leave a corrupted session file that PHP later trusts, and depthfirst chained that into running its own code on the server. Fixed in PHP 8.5.13, 8.4.28, 8.3.37, 8.2.36 and the new 8.6.0.

Nov 19, 2026 · 4 min read

What happened. The PHP project released PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36 on Thursday, Nov 19, alongside the new PHP 8.6.0, in a security release it had pre-announced for 14:00–14:30 UTC (6:00–6:30 AM PT). One of the fixes is CVE-2026-126714, rated critical by PHP and scored 9.2 out of 10 under CVSS 4.0 (the standard severity scale). Security firm depthfirst found it and calls it “phpAfterShell.” It says its AI models and researchers found the bug and reported it privately to PHP in late October.

The bug, in plain words. A session is how a website remembers you between clicks (your login, your cart). By default PHP saves each session as a small file on the server (session.save_handler = files). When PHP rewrites that file, the write isn’t all-or-nothing. depthfirst found ways to cut the write off halfway, leaving a file that is part new data and part old. The next time the app calls session_start(), PHP reads that spliced file back and turns it into live objects in memory, a step called deserialization. An attacker who shapes those leftover bytes gets to choose the objects. depthfirst chained this with a second memory bug in a built-in PHP class to run its own code on the server. The easiest way in is PHP’s upload-progress feature, which can update the session file while a file upload is still being read, before the app’s own code even runs.

Who is affected. PHP 8.5 before 8.5.13, 8.4 before 8.4.28, 8.3 before 8.3.37 and 8.2 before 8.2.36, when sessions are stored in files. PHP’s advisory says the issue is not limited to upload progress. Apps that keep sessions in Redis, a database or another non-file store are not affected by this specific bug, depthfirst says. The Oct 21 PHP releases (8.5.12, 8.4.27, 8.3.36, 8.2.35) do not fix it. PHP 8.1 and older are end-of-life and won’t get this fix; depthfirst says the official 7.4, 8.0 and 8.1 end-of-life mitigation branches are not affected.

Part of a bigger patch day. BleepingComputer, citing security firm Aikido, reports the releases fix 18 vulnerabilities in total, including a separate critical PHP-FPM request-smuggling bug (CVE-2026-129289, also CVSS 9.2) and other bugs that could lead to remote code execution. Ahead of the release, PHP warned that its critical-rated issues “require either non-default configuration or uncommon setups.” None of the sources we checked report attacks in the wild using phpAfterShell.

Why it matters. The flaw is in PHP itself, not in one app. depthfirst says PHP runs 68% of websites with a known server-side language (citing W3Techs), and that WordPress, Laravel and other frameworks are in scope if they use file sessions. For enterprises the hard part is finding every copy: PHP hides inside container images, vendor appliances, marketing sites, intranet tools and legacy apps that nobody patches on a schedule. It also lands one day after critical NGINX HTTP/2 fixes, so web-tier teams have two patches to schedule this week.

Defender takeaway. Upgrade to 8.5.13, 8.4.28, 8.3.37 or 8.2.36 (or 8.6.0). Rebuild container images rather than just bumping a tag, redeploy, and check the version actually serving traffic, since the version a repo declares can differ from production. If you can’t patch today, set session.upload_progress.enabled = 0 in php.ini and restart PHP workers. That closes the easiest path, not the bug. Worth asking your team: how many places in our stack are running PHP that we don’t own a patch schedule for?

Sources