New phpAfterShell Attack Bypasses PHP2Shell Fix to Enable Remote Code Execution
What happened?
A new PHP attack dubbed phpAfterShell can lead to unauthenticated remote code execution on vulnerable servers, even if they have the October patches for PHP2Shell. Researchers at depthfirst disclosed the flaw on November 19 and demonstrated how it could be combined with a separate bug in PHP to run code remotely. The vulnerability, tracked as CVE-2026-126714, has a CVSS v4.0 score of 9.2. The flaw sits in PHP’s default file-based session handler. Sessions let web applications remember a user’s login status, shopping cart, or other details between requests.
Key details
- A new PHP attack called phpAfterShell enables unauthenticated remote code execution despite October PHP2Shell patches.
- The vulnerability resides in PHP's default file-based session handler during upload progress processing.
- Interrupted session writes can leave corrupted files that PHP later accepts as valid during session_start().
- Researchers combined the session flaw with a memory corruption bug in a built-in PHP class to achieve code execution.
- Code executes with PHP worker permissions, potentially exposing credentials, application files, and customer records.
- Applications using Redis or database session storage are not affected by this specific vulnerability.
- The October PHP2Shell patches do not address the interrupted write scenario exploited by phpAfterShell.
What is affected?
- PHP versions using default file-based session handler with upload progress enabled.
How do I fix or mitigate it?
- Verify the patched version is serving web requests, not just the command-line binary.
- Check Linux distribution advisories for patched packages since version numbers may differ from upstream.
Summarised by SecOraLens from Cyber Security News. Always read the original source before acting. How SecOraLens verifies advisories.
What to do next
Brief your board. Brief your team.
Executive risk briefs for governance, technical kill-chains for the SOC — delivered as advisories publish. Critical alerts within 1 hour. No spam, unsubscribe anytime.
