Web infrastructure running modern PHP 8.2 through 8.5 faces a critical remote code execution ( RCE ) threat following the disclosure of CVE-2026-126714 ( CVSS v4.0 9.2 Critical), dubbed phpAfterShell . Discovered by researchers at depthfirst and patched by the PHP Foundation across coordinated security releases ( 8.2.36 , 8.3.37 , 8.4.28 , 8.5.13 , and 8.6.0 ), the vulnerability strikes at one of PHP's oldest, most ubiquitous defaults: the built-in file-based session handler ( files ) .
Corroborated analyses from Cisco , Cloudflare , F5 , The Hacker News , and SecurityWeek explain that phpAfterShell exploits a subtle race and truncation oversight. Because PHP's default file session handler writes updated session state directly over an existing session file without clearing or truncating it first , an attacker who precisely interrupts a session write—most reliably via PHP's built-in session.upload_progress multipart upload mechanism—can leave behind a "torn" hybrid session file combining a fresh attacker-controlled prefix with the leftover tail of an older session. When PHP subsequently loads that spliced session file, ordinary string data can be misinterpreted as serialized PHP objects, triggering object injection and full remote code execution via application gadget chains.
Verified Scope and Patched PHP Foundation Releases
Corroborated advisories from the PHP Foundation , depthfirst , NIST NVD , Cloudflare , and Cycode detail the exact affected branches and remediated releases:
Why Torn Session Writes Reopen Classic PHP Object Injection
PHP developers have spent years eliminating direct unserialize($_COOKIE[...]) calls from application code. phpAfterShell bypasses that defensive progress by attacking the engine's internal session deserializer itself:
Non-Truncated File Overwrites Create Spliced State: Whenever PHP persists session data using the default files handler, overwriting an existing session file without first truncating or atomically replacing it means an abruptly aborted write leaves stale bytes sitting immediately after the newly written prefix.
Weaponizing Upload Progress Tracking on Multipart Requests: Because PHP's session.upload_progress feature is enabled by default in many distributions and writes attacker-influenced field prefixes directly into session storage during active multipart POST uploads—even before application controller logic finishes—attackers gain a reliable primitive to inject controlled text and abruptly terminate the request mid-write.
Framework Gadget Chains Turn Corruption Into Shells: Large modern PHP ecosystems ( Laravel , Symfony , WordPress plugins, Magento , Drupal ) routinely load rich Composer dependency trees containing well-known POP ( Property-Oriented Programming ) gadget chains. Once a torn session file tricks PHP's session loader into deserializing a crafted object boundary, arbitrary command execution follows under the PHP-FPM or Apache worker account.
Auditing PHP Runtimes, Session Handlers, and Applying Immediate Mitigations
Linux web administrators and DevSecOps engineers should immediately verify installed PHP versions, active session.save_handler settings, and session.upload_progress.enabled directives across all web servers and container images:
Every team operating vulnerable PHP 8.2 – 8.5 deployments should execute three layered actions:
Upgrade PHP and Restart Worker Pools Immediately: Patch all servers and container base images to PHP 8.2.36 , 8.3.37 , 8.4.28 , 8.5.13 , or 8.6.0 (or distro-backported security builds) and restart php-fpm or Apache mod_php workers so the patched binary actually serves live requests.
Disable Upload Progress Tracking Immediately If Patching Is Delayed: Set session.upload_progress.enabled = 0 in php.ini (and reload php-fpm ) as an immediate stopgap to close the primary multipart upload vector identified by researchers—remembering this is a partial mitigation and full PHP upgrades remain mandatory.
Audit Session Storage Backends and Composer Dependencies: Where high-concurrency clusters migrate sessions off local flat files onto Redis or Memcached , verify how the chosen session handler processes atomic writes and expirations, and routinely strip unused Composer packages to shrink available deserialization gadget surfaces.
phpAfterShell ( CVE-2026-126714 , CVSS 9.2 ) demonstrates how a subtle non-truncated write flaw inside PHP's default file-based session handler can resurrect full deserialization RCE across modern PHP 8.2 – 8.5 web stacks. Upgrade immediately to PHP 8.2.36 , 8.3.37 , 8.4.28 , 8.5.13 , or 8.6.0 , restart all PHP-FPM workers, and set session.upload_progress.enabled = 0 immediately on any host awaiting maintenance windows.
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.
