Brand logo
HomeCloud ComputingSecuritySoftware DevelopmentAI ApplicationsStartupsGeneralAbout Us
  1. Home
  2. /
  3. security
  4. /
  5. cloudflare-waf-php2shell-protection

ItInsightsWorld Security Field Guide: php2shell Patch Steps, Cloudflare WAF Rule IDs and the Restart Pitfall

If you serve HTTP with PHP, the answer is direct: upgrade the runtime to a fixed release, restart every PHP worker, then verify both the CLI and the web SAPI before you treat the incident as closed. Treat the Cloudflare WAF as time you buy, not the fix itself. Almost every rollout I have reviewed stumbled on the same step — the upgrade succeeded, the restart did not happen.

Consider a representative failure scene: an operator upgrades PHP, runs php -v, sees the new version, closes the ticket. The web SAPI never restarts, PHP-FPM keeps the old binary in memory, and the public endpoint stays exposed. That single gap is why I lead with restart-and-verify rather than with patching alone.

What actually broke inside PHP?

Conclusion first: the defect is in the PHP runtime's memory handling, not in your application code or a plugin. Two flaws, CVE-2026-109618 and CVE-2026-109619, let an unauthenticated attacker who sends crafted HTTP traffic cause denial of service, remote code execution, or data disclosure.

PHP allocates memory for request data and frees it when the request ends. If processing is interrupted — for example by memory exhaustion — cleanup can fail. PHP then touches data that was never fully initialized, or memory already released. Large requests are one way to apply pressure, but the impact goes beyond resource consumption: by shaping what sits in that invalid memory, an attacker can crash the process, leak sensitive data, or run supplied code.

The two CVEs differ only in when the unsafe access happens:

VulnerabilityWhat goes wrong
CVE-2026-109618PHP runs out of memory and interrupts processing before some internal request data is initialized. During cleanup, PHP may treat that unfinished data as valid.
CVE-2026-109619A fatal error interrupts the request, leaving PHP holding a reference to memory freed at request end. The next request on the same process can reuse the stale reference and leak data.

Scale matters here. almost 70% of websites run PHP, and platforms such as WordPress and Magento are built on it. Because the bug lives in the runtime, updating a theme or a single plugin does nothing; the PHP software itself has to change.

When did protection actually go live?

Conclusion: the defensive window opened before the public disclosure, but attackers were already probing. On October 21, Calif.io, Wiz, OpenAI and Quarkslab disclosed the two flaws, collectively called php2shell. Every web server running PHP 5.4 or later is affected.

Cloudflare began building and deploying WAF protections from early October 2026, working with PHP foundation, OpenAI and Wiz. Deployment landed about 9 hours ahead of public disclosure; from October 21 3:02 am UTC, free and paid WAF customers were covered by default. Even after the details leaked before the official date, multiple mitigation layers were in place and attack traffic against customers was observed. Rule-match volume kept shifting as attackers changed payloads to evade detection.

That pre-disclosure activity is not theoretical. Amazon Threat Intelligence reported a PHP2Shell exploitation attempt in its MadPot telemetry dated October 17 — four days before public disclosure. If you only started watching logs on October 21, your earliest evidence is already four days late. (Source: AWS Security Blog.)

Why weren't request-side WAF rules alone enough?

Conclusion: request data alone often lacks the evidence to separate an exploit from normal traffic, so response-side context was added. That is the reasoning behind full transaction detection, a new WAF capability that correlates signals from both ends of the same HTTP transaction.

Response rules can then block a matching origin response before it reaches the requester. php2shell was the first set of managed detections built on this capability. The practical benefit is fewer false positives: a suspicious request that produces a clean response is treated differently from one that produces a leaked-data response. The mechanics are documented in the Cloudflare full transaction detection post.

The new Cloudflare Managed Response Firewall Default has been auto-deployed for all plans, including Free. To confirm the response rules are live, check Security > Security Rules.

The screen shows Cloudflare Managed Response Firewall Default detecting traffic, with events and customization controls available.

What did the October 23 follow-up change?

Conclusion: a related flaw was flagged, but the existing rule set already covers known attempts. On October 23 the PHP project issued an informational advisory about CVE-2026-115560 in the session upload progress feature. Even fully patched versions, including 8.5.12, are affected; the fix is scheduled for the next regular PHP release.

All Cloudflare WAF customers are protected against known exploit attempts provided the site keeps PHP's default upload progress field name. If you changed session.upload_progress.name, you are outside that rule's coverage. The rule that carries this protection is PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #6.

Which fixed versions and deadlines apply?

Conclusion: move to a fixed release now; this is in the CISA Known Exploited Vulnerabilities catalog. CISA directed organizations to "immediately update to PHP 8.5.12, 8.4.27, 8.3.36, or 8.2.35" and to prioritize internet-facing systems, after adding CVE-2026-109618 and CVE-2026-109619 to the KEV catalog. (Source: CISA alert.) Federal civilian agencies face a remediation date of October 29, 2026 under BOD 22-01; private organizations should treat that as a benchmark, not a grace period.

Distributions may backport fixes without moving the version banner, so verify against your package changelog rather than trusting the string alone.

What is the landing sequence?

Conclusion: patch, restart, verify, and keep the WAF on. Work in this order:

  1. Inventory every host and container that runs PHP, including embedded copies inside other software; prevalence is often not obvious.
  2. Upgrade to a fixed release (8.5.12 or the appropriate backport) or ask your hosting provider to apply the security update.
  3. Restart every PHP worker — PHP-FPM pools, Apache with mod_php, LiteSpeed, and long-running workers all hold the old code in memory until restarted. For containers, rebuild on a fixed PHP base image and redeploy.
  4. Verify both entry points: php -v for the CLI and php-fpm -v (or the web SAPI equivalent) for what the server actually runs. Confirm the CVE fix in the package changelog.
  5. Keep WAF protection enabled and review events for matched rule IDs.

Which WAF rules should I verify?

Conclusion: check that the managed rules are deployed in block mode and that response rules are active. Free plans receive protection through Cloudflare Managed Free Ruleset (Ruleset ID 77454fe2d30c4220b5701f6fdfb893ba). No action is required to enable it; to override default behavior, consult the WAF documentation.

Rule DescriptionRule ID
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619)4e315666e8e344cdb64119a3b5ccf32f
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #200c10e6cc4da4bd08722adeebcd95984
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #348ddf592361e4fdb97a8a85982dab691
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #43556683d512a47f2937899c524b1a4c6
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #5da07c85852e34625bb478496302ede46
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #619373a83abb840e18ab3ce5a7975ce1b
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #707f0b6ddaabf40b1b2042dade8d613fa

Paid plans receive protection through Cloudflare Managed Ruleset (Ruleset ID efb7b8c949ac4650a09736fc376e9aee). Professional, Business and Enterprise customers should confirm the ruleset is deployed in block mode.

Rule DescriptionRule ID
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619)c1d409ad838f47f59446f21cc438d5dd
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #2f9a45927414245e3a64bb12d0a0c2f64
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #3771c654ae1154d4daa72f4e1545d163c
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #4217005865f0145f392300bac212afcc9
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #538efdb17ea594501bb55a1d71867b12e
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #64148ae686fdb4d01be673fab9d9c073d
PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #71389aa259617437392ce149c48143645

To analyze blocked requests, go to Security > Security Analytics > Events, filter by the rule IDs above, and inspect matched requests, actions and paths. Events indicate whether the action came from a managed or a custom rule. If you need a narrower scope, update the managed ruleset's scope to the relevant parts of your application. As new techniques appear, rules are revised — track them in the changelog.

Which mistakes keep repeating?

Conclusion: three assumptions cause most repeat exposure.

  • "I set session.upload_progress.enabled=0, so I am safe." It is only a partial mitigation: it blocks one path of the second flaw and does nothing for the first. PHP's own advisory notes other routes to the vulnerability. Use it as a stopgap, never as the fix. (Sources: Datadog Security Labs, Sansec.)
  • "I renamed the upload progress field to confuse attackers." Changing session.upload_progress.name puts you outside the WAF rule's coverage rather than adding protection.
  • "The version banner shows the new release, so the host is clean." The CLI and the web SAPI can differ, and workers keep old code in memory until restarted.

Limiting unnecessary uploads and capping upload size reduce the attack surface, but neither substitutes for patching the PHP runtime.

FAQ

Does a WAF remove the need to patch?

No. It is defense in depth and a way to buy time while you upgrade. Because the flaw is in the PHP runtime, the runtime itself must be updated; application-code changes do not help.

Are all PHP versions affected?

Every web server running PHP 5.4 or later is in scope. Even fully patched builds such as 8.5.12 are affected by the related issue CVE-2026-115560, which is fixed in the next regular release.

How quickly do I need to act?

Immediately. The KEV listing and the October 17 exploitation telemetry mean exploitation predates public awareness. Prioritize internet-facing systems first.

Do I need to change anything on the Free plan?

No. Free customers are covered by default through Cloudflare Managed Free Ruleset and the Cloudflare Managed Response Firewall Default; you only need to verify in Security > Security Rules and watch Events.

Reusable response checklist

Keep this beside your incident ticket:

  • Inventory all PHP runtime instances, including embedded and containerized copies.
  • Upgrade to a fixed release or confirmed distribution backport.
  • Restart PHP-FPM, Apache/mod_php, LiteSpeed and long-running workers; rebuild containers.
  • Verify CLI and web SAPI versions, plus the package changelog for CVE-2026-109618 and CVE-2026-109619.
  • Confirm managed rules are in block mode and response rules are active.
  • Filter Security Events by the rule IDs above; look back to October 17, not October 21.
  • Keep upload limits tight as a secondary control, not a primary fix.
  • Schedule the next maintenance window for the CVE-2026-115560 fix when the PHP project ships it.

References

  • CISA — Critical Vulnerabilities in PHP Require Immediate Patching
  • AWS Security Blog — PHP2Shell exploitation prior to public disclosure
  • Cloudflare — Introducing full transaction detection for Cloudflare WAF
  • Cloudflare — Protections against php2shell
  • Datadog Security Labs — PHP2Shell critical vulnerabilities
  • ProjectDiscovery — finding and patching affected PHP
Brand logo

IT Insights

Cloud & Infrastructure Practice Media for Enterprise Technology Decision-Makers

Cloud ComputingSecuritySoftware DevelopmentAI ApplicationsStartupsGeneralAI Data News GlobalAbout Us

© 2026 IT Insights.

Cookie Notice

We use cookies to improve your experience and analyze website traffic. Read our Privacy Policy to learn more.