Skip to content
INTERNET INFRASTRUCTURE & NETWORKS

Critical PHP Vulnerability "phpAfterShell" Disclosed Alongside Six Other Critical Flaws Prompting Emergency Patches and WAF Updates

On November 19, 2026, security research firm depthfirst disclosed a critical remote code execution vulnerability affecting PHP’s default file-based session handler. Tracked as CVE-2026-126714 and dubbed "phpAfterShell," the flaw has been assigned a critical Common Vulnerability Scoring System (CVSS) score of 9.2 out of 10. The discovery arrived alongside a sweeping security advisory from the PHP project, which rolled out emergency patches across multiple active branches to address a total of 17 security vulnerabilities, six of which are also rated critical.

Major web infrastructure and security providers, including Cloudflare, moved quickly to implement defensive measures, releasing specialized web application firewall (WAF) rules to shield vulnerable deployments while administrators work to apply upstream patches. Despite the severity of the flaws and the public disclosure of technical details, threat intelligence sources indicate that there is currently no evidence of these vulnerabilities being actively exploited in the wild. As of November 19, 2026, none of the 17 patched CVEs appeared in the Cybersecurity and Infrastructure Security Agency’s (CISA) Known Exploited Vulnerabilities catalog.

What we know about phpAfterShell

The mechanics of phpAfterShell stem from how PHP natively handles user sessions. By default, PHP stores session data within local server files. When a web application invokes the session_start() function, PHP reads the corresponding session file and deserializes its contents directly into the $_SESSION array. Once the HTTP request concludes and execution terminates, PHP writes the updated session state back to that same file.

The vulnerability is triggered when the file-writing process is abruptly interrupted. Under such conditions, the session file can become corrupted, retaining the beginning of the newly generated session data followed by the trailing end of the previous session data. During the subsequent request, when session_start() is called, PHP attempts to deserialize this spliced and mixed content. If a malicious actor managed to inject and control the old data within the file, PHP can inadvertently end up deserializing arbitrary objects of the attacker’s choosing, ultimately leading to remote code execution.

To successfully exploit this mechanism, an attacker must first establish a method to place controlled, serialized data into the session store. According to advisories published by the PHP project, there are known vectors for achieving this injection. Furthermore, achieving full remote code execution typically requires both an interruption at an opportune point during the file write cycle and the presence of a suitable deserialization gadget chain within the target application. However, depthfirst reported that its researchers successfully achieved code execution without relying on a pre-existing application gadget chain. Instead, they bypassed this requirement by chaining a secondary, undisclosed memory-corruption bug located within a native PHP class. The official disclosures reviewed do not explicitly confirm whether this secondary memory-corruption issue was addressed in the November 19 patch releases. The initial discovery and reporting of phpAfterShell are credited to researchers Leo Lin and Asahi.

The other critical flaws addressed in the update

In addition to phpAfterShell, the emergency November 19 releases patched six other critical vulnerabilities, each of which depends on specific environment conditions or configurations to be successfully exploited.

One of the prominent issues is CVE-2026-129289, an unauthenticated request smuggling vulnerability found in PHP-FPM. This flaw allows an attacker to smuggle a secondary FastCGI request directly into PHP-FPM, executing arbitrary PHP code under the privileges of the worker process. Exploitation requires specific conditions, including a front-end server that reuses backend FastCGI connections—such as Nginx configured with fastcgi_keep_conn on, Apache utilizing mod_proxy_fcgi with enablereuse=on, or HAProxy—combined with an application path that opens php://input without reading it to completion alongside the path of a valid, existing PHP script.

Another significant issue, tracked as CVE-2026-115560, involves object injection caused by a mismatch between session serializers. This vulnerability expands upon scope issues previously identified during the disclosure of earlier session-related flaws, affecting applications, worker pools, or command-line jobs that utilize different serializers while sharing a common session storage backend, particularly when session upload progress is enabled.

Other critical patches address severe memory management flaws. CVE-2026-129496 is a use-after-free vulnerability within the PHP timezone cache that can cause a fresh worker process to crash and potentially achieve code execution under specific non-thread-safe builds where startup diagnostics have been written to a local PHP error log file. CVE-2026-129481 represents another use-after-free condition located in the session shutdown sequence affecting PHP 8.3 and later versions, described by developers as an incomplete fix for a prior advisory.

Finally, a pair of vulnerabilities—CVE-2026-129474 and CVE-2026-129182—involve use-after-free conditions tied to fatal error backtraces. CVE-2026-129474 affects PHP 8.5 and later where fatal error backtraces are enabled by default, though default production configurations like zend.exception_ignore_args=1 successfully block the demonstrated attack vectors. CVE-2026-129182 similarly affects specific path-level settings in PHP 8.5 when paired with Apache per-directory configurations or front ends that generate early diagnostics.

The vulnerable software versions include PHP 8.2 prior to version 8.2.36, PHP 8.3 prior to 8.3.37, PHP 8.4 prior to 8.4.28, PHP 8.5 prior to 8.5.13, and release candidates for PHP 8.6.0. Older versions, including PHP 8.1 and earlier, have reached end-of-life status. While official end-of-life mitigation branches for older versions are reportedly unaffected by phpAfterShell, the PHP project noted that vulnerabilities like the PHP-FPM request smuggling flaw trace their origins back to version 5.6.0, indicating that legacy installations may still carry underlying risks. Administrators relying on Linux distributions must also verify package versions against vendor-specific advisories, as maintainers frequently backport security fixes without incrementing the primary PHP version string.

Cloudflare WAF protections and defense-in-depth

Because PHP powers a massive portion of the modern web—frequently embedded within content management systems, third-party plugins, and container images that organizations cannot always update immediately—deploying runtime patches requires careful planning and time. Web application firewalls serve as an essential compensating control to minimize exposure during this window.

Cloudflare announced that its web application firewall automatically blocks known phpAfterShell attack patterns for all customers, including those on Free tier plans. This protection is driven by an existing PHP remote code execution rule originally deployed in October 2026 to counter earlier session vulnerabilities. Because phpAfterShell shares overlapping attack techniques with those earlier flaws, the rule already matched components of the phpAfterShell attack pattern prior to its public disclosure. Cloudflare updated the detection logic on November 19 to explicitly cover CVE-2026-126714 across both the Free Managed Ruleset and the Cloudflare Managed Ruleset, with a default action of blocking matching traffic.

For paid subscribers utilizing Pro, Business, and Enterprise tiers, Cloudflare introduced three additional managed rules targeting the PHP-FPM request smuggling flaw (CVE-2026-129289) and two SOAP extension vulnerabilities (CVE-2026-15353 and CVE-2026-129506). Because the specific request patterns associated with these flaws can occasionally appear within legitimate web traffic, these new rules were deployed with a default "Log" action to prevent operational disruption. Customers are advised to inspect security analytics dashboards to review matching events and manually transition the action to "Block" once they verify that normal application traffic remains unaffected.

Security analysts emphasize that a WAF represents an auxiliary defense layer rather than a permanent substitute for patching. Certain vectors associated with these critical flaws depend heavily on localized server configurations or internal request paths that bypass perimeter visibility entirely. Consequently, the only comprehensive remediation is to upgrade PHP runtimes and restart all associated worker processes.

Update every PHP runtime now

The disclosure of phpAfterShell underscores the risks inherent in complex session handling mechanisms, particularly when combined with memory management flaws in widely deployed interpreters. With technical details now fully accessible to the public, security teams anticipate that automated scanning and targeted exploit attempts will follow. While perimeter defenses like Cloudflare’s WAF provide immediate mitigation by blocking known attack patterns, the definitive solution remains updating PHP packages to the latest patched versions and restarting dependent services across all production environments.