---
title: "PHP patches critical phpAfterShell session flaw enabling remote code execution"
description: "PHP has released fixes for a critical session-file flaw, CVE-2026-126714, that can let an attacker corrupt stored session data and reach remote code…"
url: "https://shadowmap.com/threat-intel/php-phpaftershell-session-file-flaw/"
---

[All incident reports](https://shadowmap.com/threat-intel/) 

 Incident report 

#  PHP patches critical phpAfterShell session flaw enabling remote code execution 

 PHP has released fixes for a critical session-file flaw, CVE-2026-126714, that can let an attacker corrupt stored session data and reach remote code execution. The bug, named phpAfterShell by the firm that reported it, has no reported exploitation in the wild. 

[ShadowMap Research](https://shadowmap.com/threat-intel/about/)  · First published 23 Nov 2026, 19:28 IST 

## The short version

- **The flaw.** PHP fixed CVE-2026-126714, rated 9.2 on the CVSS severity scale, on 19 November alongside six other critical issues. The security firm Depthfirst calls it phpAfterShell.
- **How it works.** An attacker who can control data written to a session file and interrupt the write can leave new session data sitting alongside remnants of the old. A later request that starts a session on that file can treat the mixed content as valid state and trigger object deserialisation, leading to remote code execution.
- **Conditions.** Exploitation requires default file-backed session storage, a way to influence session data (upload-progress tracking is the easiest), a PHP process that stops mid-write, a later session\_start() call on the corrupted file, and a deserialisation path to code execution.
- **Exploitation status.** There appear to be no reports of phpAfterShell being exploited in the wild. Depthfirst links it to PHP2Shell, an earlier flaw whose fix restricted which objects could be created in memory but did not change how the session file is written.

## How the corruption happens

Depthfirst says an attacker who can control data written to a session file and interrupt the write can leave the file holding new session data followed by remnants of the old. A later request that starts a session on that file can treat the mixed content as valid server-side state, letting the attacker set session values and trigger object deserialisation, in which stored data is rebuilt as live objects. That can lead to remote code execution.

The underlying cause, per Depthfirst, is that PHP overwrites the session file from the start without emptying it first. If the write is interrupted before the trailing old data is truncated, ordinary strings can end up positioned where serialised object data is expected. PHP's own advisory notes the same problem can arise when an application stores large user-controlled strings in a session, and that on threaded builds a memory-limit failure in another thread can stop the process mid-write.

## Who is exposed and what fixes it

Exploitation needs several things at once: default file-backed session storage, a route to influence session data, a PHP process that stops mid-write, a later request calling session\_start() on the corrupted file, and a path from deserialisation to code execution. Depthfirst says it found reliable ways to interrupt the write during session upload-progress updates, which it describes as the easiest route.

PHP fixed the bug on 19 November in version 8.4.28 and in the corresponding releases for its other supported branches, alongside six other critical issues. Administrators should check PHP's advisory for the release that matches the branch they run.

## Link to PHP2Shell

Depthfirst describes phpAfterShell as related to PHP2Shell, a flaw in the handling of unauthenticated multipart requests where an upload-progress callback could open and decode a file-backed session before the target script ran. PHP restricted which objects could be created in memory during that callback but, according to Depthfirst, left the file update behaviour unchanged: the callback still reads the session, adds upload-progress state, serialises the whole thing and writes it back to the same file.

## What is not known yet

- Whether any attacker has attempted to exploit phpAfterShell, and who might.
- How many production applications meet all of the conditions the flaw requires.
- Whether shared hosting providers and managed platforms running PHP have applied the 19 November fixes.
- _Whether PHP2Shell_ itself was ever exploited in the wild.

## What to do

### If you run PHP

1. Upgrade to PHP 8.4.28, or the patched release for your branch listed in PHP's advisory.
2. Check whether your applications rely on PHP's default file-backed session storage, which the flaw depends on.
3. Note that upload-progress tracking is described as the easiest way for a remote client to influence stored session data.

### If you develop PHP applications

1. Avoid storing large user-controlled strings in session data, which PHP's advisory says can produce the same corruption.
2. Review code that calls session\_start() on session files that may have been written by an interrupted operation.

### For everyone else

1. Treat session state written in place as fragile: a write that is cut short can leave data that a later request accepts as genuine, so keep runtimes current and watch for advisories on session handling.

## From vulnerability news to your exposure

A newly exploited vulnerability does not mean every organisation is equally exposed. The useful questions are whether the affected technology is present, which version is running and whether the vulnerable service is reachable.

ShadowMap monitors external assets, services and technologies, correlating them with vulnerability intelligence. Where testing is safe and authorised, selected exposures can also be validated through CART. A version match alone is not proof of exploitation.

[Attack surface management in ShadowMap](https://shadowmap.com/attack-surface-management/)

## Update log

- 23 Nov 2026, 19:28 IST First published.

## Sources

- [phpAfterShell Vulnerability Revives PHP2Shell’s Attack Path](https://www.securityweek.com/phpaftershell-vulnerability-revives-php2shells-attack-path/) SecurityWeek, 23 Nov 2026

### New incident reports by email

One email a week with the reports published since the last one.

We email you about this topic only; unsubscribe any time. See our [Privacy Policy](https://shadowmap.com/privacy-policy/).

You are on the list. The next weekly email will include you.

That did not go through. Please try again.

[Add ShadowMap as a preferred source on Google](https://www.google.com/preferences/source?q=shadowmap.com) 

##  Want us to look at your domain? 

 Give us one apex domain and we'll send back a written snapshot of what is already visible from outside. No call required. 

[ Get a free exposure snapshot ](https://shadowmap.com/resources/exposure-snapshot/?source=threat-intel-php-phpaftershell-session-file-flaw) [ Book a 30-minute demo ](https://shadowmap.com/contact/?source=demo&threat-intel=php-phpaftershell-session-file-flaw)
