phpAfterShell (CVE-2026-126714): Session-File Corruption to RCE in PHP’s Default Session Handler

phpAfterShell CVE-2026-126714, a PHP session file split into a clean new half and a corrupted old half, Phoenix Security vulnerability intelligence

Executive Summary

On 19 November 2026 the PHP project shipped 8.2.36, 8.3.37, 8.4.28 and 8.5.13, plus 8.6.0 final. The release closes seven critical vulnerabilities. Each one carries a PHP CVSS v4.0 score of 9.2.

The headline bug is phpAfterShell, tracked as CVE-2026-126714 (PHP advisory GHSA-fm2m-fjf5-v3cp). It is a flaw in PHP’s built-in files session handler. An interrupted write can leave a session file that mixes the start of a new session with the tail of the old one. On a later request, PHP reads that mixed file back as valid session data. If an attacker can influence session contents, this opens a path to object injection. With a suitable gadget chain, it leads to remote code execution.

phpAfterShell is CVE-2026-126714. It is a different bug from CVE-2026-115560 (PHP advisory GHSA-658j-r8rw-q6mx). Both touch PHP sessions, so people mix them up. Their failure modes don’t overlap. phpAfterShell makes PHP trust a partially overwritten session file. CVE-2026-115560 needs two contexts that read and write the same session with incompatible serializers. The preconditions, fixes and blast radius are all different. A wrong CVE number on a remediation ticket sends teams chasing the wrong configuration.

The release also has a second route to unauthenticated code execution, and this one doesn’t need sessions. CVE-2026-129289 is a PHP-FPM request smuggling flaw (PHP advisory GHSA-qc49-hpvq-g2w6). On some deployments, the front end reuses its FastCGI connection to the worker pool. There, a single crafted request can run attacker-controlled PHP as the FPM worker. It needs no sessions, no memory corruption and no race. That makes it the most reliable bug in the batch and the one to patch first.

TL;DR for Engineering Teams

  • What it is: phpAfterShell (CVE-2026-126714, CVSS v4.0 9.2) corrupts PHP’s default file-based session store, so a later read deserializes attacker-influenced data. It is part of a seven-CVE PHP release from November 2026.
  • Where it bites: PHP 8.2 to 8.5 with session.save_handler = files (the default). The parallel FPM bug (CVE-2026-129289) hits any 8.2 to 8.5 host whose front end reuses backend FastCGI connections.
  • Why it matters: PHP runs roughly 68% of websites with a known server-side language (W3Techs). The October PHP2Shell bugs sit in the same session and upload-progress code. They were exploited before patches shipped, and CISA added them to KEV on 26 October (CISA alert). No in-the-wild use of the November CVEs is reported yet. But 26 GitHub repositories naming the related CVE-2026-115560 appeared within ten days of its 23 October pre-advisory.
  • Patch status: Fixed. The first patched releases are 8.2.36, 8.3.37, 8.4.28 and 8.5.13. 8.6.0 final also has the fixes. End-of-life branches (8.1 and older) get no upstream fix.
  • Immediate action: Today, patch any host with FastCGI connection reuse (CVE-2026-129289). Then patch every host on default file sessions (phpAfterShell and CVE-2026-115560). If you can’t patch at once, disable front-end-to-FastCGI connection reuse and set session.upload_progress.enabled=0 in server config. Then restart workers.

Vulnerability Overview

FieldValue
VendorPHP Group
ProductPHP (ext/session files handler)
Vulnerability TypeSession-file corruption leading to object injection / RCE
CWECWE-367 (TOCTOU), CWE-662
CVSS Score9.2 (PHP CVSS v4.0)
CVECVE-2026-126714 (phpAfterShell)
AdvisoryGHSA-fm2m-fjf5-v3cp
Patch AvailableYes (8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 / 8.6.0)
Active ExploitationNot confirmed as of 19 November 2026

Technical Anatomy

Root cause

The files session handler writes the new serialized blob into the existing session file. It doesn’t clear the file first. When the write completes, the new data fully overwrites the old. When the write stops partway, the file can hold the start of the new session followed by the leftover end of the previous one. A fatal error or a process limit hit in the middle of pwrite can cause this. PHP’s advisory describes the result as a file with parts of two different serialized sessions.

A broken file on its own would be harmless. The problem is that PHP still parses the mixed file as valid session data the next time the session opens. An attacker needs two things: control over part of the session contents, and a way to interrupt the write at a chosen point. With both, they can steer what PHP deserializes on the next request.

PHP notes the issue is not limited to upload progress or to PHP 8.6. Upload progress is one easy way to get attacker bytes into a session before application code runs. But any application that stores attacker-controlled values in a file-backed session is in scope.

Exploit path

  1. Entry point. The attacker sends a request that makes PHP write attacker-influenced data into a file-backed session. Then they force the replacement write to stop at a controlled offset. With upload progress on, PHP updates the session while it parses a multipart body, before application code runs. So the target endpoint doesn’t need its own upload feature.
  2. Trigger. On a later request, PHP opens the session and reads the mixed file. The serialized stream now has attacker-steered object data stitched to a trusted prefix. PHP deserializes it like a normal session.
  3. Execution impact. The deserialized objects drive a gadget chain in the application’s loaded code toward remote code execution in the PHP worker process.

A note on the public evidence. The researchers who reported the bug to PHP in late October 2026 named it phpAfterShell. They say they chained it with a separate PHP-native deserialization-to-RCE finding to reach code execution. PHP’s advisory frames the final RCE as conditional on a suitable gadget chain in the application. Until the full write-up is validated, treat any claim that end-to-end RCE needs no application gadget as a researcher claim. The researchers also say the exploits worked against default configurations. PHP’s pre-release notice said the critical issues need non-default or uncommon setups. That disagreement is worth tracking.

The parallel route: CVE-2026-129289 (PHP-FPM request smuggling)

This bug needs no sessions at all. That is why it leads the patch order.

A malformed multipart/form-data body stops PHP’s multipart parser at a predictable position. If the application opens php://input and doesn’t read it to the end, the leftover bytes stay on the persistent backend connection. PHP-FPM then parses those bytes as a new FastCGI request. The front end never created or authorized that request.

The forged request controls SCRIPT_FILENAME, REMOTE_ADDR and PHP_ADMIN_VALUE. Setting allow_url_include=1 with auto_prepend_file=php://input runs the request body as PHP. The injected admin settings can also persist for later requests on the same worker.

PHP states the attack crosses the HTTP-to-backend trust boundary with a single request. It doesn’t need memory corruption, address knowledge or a race. For the LSAPI SAPI, the advisory confirms request desynchronization, not code execution.

Affected Versions

PackageVulnerable VersionsFixed VersionNotes
PHP (phpAfterShell, CVE-2026-126714)8.2.x to 8.5.x before the fixed releases8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 / 8.6.0Requires files session handler (default)
PHP-FPM / LSAPI (CVE-2026-129289)8.2.x to 8.5.x (bug present since 5.6.0)8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 / 8.6.0Needs front-end FastCGI connection reuse; EOL 5.6 to 8.1 unfixed
PHP session serializer (CVE-2026-115560)8.2.x to 8.5.x8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 / 8.6.0Needs upload progress + mismatched session.serialize_handler
PHP engine, magic-method backtrace (CVE-2026-129474)8.5.x8.5.13 / 8.6.08.5 only; zend.exception_ignore_args=1 blocks the path
PHP date, timezone cache (CVE-2026-129496)8.2.x to 8.5.x8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 / 8.6.0Depends on file-based error_log startup diagnostics
PHP engine, backtrace after shutdown (CVE-2026-129182)8.5.x8.5.13 / 8.6.08.5 only; use-after-free, no demonstrated RCE
PHP session shutdown (CVE-2026-129481)8.3.x to 8.5.x8.3.37 / 8.4.28 / 8.5.13 / 8.6.0Incomplete fix for October CVE-2026-109619

All seven report CVSS v4.0 9.2 with Attack Requirements present. That means each one depends on deployment conditions. Prioritize by your configuration, not by the shared score.

Exposure Analysis

EnvironmentRisk LevelReason
Internet-exposed PHP-FPM behind a reusing front endCriticalCVE-2026-129289 gives single-request unauthenticated code execution with no gadget or memory work
Internet-exposed apps on default file sessionsHighphpAfterShell and CVE-2026-115560 reach deserialization through attacker-influenced session data
CI/CD pipelines running PHPHighWorker compromise exposes build credentials and artifact signing material
Cloud workloads / shared hostingHighShared session storage across FPM pools or vhosts widens CVE-2026-115560 reach
Developer environmentsMediumLocal file sessions and debug error logging raise the timezone-cache path (CVE-2026-129496)

Scale context: W3Techs reports PHP on roughly 68% of sites with a known server-side language. PHP 8 runs on about 68% of PHP sites. Internet scans during the October response put internet-facing PHP hosts in the low millions. Session storage isn’t visible from outside, so nobody can measure how many of those hosts use default file sessions. Files is the default. Assume most self-managed deployments are in scope until you prove otherwise.

Real-World Impact

As of 19 November 2026, no source reports in-the-wild exploitation of any November CVE. No reports doesn’t mean no exploitation. Two signals still argue for urgency.

First, PHP published an informational advisory for CVE-2026-115560 on 23 October. Between 21 and 31 October, 26 GitHub repositories naming that CVE were created. At least six describe a proof of concept, a lab or an exploit framework.

Second, the October PHP2Shell bugs sit in the same session and upload-progress code. Exploitation attempts were seen four days before those bugs were disclosed. CISA added CVE-2026-109618 and CVE-2026-109619 to KEV on 26 October (CISA alert). Public reporting later documented real compromises tied to them.

Realistic attack scenarios:

  • An attacker runs code as the FPM worker through CVE-2026-129289 and pivots into cloud credentials mounted on the host.
  • An attacker poisons a file-backed session on a multi-tenant host to deserialize into a known framework gadget.
  • A shared-hosting tenant reads another tenant’s session where storage isn’t isolated between pools.

Detection Guidance

Log indicators

Look for multipart/form-data POSTs with malformed or truncated boundaries. Correlate them with FPM worker deaths (SIGSEGV or SIGABRT) and memory_limit fatal errors in the same window.

Watch for session files that fail to decode. Watch for object notation in sessions where the application stores only scalars, and for unexpected upload_progress_ keys.

For CVE-2026-129289, look for requests that reach scripts your front-end routing doesn’t expose. Also look for allow_url_include or auto_prepend_file values taking effect that you never set. A worker that keeps running doesn’t prove you’re safe. A successful exploit leaves the worker alive.

Scanner references

Phoenix Security scanners identify affected PHP runtime versions across your estate. Each finding is tied to the deployment that serves traffic. Pair that with SCA and SBOM review for PHP runtime version strings, and with external attack surface scanning for internet-facing FPM listeners. Host inventory then shows the effective session.save_handler, the upload-progress setting and the front-end FastCGI reuse flags. Those settings decide whether a given host is actually exploitable.

Verification steps for teams

  1. Inventory every running web worker’s PHP build or vendor package revision, not just a CLI php -v.
  2. Record the effective session.save_handler, session.serialize_handler and session.upload_progress.enabled per pool.
  3. Check the front end for FastCGI connection reuse: nginx fastcgi_keep_conn, Apache mod_proxy_fcgi enablereuse, HAProxy FastCGI retained connections, or LSAPI.
  4. Confirm the patched build is the one serving requests after rollout. A clean Composer scan doesn’t prove the runtime was replaced.

Remediation Guidance

Immediate actions

  1. Upgrade the serving runtime to 8.2.36, 8.3.37, 8.4.28 or 8.5.13, or to 8.6.0 (see the PHP 8 ChangeLog). For distribution or appliance builds, take the vendor’s fixed package revision. Don’t judge by the upstream version string, because downstream backports often leave PHP_VERSION unchanged.
  2. Rebuild and roll out affected container images or restart affected services. Then verify every replica is on the fixed build.
  3. On PHP 8.5 hosts, confirm zend.exception_ignore_args=1 (the php.ini-production default). This closes the CVE-2026-129474 path (PHP advisory GHSA-8mjj-2r7p-4hg2). Check FPM pool overrides for it too.

Temporary mitigations if patching is delayed

  1. Disable front-end-to-FastCGI connection reuse on unpatched FPM hosts (fastcgi_keep_conn off, enablereuse=off). This fully removes the demonstrated CVE-2026-129289 attack. It is the highest-value stopgap.
  2. Set session.upload_progress.enabled=0 in php.ini or the FPM pool config, before request processing. An application-level ini_set() runs too late. This blocks the demonstrated upload-progress route into phpAfterShell and CVE-2026-115560. It doesn’t block every route that puts untrusted data into file sessions.
  3. If upload progress stays on after the upgrade, align session.serialize_handler across every application, pool and CLI job that shares a session store. Or isolate the stores. Separate FPM pools don’t automatically mean separate session storage.
  4. Fix startup configuration warnings or switch error_log to syslog to close the CVE-2026-129496 path. Then restart the master and all workers.

Patch order to take

  1. FastCGI-reusing hosts first (CVE-2026-129289).
  2. All default-file-session hosts (phpAfterShell and CVE-2026-115560).
  3. PHP 8.5 hosts (CVE-2026-129474, CVE-2026-129182).
  4. The condition-heavy CVE-2026-129496 and CVE-2026-129481.

End-of-life branches get no upstream fix. Migrate PHP 8.1 and older, or apply a vendor backport.

Phoenix Security Recommendations

Phoenix Security turns a seven-CVE release into one owned, trackable backlog instead of seven parallel fire drills.

Contextual deduplication correlates PHP runtime findings across SCA, container and attack-surface scanners. You get a single prioritized item per deployment, so the same host doesn’t generate seven separate tickets. Reachability analysis shows which PHP workers actually serve traffic and which carry the exploitable configuration. The FastCGI-reusing and file-session hosts rise to the top, instead of every PHP install at once.

Remediation campaigns let a team create a campaign for the November PHP release, assign owners by service and track upgrades to the specific fixed version. The team can then verify that the patched build is the one serving requests at runtime. Vulnerability ownership attribution maps each finding to the responsible team automatically. Attack surface management flags internet-facing FPM listeners running vulnerable runtimes. The blast radius shrinks to the hosts that are actually exploitable, with an owner and a verified fix on each.

The Phoenix campaign for this release

We’ve prepared a campaign config for the November PHP release: “PHP November 2026 Critical Release – phpAfterShell + FPM smuggling”. It’s an exposure campaign. The target is every PHP runtime in your estate.

What the campaign matches: four packages, php, php-fpm, php-cli and php-cgi, across all versions. Findings land in one campaign backlog, mapped to the owning team.

Priority inside the campaign follows the patch order above. FastCGI-reusing hosts come first, then default file-session hosts, then PHP 8.5, then the rest. End-of-life branches (8.1 and older) are flagged for migration or a vendor backport.

CWE mapping used by the campaign:

CVECWE
CVE-2026-126714 (phpAfterShell)CWE-367, CWE-662
CVE-2026-129289CWE-444, CWE-670
CVE-2026-115560CWE-20, CWE-502
CVE-2026-129474CWE-416
CVE-2026-129496CWE-416, CWE-459
CVE-2026-129182CWE-416
CVE-2026-129481CWE-416, CWE-459

Detection signals the campaign tracks:

SignalWhere
Malformed multipart POST + FPM worker SIGSEGV/SIGABRT in the same windowWeb/FPM logs
Session file holds object notation where the app stores scalarsSession store
Request reaches a script not exposed by front-end routingAccess logs
allow_url_include / auto_prepend_file in effect but never configuredFPM runtime
Child process (sh, curl, wget) spawned by the PHP service accountHost EDR

Find the PHP an attacker can reach before they do. Test it with Phoenix Orange, free.

External References

  1. PHP session-file advisory GHSA-fm2m-fjf5-v3cp (CVE-2026-126714)
  2. PHP-FPM request smuggling advisory GHSA-qc49-hpvq-g2w6 (CVE-2026-129289)
  3. PHP session serializer advisory GHSA-658j-r8rw-q6mx (CVE-2026-115560)
  4. PHP magic-method backtrace advisory GHSA-8mjj-2r7p-4hg2 (CVE-2026-129474)
  5. PHP 8 ChangeLog: fixed releases and GHSA list
  6. CISA adds PHP2Shell CVE-2026-109618 and CVE-2026-109619 to the KEV catalog
  7. The Hacker News: PHP fixes seven critical flaws (November 2026)
  8. W3Techs: PHP usage statistics (November 2026)
Claire brings 15 years of experience in information security, risk management and compliance across highly regulated industries. Having held senior roles at leading consultancies and financial institutions in London and New York, she specialises in building security programmes that align with business objectives. Claire is a regular contributor to industry publications and a mentor for women entering the cybersecurity field.

Discuss this blog with our community on Slack

Join our AppSec Phoenix community on Slack to discuss this blog and other news with our professional security team

From our Blog

NGINX2Root (CVE-2026-123007) lets an unauthenticated attacker run code on NGINX through a crafted HTTP/2 session. Every release from 1.9.5 to 1.31.8 is affected, and about 8.8 million internet services still negotiate HTTP/2. Patching isn’t enough on its own: a config reload leaves the vulnerable binary running.
Marcus Webb
Phoenix Security has joined Anthropic’s Cyber Verification Program and is now an integration partner of OpenAI’s Daybreak Defense Factory. Frontier models made finding vulnerabilities cheap, and fixing is still slow. Phoenix findings arrive in the fix loop deduplicated, reachability-checked, owned and tied to a file and line, so engineers review real fixes.
Ksenia Mityushkina
Java4Shell (CVE-2026-114938) is a heap overflow in OpenJDK’s AVX-512 Base64 decoder, affecting Java 17.0.6 through 27. Calif claims pre-auth RCE in default Keycloak, Jira, Confluence, Jenkins, Artifactory and PingFederate, plus a heap leak. Hardware decides exposure: only x86 servers with AVX-512 VBMI run the vulnerable code.
Marcus Webb
Derek

Derek Fisher

Head of product security at a global fintech

Derek Fisher – Head of product security at a global fintech. Speaker, instructor, and author in application security.

Derek is an award winning author of a children’s book series in cybersecurity as well as the author of “The Application Security Handbook.” He is a university instructor at Temple University where he teaches software development security to undergraduate and graduate students. He is a speaker on topics in the cybersecurity space and has led teams, large and small, at organizations in the healthcare and financial industries. He has built and matured information security teams as well as implemented organizational information security strategies to reduce the organizations risk.

Derek got his start in the hardware engineering space where he learned about designing circuits and building assemblies for commercial and military applications. He later pursued a computer science degree in order to advance a career in software development. This is where Derek was introduced to cybersecurity and soon caught the bug. He found a mentor to help him grow in cybersecurity and then pursued a graduate degree in the subject.

Since then Derek has worked in the product security space as an architect and leader. He has led teams to deliver more secure software in organizations from multiple industries. His focus has been to raise the security awareness of the engineering organization while maintaining a practice of secure code development, delivery, and operations.

In his role, Jeevan handles a range of tasks, from architecting security solutions to collaborating with Engineering Leadership to address security vulnerabilities at scale and embed security into the fabric of the organization.

Jeevan Singh

Jeevan Singh

Founder of Manicode Security

Jeevan Singh is the Director of Security Engineering at Rippling, with a background spanning various Engineering and Security leadership roles over the course of his career. He’s dedicated to the integration of security practices into software development, working to create a security-aware culture within organizations and imparting security best practices to the team.
In his role, Jeevan handles a range of tasks, from architecting security solutions to collaborating with Engineering Leadership to address security vulnerabilities at scale and embed security into the fabric of the organization.

James

James Berthoty

Founder of Latio Tech

James Berthoty has over ten years of experience across product and security domains. He founded Latio Tech to help companies find the right security tools for their needs without vendor bias.

christophe

Christophe Parisel

Senior Cloud Security Architect

Senior Cloud Security Architect

Chris

Chris Romeo

Co-Founder
Security Journey

Chris Romeo is a leading voice and thinker in application security, threat modeling, and security champions and the CEO of Devici and General Partner at Kerr Ventures. Chris hosts the award-winning “Application Security Podcast,” “The Security Table,” and “The Threat Modeling Podcast” and is a highly rated industry speaker and trainer, featured at the RSA Conference, the AppSec Village @ DefCon, OWASP Global AppSec, ISC2 Security Congress, InfoSec World and All Day DevOps. Chris founded Security Journey, a security education company, leading to an exit in 2022. Chris was the Chief Security Advocate at Cisco, spreading security knowledge through education and champion programs. Chris has twenty-six years of security experience, holding positions across the gamut, including application security, security engineering, incident response, and various Executive roles. Chris holds the CISSP and CSSLP certifications.

jim

Jim Manico

Founder of Manicode Security

Jim Manico is the founder of Manicode Security, where he trains software developers on secure coding and security engineering. Jim is also the founder of Brakeman Security, Inc. and an investor/advisor for Signal Sciences. He is the author of Iron-Clad Java: Building Secure Web Applications (McGraw-Hill), a frequent speaker on secure software practices, and a member of the JavaOne Rockstar speaker community. Jim is also a volunteer for and former board member of the OWASP foundation.

Join our Mailing list!

Get all the latest news, exclusive deals, and feature updates.

The IKIGAI concept
Protected By
Shield Security PRO