PHP patches phpAfterShell and six other critical flaws; Cloudflare updates WAF rules

src-28779255

PHP released security updates on November 19, 2026, addressing phpAfterShell (CVE-2026-126714), a critical vulnerability that can lead to remote code execution, along with 16 other security issues. Cloudflare says it updated its web application firewall (WAF) detection for phpAfterShell and added rules for three other PHP flaws. The company describes those rules as an interim defensive layer, not a substitute for updating PHP.

phpAfterShell was disclosed by security research company depthfirst and carries a CVSS 4.0 score of 9.2 out of 10. It affects PHP’s default file-based session handler. PHP fixed the issue in versions 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0. The same releases contain fixes for 16 additional vulnerabilities, including six that PHP rated critical.

How phpAfterShell can lead to code execution

PHP normally reads session data from a file when an application calls session_start(), deserializes it into the session array and writes updated data when the request ends. According to the supplied technical description, phpAfterShell can arise if that write is interrupted, leaving a file with a mixture of new and old session data. On a later request, PHP may deserialize the mixed content, potentially creating objects controlled by an attacker.

Reaching that outcome requires more than sending a request. An attacker would need a way to place controlled data in the session, a useful interruption during the write and, in the described scenario, a suitable deserialization gadget chain in the application. PHP identifies session upload progress and applications that store large user-controlled strings in sessions as possible ways to influence stored data. depthfirst reported achieving code execution by chaining a second, undisclosed memory-corruption bug in a PHP-native class; the available information does not establish whether that separate bug was fixed in the November releases.

As of November 19, none of the 17 vulnerabilities was listed in the U.S. Cybersecurity and Infrastructure Security Agency’s Known Exploited Vulnerabilities catalog, and the reviewed information reported no exploitation in the wild. That status is time-bounded and does not establish that exploitation cannot occur.

Cloudflare’s rule coverage and limitations

Cloudflare says its PHP remote code execution rule, originally deployed in October 2026 for the php2shell vulnerabilities, already matched part of phpAfterShell’s attack pattern. On November 19, the company updated the detection logic to cover CVE-2026-126714. The rule is included in both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset for paid plans, is enabled by default and has a default action of Block.

For Pro, Business and Enterprise customers, Cloudflare also added three rules to its Managed Ruleset: one for the PHP-FPM request-smuggling vulnerability CVE-2026-129289 and two for PHP SOAP flaws, CVE-2026-15353 and CVE-2026-129506. These rules default to Log rather than Block because their matching request patterns may also occur in legitimate traffic. Administrators can review matches in Security Events and, after checking for false positives, change the action to Block.

A WAF can inspect requests that pass through it, but it cannot cover every route to these flaws. For phpAfterShell, the final deserialization takes place inside PHP when it reads a session file; a WAF may block a request used to plant data, but it does not directly inspect that later file read. Session data introduced through a database, queue or upstream API may also evade recognizable HTTP inspection. Traffic that bypasses Cloudflare, including internal service traffic or directly exposed PHP-FPM listeners, is outside its view.

The PHP-FPM and SOAP rules do not address every other critical issue in the releases. Several flaws depend on particular server configurations, diagnostics, error logs or worker lifecycle conditions. Cloudflare says these do not have dedicated WAF rules, making software updates and appropriate configuration changes essential.

Prioritize upgrades and verify runtime coverage

Organizations should identify PHP installations below the fixed versions and upgrade to the applicable release. PHP 8.1 and earlier are end-of-life; Linux distributions may backport fixes without changing the upstream version number, so administrators should consult their distribution’s package advisories. The source also notes that exposure to individual flaws varies with configuration and that PHP-FPM or Apache workers must be restarted to load updated binaries.

Where an immediate upgrade is not possible, the supplied guidance describes interim measures including disabling session upload progress, limiting untrusted data stored in sessions and keeping PHP-FPM listeners off untrusted networks. Such steps reduce exposure but do not fix the vulnerabilities. Teams using Cloudflare should verify that the relevant managed ruleset is deployed, inspect logged matches for the PHP-FPM and SOAP rules, and avoid treating WAF coverage as a replacement for patching.