phpAfterShell: the critical PHP flaw every site owner needs to patch now
What phpAfterShell is and why it matters
On November 19, 2026, security research firm depthfirst disclosed phpAfterShell (CVE-2026-126714), a vulnerability in PHP's default file-based session handler. It scores 9.2 out of 10 (Critical) under CVSS 4.0, making it one of the most severe PHP flaws in recent memory. The root cause is in how PHP writes session data at the end of a request: if that write is interrupted, the session file can end up containing a mix of old and new data. On the next request, PHP deserializes this mixed content. If an attacker managed to place controlled data in the old session, they can force PHP to deserialize arbitrary objects, ultimately leading to remote code execution. The same PHP release batch fixes 16 additional security vulnerabilities, six of which are also rated critical.
Affected PHP versions and available patches
- PHP 8.2 — versions before 8.2.36 are vulnerable; upgrade to 8.2.36
- PHP 8.3 — versions before 8.3.37 are vulnerable; upgrade to 8.3.37
- PHP 8.4 — versions before 8.4.28 are vulnerable; upgrade to 8.4.28
- PHP 8.5 — versions before 8.5.13 are vulnerable; upgrade to 8.5.13
- PHP 8.1 and older are end-of-life and receive no official security patches; migrating to a supported branch is strongly recommended
- Linux distributions such as Ubuntu, Debian, and AlmaLinux often backport fixes without changing the major version number — check your distribution's security advisory, not just the PHP version string
How to check and update PHP on your MioriticHost account
On a shared hosting or managed VPS plan, log into cPanel and open Select PHP Version, or in Plesk go to PHP Settings. Both panels show the active PHP version per domain and let you switch to a newer one in a few clicks. If the version shown is below the patched thresholds listed above, change it immediately. On an unmanaged VPS running Ubuntu or AlmaLinux, run php -v in the terminal to confirm the exact version, then update through your distribution's package manager using apt upgrade php or dnf upgrade php. After the upgrade, restart the PHP-FPM service with systemctl restart php-fpm — this step is mandatory, not optional. Worker processes keep running the old PHP binary until they are restarted, so the patch has no effect until you do this.
Other critical vulnerabilities fixed in the same release
- CVE-2026-129289 (PHP-FPM) — request smuggling: an unauthenticated attacker can inject a second FastCGI request if the front end (nginx with fastcgi_keep_conn, Apache mod_proxy_fcgi with enablereuse=on, or HAProxy) reuses backend connections
- CVE-2026-115560 (session serializer) — object injection through a serializer mismatch; affects applications that use different serializers and share a session store
- CVE-2026-129496 (timezone cache) — use-after-free that can lead to code execution on non-thread-safe builds
- CVE-2026-129474 and CVE-2026-129182 — use-after-free in fatal error backtraces, specific to PHP 8.5 and later
- As of November 19, 2026, none of the 17 vulnerabilities appeared in the CISA Known Exploited Vulnerabilities catalog, but the absence of confirmed exploitation is not a reason to delay patching
What a WAF does and where its limits are
Cloudflare WAF added rules that block known phpAfterShell attack patterns for all customers, including those on the Free plan. The underlying PHP remote code execution rule was first deployed in October 2026 for the php2shell vulnerabilities and was extended on November 19 to cover phpAfterShell. For CVE-2026-129289 (PHP-FPM) and two SOAP extension flaws (CVE-2026-15353 and CVE-2026-129506), three new rules were added to the Cloudflare Managed Ruleset for paid plans, with a default action of Log rather than Block, because the request patterns they match can also appear in legitimate traffic. Key point: a WAF is an additional layer of defense, not a substitute for patching. Several of the critical flaws depend on server configuration or can be reached through paths a WAF never sees. The only complete fix is upgrading PHP and restarting every worker process.
A WAF buys you time while you apply the patch. It does not replace the patch. Upgrading PHP and restarting PHP-FPM are non-negotiable.
Beyond upgrading PHP, review these hardening steps: disable session.upload_progress.enabled in php.ini if your application does not use that feature, since it is one of the two vectors PHP identifies for placing attacker-controlled data into a session. Set zend.exception_ignore_args=1 in php.ini (this is already the default in php.ini-production) to block the demonstrated attack path for CVE-2026-129474. If you run WordPress, update plugins that handle sessions or file uploads, because the deserialization gadget chains needed to weaponize phpAfterShell can come from third-party plugin code. Always take a verified backup before changing your PHP environment, and test your site after restarting PHP-FPM to confirm everything works as expected.
Category: Hosting






