PHP CVE-2026-126714: phpAfterShell Session File Flaw Rated 9.2, and the Versions to Install
PHP has fixed CVE-2026-126714, a flaw rated 9.2 in its default file-based session handler. Here is what is confirmed, which versions are affected and what to update this week.
Where Worldwide
On this page 8 sections
PHP has fixed a flaw in the way it saves user sessions to files. It is tracked as CVE-2026-126714, and the PHP project's own advisory gives it a severity score of 9.2. If your website, online store or web app runs on PHP and stores sessions the default way, update PHP to a fixed version this week.
Sessions are how a PHP site remembers a visitor from one page to the next: the logged-in customer, the shopping cart, the admin user. The advisory says the file-based session handler can end up with one session file holding pieces of two different sessions. News coverage calls the issue phpAfterShell.
What happened with CVE-2026-126714
The PHP project published a security advisory in its php-src repository on GitHub. It covers the session extension (ext-session), specifically the default file-based session handler.
The advisory puts it this way: "PHP's file-based session handler can leave a session file containing parts of two different serialized sessions if a write" is interrupted partway through.
The root cause is stated plainly: "The vulnerable implementation does not clear the existing contents before every write." So if a new write stops partway, leftover data from the old session can sit in the same file next to the new data.
The advisory also describes the fix: "The fix truncates the session file to zero before writing the replacement data and aborts the write if truncation fails." In plain terms, PHP now empties the file first. If it cannot empty the file, it does not write at all.
PHP's official ChangeLog for PHP 8 shows the date 19 Nov 2026.
Which PHP versions are affected by CVE-2026-126714
| PHP branch | Affected versions (from the advisory) | Version to install |
|---|---|---|
| 8.5.0+ | 8.5.0 up to, but not including, 8.5.13 | 8.5.13 or later |
| 8.4.0+ | 8.4.0 up to, but not including, 8.4.28 | 8.4.28 or later |
| 8.3.0+ | 8.3.0 up to, but not including, 8.3.37 | 8.3.37 or later |
| Below 8.2.36 | Anything below 8.2.36 | 8.2.36 or later |
The advisory's affected ranges stop at 8.2.36, 8.3.37, 8.4.28 and 8.5.13, so those are the first versions outside the affected range on each branch. The range for the oldest branch is simply "< 8.2.36". If you run a version below 8.2.36, you fall inside it, and the lowest version outside the range is 8.2.36. That means moving to a newer branch, not applying a small patch.
What is confirmed, and what is not known
Confirmed in PHP's advisory: the CVE number, the affected component (the default file-based session handler), the four affected version ranges, the 9.2 severity score, the root cause and how the fix works.
Reported in the news, not in the advisory: on attacks, The Hacker News writes: "Neither the maintainers nor the company reports any attacks using phpAfterShell." That is a report of no known attacks. It does not prove there have been none.
Not known from the sources we checked:
- How an attacker could cause an interrupted session write on demand.
- What an attacker could do with a mixed session file in a real application. The 9.2 score shows the PHP project treats the flaw as serious, but the advisory text we confirmed does not set out a full attack path.
- Whether apps that keep sessions somewhere other than files are affected. The advisory is about the file-based handler.
- Whether a given Linux distribution or hosting company has added the fix to its own PHP package under a different version number.
We are not filling those gaps with guesses. Updating PHP is the action either way.
How to check your PHP version
- On a server you control: run
php -vover SSH. The command-line PHP can differ from the PHP your website actually uses (for example PHP-FPM), so check both. - On managed hosting: look for the PHP version setting in your hosting control panel.
- To see what the live site runs: a temporary phpinfo() page shows the exact version. Delete it as soon as you have read it, because it exposes server details.
- Distribution packages: your operating system's PHP package may use its own version numbering. Ask the vendor or host whether their package includes the CVE-2026-126714 fix.
What to do this week
- List every place PHP runs. Production servers, staging, hosting plans, containers, and the old marketing site or client portal nobody thinks about.
- Check the version on each one using the steps above.
- Update to the fixed release on your branch: 8.2.36, 8.3.37, 8.4.28 or 8.5.13, or any later version on that branch.
- Restart PHP-FPM or the web server, then check the version on the live site again to confirm the new version is the one actually running.
- Rebuild containers from an updated base image. A running container does not update itself.
- Plan the move off any PHP version older than 8.2.36 if any site still runs it, and test the application on the newer branch.
- If a host or agency manages your server, ask in writing which PHP version you are on and when the fix will be in place.
- Do not wait for a workaround. The advisory text we checked describes the fix, not a setting you can change instead.
Why this matters for a business website
WordPress, many online stores and a lot of custom web applications run on PHP. Sessions carry the most sensitive state a website has: who is logged in, what is in their cart, whether they are an administrator. A session file that mixes data from two different sessions is the last thing you want on a site with customer accounts or an admin panel.
The flaw sits in PHP itself, below your website. Updating WordPress, a plugin or your own code does not change the PHP version on the server. Someone has to update the runtime, and on many business sites it is not clear who that is.
PHP CVE-2026-126714 questions people are asking
What is phpAfterShell?
It is the name news coverage uses for CVE-2026-126714, a flaw in PHP's default file-based session handler. An interrupted write can leave a session file mixing two different sessions.
Is CVE-2026-126714 being exploited?
No attacks have been reported. The Hacker News writes that neither the maintainers nor the company reports any attacks using phpAfterShell. Update anyway.
Which PHP version fixes CVE-2026-126714?
PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13 are the first versions outside the affected ranges on their branches. Install the one for your branch, or later.
Does the PHP session vulnerability affect WordPress sites?
The flaw is in PHP, not WordPress. If your WordPress site runs on an affected PHP version, PHP on the server needs updating, usually by your host or whoever manages the server.
Is there a workaround if I cannot update PHP yet?
The advisory text we checked describes the fix, not a workaround. Updating PHP is the remedy.
How serious is a 9.2 severity score?
The PHP project's advisory rates it 9.2. That score calls for updating promptly, not waiting for a routine maintenance cycle.
The bigger lesson
Your website is more than the code you can see. It runs on a language runtime, a web server and an operating system, and each of those gets security fixes on its own schedule. A site is only patched when every layer is patched and someone owns the job of checking.
If you want the whole stack reviewed and kept up to date, see security hardening or request a quote.
Get security alerts like this by email, along with the free checklist, at security alerts.
Sources: PHP security advisory GHSA-fm2m-fjf5-v3cp; PHP 8 ChangeLog; The Hacker News.
Have a question about this article?
Ask it here and we will answer you directly by email. Questions are private, never posted.
Security alerts by email
Hear about the next one first.
When attackers start using a flaw in software businesses run on, we email what it is, whether it touches you and what to do that week, with a round-up of our latest security writing. Free, one-click unsubscribe. You get the checklist straight away: 12 things to secure this week.
Want a result like this?
Security alerts, breaches and the technology a business runs on: what happened, who it affects and what to do.
Get a Tech QuoteKeep reading
CISA KEV: Apache Axis, REDCap, Synology DSM and LiteLLM Flaws Exploited, No Patch Coming for Axis 1.x, and the Fixed Versions to Install
CISA has added exploited flaws in Apache Axis, REDCap, Synology DSM and LiteLLM to its KEV catalog. Apache wil...
Database RCE: PostgreSQL CVE-2026-116331, ClickHouse, MySQL and Oracle Flaws Show Locked-Down Database Accounts Can Still Reach the Server, and the Fixed Versions
Depthfirst researcher Zheng Yu showed that tight database permissions still leave room for attacks that run co...
Java4Shell Vulnerability CVE-2026-114938: Critical OpenJDK Base64 Flaw, Attack-Shaped Traffic Recorded, and What to Patch This Week
Java4Shell (CVE-2026-114938) is a critical memory-corruption flaw in OpenJDK's Base64 decoder. It affects unpa...