phpAfterShell Explained: How Hackers Could Turn a PHP Session Flaw Into Code Execution
PHP CVE-2026-126714 (phpAfterShell) allows remote code execution via session flaw and gadget chains.
PHP's default file-based session storage is vulnerable to object injection when a session write is interrupted at the right moment (CVE-2026-126714, CVSS 9.2). When combined with a suitable gadget chain in the application, attackers can achieve remote code execution. Patches are available: PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, and 8.6.0, with mitigation options including disabling upload progress and switching to alternative session stores.
AI summary of the linked source. Not reviewed by an editor. How this works
Run PHP Group?
Get an email when a new story names PHP Group, usually within the hour.
Free. Your list stays private and never appears in a subject line. One click stops it. How Vendor Watch worksPrivacy
The lesson from this incident
Full lessonA critical flaw (CVE-2026-126714, CVSS 9.2) in PHP's default file-based session storage allows attackers to inject malicious objects by interrupting a session write at precisely the right moment, which — when a usable gadget chain exists in the application — leads to remote code execution. The vulnerability is worsened by PHP's default configuration enabling upload progress tracking, which creates the write-interrupt window that attackers exploit. Patches are available across all supported PHP branches, and interim mitigations (disabling upload progress, switching session handlers) can close the attack surface without upgrading. This incident illustrates how insecure defaults compounded with delayed patching can elevate a subtle language-level quirk into a full system compromise.
What helps against this
How we list vendors- Vulnerability scanning and prioritisation
You know which systems are vulnerable, and which ones to fix first.
- Automated patch management
Known holes get closed in days, not months.
- Endpoint detection and response (EDR and XDR)
Malware and hands-on-keyboard attackers on laptops and servers get spotted and stopped.
Indicators of Compromise
Addresses and file hashes are copied from the publisher's page by pattern matching. Names are picked by AI. On stories from before 17 November 2026, some addresses and hashes were picked by AI too. Not reviewed by an editor. How this works
- cve: CVE-2026-126714