Sulat.com / Writing on AISaturday, November 21, 2026
Cloud Security/21 November 2026

Cloudflare’s WAF blocks phpAfterShell on every plan, Free included, and adds three paid PHP rules

Cloudflare's WAF blocks phpAfterShell, the critical PHP session flaw, on every plan including Free, and adds three Log-mode rules for paid plans. Here's what it covers, what it can't see and what to do.

3D PHP logo under a Cloudflare cloud and glowing shield deflecting a cracked session file

At a glance

  • Cloudflare's WAF blocks phpAfterShell (CVE-2026-126714) by default on every plan, including Free, through an existing PHP remote code execution rule updated on 19 November.
  • Three new Cloudflare Managed Ruleset rules for PHP-FPM (CVE-2026-129289) and two SOAP flaws (CVE-2026-15353, CVE-2026-129506) are on paid plans and start in Log mode.
  • The WAF can't see the deserialisation step inside PHP, session data from other sources, server-state flaws or traffic that skips Cloudflare.
  • The full fix is upgrading to PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0 and restarting every worker.
  • As of 19 November none of the 17 PHP advisories was in CISA's Known Exploited Vulnerabilities catalogue, and Cloudflare expects attempts now that details are public.

Cloudflare’s web application firewall blocks phpAfterShell, the critical flaw in PHP’s default session handler, on every plan, including Free. The rule was already live for the October php2shell bugs, and Cloudflare updated its detection on 19 November, the day depthfirst disclosed phpAfterShell and PHP shipped the fix. Paid plans also get three new rules for other flaws in the same release, but those only log until you switch them to Block.

What Cloudflare’s rule covers

depthfirst disclosed phpAfterShell on 19 November 2026. It is CVE-2026-126714, and PHP’s advisory rates it 9.2 out of 10 on CVSS 4.0. PHP fixed it the same day in 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0. I covered the full release and all eight advisories in my PHP security release report. This piece is about the other half of the story: what Cloudflare’s WAF post says you get while you patch.

The protection comes from a PHP remote code execution rule that Cloudflare first released in an emergency update on 21 October, after the php2shell bugs (CVE-2026-109618 and CVE-2026-109619) were disclosed. It extended the rule to CVE-2026-115560 on 23 October and tuned it several times in the weeks after, partly on reports from researchers who played in a PHP capture-the-flag challenge it ran.

phpAfterShell uses the same trick as php2shell: an attacker plants serialised PHP data in session storage and waits for PHP to deserialise it. Because of that overlap, the existing rule already matched part of the phpAfterShell pattern before anyone disclosed it. On 19 November Cloudflare updated the rule’s detection logic and added the new CVE to its description. The rule is on by default and its default action is Block.

RulesetRule IDDefault action
Cloudflare Free Managed Ruleset (Free plan)19373a83abb840e18ab3ce5a7975ce1bBlock
Cloudflare Managed Ruleset (Pro, Business, Enterprise)4148ae686fdb4d01be673fab9d9c073dBlock
The rule is named “PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619, CVE-2026-115560, CVE-2026-126714) #6”.

Free plan customers don’t need to do anything. On paid plans the rule is active wherever the Cloudflare Managed Ruleset is deployed.

Three new paid rules that only log

The same WAF release adds three rules to the Cloudflare Managed Ruleset, available on Pro, Business and Enterprise. One targets the PHP-FPM request smuggling flaw, CVE-2026-129289. Two target flaws in PHP’s SOAP extension, CVE-2026-15353 and CVE-2026-129506, which PHP fixed in the same releases.

Four Cloudflare PHP rules: phpAfterShell rule blocks on all plans; FPM and two SOAP rules log on paid plans
One rule blocks on every plan. Three paid-plan rules only log until you switch them.

All three start in Log mode. Cloudflare says the request patterns they look for can also appear in legitimate traffic, so blocking by default could break real requests. To switch one over, open Security, Analytics, Events and filter by rule ID to see what matched. If the matches aren’t legitimate traffic, go to Security, Settings, edit the Cloudflare Managed Ruleset, search for the CVE and set the action to Block.

  • PHP-FPM, CVE-2026-129289: rule ID 8ef1c34a424b4ccfa6f6fe186c6f42b2.
  • PHP SOAP, CVE-2026-15353: rule ID 5c5a9d6397e44837a3214b5ba54028d4.
  • PHP SOAP, CVE-2026-129506: rule ID 00a23de67a684876ba67c5d44521b819.

What the WAF can’t see

A WAF only blocks what crosses it as an HTTP request. Cloudflare lists four gaps in its own post:

  • The deserialisation step. phpAfterShell’s last stage happens inside PHP, when it reads a corrupted session file. The WAF can block the requests that plant the payload, not the read.
  • Session data from elsewhere. If an application copies user-controlled data into the session from a database, a queue or an upstream API, it may never cross the WAF in a recognisable form.
  • Flaws that depend on server state. CVE-2026-129496, CVE-2026-129481, CVE-2026-129474 and CVE-2026-129182 depend on error logs, diagnostics and worker lifecycle. They have no dedicated WAF rules, so the patch and configuration changes are the answer.
  • Traffic that skips Cloudflare. That includes service-to-service calls and PHP-FPM listeners exposed straight to a network.
Four-step attack chain: WAF blocks the planting request, cannot see the session read inside PHP
The WAF covers the request that plants the data, not the read inside PHP.

The mechanism is the one depthfirst describes. PHP stores session data in files by default, and a write that gets interrupted can leave the start of the new session joined to the end of the old one. The next session_start() then deserialises that mixed file. PHP’s advisory names two ways an attacker can shape the data: session upload progress, and applications that store large user-controlled strings in the session. PHP also says code execution needs an interruption at a useful point in the write and a suitable gadget chain in the application. depthfirst says it got to code execution without an application gadget by chaining a second, undisclosed memory-corruption bug in a PHP-native class. Cloudflare says the sources it reviewed don’t establish whether that second bug is fixed in the 19 November releases.

Attack score as a second layer

Cloudflare also points to WAF attack score, a machine learning layer that rates each request for attack payloads. Business plans get cf.waf.score.class. Enterprise plans get an overall score, cf.waf.score, plus a remote code execution sub-score, cf.waf.score.rce. Cloudflare doesn’t claim it will spot every serialised object or smuggled FastCGI record on its own. Its argument is that a working exploit chain usually needs more than one request, and the later stages carry shell calls such as /bin/sh -c, system() and eval(), or webshell commands, which the model is trained to score.

Code
# Enterprise: block or challenge low RCE scores
cf.waf.score.rce le 20

# Business: block or challenge anything scored as an attack
cf.waf.score.class eq "attack"

What to do, in order

Checklist: confirm Block rule, switch three Log rules, add attack score rule, upgrade PHP and restart
The WAF steps buy time. Upgrading PHP and restarting workers is the fix.
  1. Check the phpAfterShell rule is on. Free plan: nothing to do. Paid plans: confirm the Cloudflare Managed Ruleset is deployed and the PHP Remote Code Execution Attack #6 rule is set to Block.
  2. Review the three Log-mode rules in Security Events, then switch them to Block.
  3. Add an attack score custom rule using one of the expressions above.
  4. Upgrade PHP to 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0. Rebuild container images, restart the PHP-FPM master or Apache so every worker loads the new binary, and check the version that serves web requests. Afterwards, confirm no php.ini, FPM pool or virtual host still sets session.upload_progress.enabled=1, because an explicit setting overrides the new default.
  5. If you can’t upgrade yet, set session.upload_progress.enabled=0, store less untrusted data in sessions, turn off FastCGI connection reuse, keep PHP-FPM listeners off untrusted networks, and on PHP 8.5 set fatal_error_backtraces=0. Cloudflare says these steps reduce exposure and don’t fix the flaws.

Linux distributions often backport fixes without changing the version number, so check the full package version against your distribution’s advisory. If you run Laravel, I wrote up what the November release means for your app.

Is anyone exploiting it?

As of 19 November, none of the 17 advisories PHP published that day was in CISA’s Known Exploited Vulnerabilities catalogue, and Cloudflare found no source reporting exploitation in the wild. Its Zero Wire briefing carries the same status. Cloudflare still expects attempts now that the technical details are public, and says its analysts will update the rules as new techniques appear.


Discover more from Sulat AI & Tech News

Subscribe to get the latest posts sent to your email.