Advisories - Unauthenticated Remote Code Execution in PHP's Default File
php, phpaftershell, cve-2026-126714, session, file-based session, upload progress, rfc1867, remote code execution, rce, pre-authentication, unauthenticated, object injection, deserialization, php2shell, depthfirst, fpm, fastcgi, request smuggling, use-after-free, patch, restart, cybersecurity malaysia, mycert
On 19 November 2026 the PHP Group released five coordinated builds (8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0) closing 17 security advisories, seven of them rated critical at CVSS v4.0 9.2. The headline flaw, dubbed phpAfterShell (CVE-2026-126714), sits in PHP's default file-based session handler and allows a remote, unauthenticated attacker to corrupt a session file on disk so that a later session_start() deserialises attacker-chosen objects. Chained with a memory-corruption bug in a PHP-native class, that object-injection primitive becomes remote code execution in the web worker (typically www-data).
The flaw is in PHP itself, not in any application or framework: any PHP stack that keeps sessions in files (the PHP default) is in scope until PHP is upgraded. phpAfterShell is a direct descendant of PHP2Shell, the October 2026 flaw MyCERT addressed (CVE-2026-109618/109619, still listed in the CISA KEV catalog). The PHP2Shell patch restricted which objects could be created during the upload-progress callback, but it left the underlying session-file write behaviour untouched. depthfirst found that an interrupted pwrite() + ftruncate() update can leave the prefix of the new session spliced onto the tail of the old one, and that by manipulating serialised length fields the leftover bytes re-parse as live session entries, including objects.
The urgency driver: servers patched on 21 October 2026 for PHP2Shell are still vulnerable to phpAfterShell. As at 21 November 2026 there are no reports of in-the-wild exploitation and none of the seven critical CVEs is in CISA KEV, but a complete public exploitation chain (session splice, object injection, native memory-corruption, RCE) is described by the discoverer with a full-chain demonstration, and MyCERT re-triaged its national PHP estate from the October PHP2Shell mass-scan and found a material number of hosts still on affected or end-of-life versions. PHP powers roughly 68% of websites with a known server-side language (W3Techs), so MyCERT rates this a patch-now event for every organisation running PHP.
2.0 Vulnerability Details
2.1 Attack surface: PHP writes your session before your script runs
2.2 Root cause: the session file is parser input, and the write is not atomic
The files handler does not atomically replace the session file. It writes the new serialised stream onto the existing inode with pwrite() and shrinks it with ftruncate(). PHP holds an exclusive flock() while a worker owns the session, which stops cooperating writers racing, but it does not roll back bytes: if the worker disappears mid-update (crash, OOM, fatal error, request-timeout kill), the kernel releases the lock and leaves whatever the partial write produced. The file can then contain the beginning of the new session followed by the tail of the old one. Nothing is deserialised during the upload-progress callback (that was the PHP2Shell patch); the payload waits on disk until the application calls session_start(), at which point PHP reads the spliced file as legitimate server-side state and instantiates the attacker's objects.
Session integrity loss (crafted $_SESSION) is the baseline outcome. Object injection to RCE requires a suitable gadget chain in loaded application code, or, as depthfirst demonstrated, a second memory-corruption bug in a PHP-native class that removes the application-gadget prerequisite. The disclosed chain leaks the libphp base via an SplMaxHeap + exception-trace native leak, then lands a second splice onto a destructor path to reach RCE as the web worker. The discoverer holds the final decoder and heap-layout details for coordinated disclosure; a public exploit release is expected once operators have patched.
2.3 Sibling critical flaws in the same 19 November release
The other six 9.2 flaws (PHP Group, via NVD; affected ranges per the vendor advisory):
Four of the seven are session-handling flaws and two (129481, 129182) explicitly close gaps left by the PHP2Shell fix: the PHP session subsystem is under concentrated research and is likely to yield further findings. Treat it as a priority monitoring area. The remaining 11 advisories in the release (4 high, 6 medium) plus a third-party uriparser bump are fixed by the same upgrade; the high items include CVE-2026-129291 (FPM epoll UAF, local privilege escalation, 8.8) and CVE-2026-128064 (mixed-case HTTPS/FTPS URLs exposing data in plaintext, 8.2).
2.4 What the public evidence does and does not establish
3.0 Exploitation Status
Vendor: PHP Group out-of-band 19 November 2026, five coordinated builds, 17 security advisories (7 critical / 4 high / 6 medium).
CISA KEV: none of the seven critical CVEs is listed (catalog 2026.11.20, 1,790 entries). The October PHP2Shell CVEs (CVE-2026-109618/109619) remain in KEV (added 26 October 2026, due 29 October 2026), indicating the code path was already shown exploitable.
Researcher: depthfirst published the full root-cause analysis and a full-chain demonstration on 19 November 2026, holding the final exploit steps until operators patch. CVE-2026-126714 credits Leo Lin and Asahi; the technical write-up is by Yuhang Wu; the flaw was found by depthfirst's frontier AI models working with its researchers and reported privately in late October 2026.
Detection: semgrep published a public exposure-detection rule for the 19 November release (semgrep/detection-scripts PR #14).
National agencies: as at 21 November 2026 no CISA alert and no national CERT advisory specific to phpAfterShell was identified in the sources reviewed.
No phpAfterShell-specific C2 infrastructure has been publicly identified. Because the known chain needs a write interrupted at a useful point, expect initial in-the-wild use to target high-traffic, directly-exposed PHP endpoints (and FastCGI-front-ended deployments, via CVE-2026-129289) once the exploit ships.
4.0 Affected Products and Fixed Versions
Two operational notes: (1) after upgrading, restart the PHP-FPM master / web server so all workers load the new binary, and verify the version actually serving traffic, not the package list; (2) do not rely on the PHP banner alone, distributions backport fixes while keeping the version string, so compare the full package version against the distribution advisory.
How to check exposure: - The running PHP version per process and the full package version: php -v plus your package manager (distributions backport without changing the version string). - The session handler: php -i | grep session.save_handler (files is the default and is in scope). - Upload progress: php -i | grep session.upload_progress.enabled (1 means on; note the 19 November builds now ship this as 0 by default, but an explicit =1 re-enables it). - FastCGI connection reuse (CVE-2026-129289): grep -E 'fastcgi_keep_conn|enablereuse' across your nginx/Apache/HAProxy configuration.
5.0 MITRE ATT&CK Techniques (Enterprise)
6.1 For organisations
Immediate (0–48 hours): 1. Upgrade every PHP runtime serving web requests to 8.2.36 / 8.3.37 / 8.4.28 / 8.5.13 or 8.6.0. Rebuild container images; restart the PHP-FPM master / Apache so all workers load the new binary; then verify the version actually serving traffic, not the package list. 2. Do not treat the October PHP2Shell patch as coverage: re-verify hosts that adopted the 21 October releases (8.2.35 / 8.3.36 / 8.4.27 / 8.5.12); they are in the phpAfterShell affected range today. 3. Inventory per runtime: PHP version, thread safety, server API (FPM / mod_php / CGI / LSAPI), session.save_handler, session.upload_progress.enabled, session.serialize_handler consistency across every reader/writer of a shared session store, and whether the front end reuses FastCGI connections. Distribution packages: match the full package version against the distribution advisory, not the PHP banner. 4. Move PHP 7.4 / 8.0 / 8.1 hosts onto a supported branch; these get no phpAfterShell fix (only the EOL mitigation-branch behaviour) and remain exposed to the sibling CVEs.
If you cannot upgrade immediately (risk reduction only): 5. Set session.upload_progress.enabled=0 in every configuration that writes to the affected session store (php.ini, FPM pool, per-pool php_value); ini_set() from the application is too late. This removes the upload-progress input path for CVE-2026-126714 and CVE-2026-115560, not the underlying flaw. 6. Ensure every reader and writer of a shared session store uses the same session.serialize_handler (CVE-2026-115560). 7. Turn off FastCGI backend connection reuse (fastcgi_keep_conn / enablereuse) until patched (CVE-2026-129289); keep FPM and LSAPI listeners off untrusted networks. 8. On PHP 8.5: keep fatal_error_backtraces=0 and zend.exception_ignore_args=1, and make sure request-level config cannot re-enable backtraces (CVE-2026-129474). Eliminate startup diagnostics or send PHP errors to syslog instead of a file (CVE-2026-129496). 9. After upgrading, re-audit for explicit session.upload_progress.enabled=1 overrides: an explicit 1 re-enables the feature that the new builds otherwise default off.
This week: 10. Hunt for session-file anomalies: sess_* files whose contents mix serialised generations (old keys surviving after a known write, unexpected O: object productions inside string values, size oscillation), especially to workers that crash or OOM during multipart requests. 11. In web-server logs, flag multipart/form-data POSTs carrying PHP_SESSION_UPLOAD_PROGRESS against URLs that are not upload functions, and PHPSESSID values that reuse old session ids after worker restarts. 12. Correlate PHP worker crashes / fatal restarts (FPM slowlog, syslog, OOM killer) with preceding large multipart bodies; investigate unexplained www-data child processes, new files under web roots, or outbound connections from PHP workers. 13. For hosts already confirmed hit during the October PHP2Shell wave (worker crashes and the direct RCE candidates), re-baseline now against phpAfterShell: same subsystem, same researchers, now one patch behind again. Deploy the public semgrep exposure rule to confirm the vulnerable build is live on staging before trusting the "upload progress off" state in production.
Ongoing: 14. Watch for a public exploit release and CISA KEV listing; the researchers hold their final steps until operators patch, so the window for in-the-wild use opens when that ships. Re-rate internet-facing, directly-exposed PHP endpoints as actively exploitable at that point. 15. Add the seven critical CVEs (and the four high) to vulnerability-management baselines. Treat the PHP session subsystem as a priority monitoring area given the concentration of findings in one release.
6.2 For users of affected products
If you run a PHP web application, or a product that bundles PHP with file-based sessions (for example a -lab CMS, API or containerised service): identify the exact PHP version and session.save_handler (Section 4.0), confirm whether your front end reuses FastCGI connections, and apply the vendor's patched build. Where you cannot patch immediately, set session.upload_progress.enabled=0 and turn off FastCGI connection reuse as interim mitigations. Report any suspected compromise to MyCERT (Cyber999).
Generally, MyCERT advises the users of this devices to be updated with the latest security announcements by the vendor and follow best practice security policies to determine which updates should be applied.
For further enquiries, please MyCERT through the following channels:
E-mail: cyber999[at]cybersecurity.my Phone: 1-300-88-2999 (monitored during business hours) Mobile: +60 19 2665850 (24x7 call incident reporting) Business Hours: Mon - Fri 09:00 - 18:00 MYT Web: Twitter: :
PHP Group, GHSA-fm2m-fjf5-v3cp / CVE-2026-126714 (partially overwritten session files can lead to RCE):
PHP Group security advisories index (the seven critical GHSAs: fm2m-fjf5-v3cp, qc49-hpvq-g2w6, 658j-r8rw-q6mx, gr4f-wgx5-jpfv, g3vh-838c-65v7, 8mjj-2r7p-4hg2, 2fjv-p558-g82m): NIST NVD, CVE-2026-126714 (CVSS v4.0 9.2, PHP Group via NVD; CWE-367; affected ranges; published 19 Nov 2026):
MITRE CVE Record, CVE-2026-126714 (credits Leo Lin and Asahi; CWE-367 + CWE-662): depthfirst, "phpAfterShell: From Interrupted Session Writes to Remote Code Execution" (Y. Wu, 19 Nov 2026; full RCA, version-range table, EOL-mitigation-branch note, full-chain demonstration): ; overview and credits:
Red Hat, security bulletin RHSB-2026-020, "Multiple vulnerabilities - PHP" (Critical; RHEL 7/8/9/10; fixes expediting; status Ongoing, 19 Nov 2026):
PHP 8 ChangeLog (19 Nov 2026, 8.2.36 / 8.5.13 security entries) and release announcements: ;
Ubuntu, CVE-2026-126714 notice (assessed, priority Medium; no USN as at 21 Nov 2026): semgrep, "phpAftershell: PHP 2026-11-19 critical-release exposure detection" (public exposure rule, PR #14): CISA Known Exploited Vulnerabilities catalog (checked 21 Nov 2026: 0 of the 7 critical listed; CVE-2026-109618/109619 still listed):
W3Techs, "Usage Statistics and Market of PHP for Websites" (PHP 68.0% of websites with a known server-side language, Nov 2026):
MyCERT, October 2026 PHP2Shell advisory (CVE-2026-109618/109619; the patched-in-October flaw that phpAfterShell survives):
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
