1. Red
  2. Learn
  3. PHP2Shell

Does a WAF stop PHP2Shell? What Cloudflare can and can't do

Does a WAF stop PHP2Shell? Cloudflare and AWS WAF rules cut exposure while you patch, but only patched PHP fixes it. What they cover and what to ask.

By Timothy Lindblom, FounderPublished 2 November 20267 min readHow we check facts
On this page
  1. What did Cloudflare actually turn on?
  2. Why does a WAF not close the hole?
  3. What are the specific gaps in a WAF rule?
  4. Which layer does what?
  5. What do the government agencies say about it?
  6. What should I do this week if I use a WAF?
  7. Am I affected? Where you stand with a WAF in front
  8. Did a WAF stop anything that already happened?
  9. What can a scan tell me about this?

No. A WAF can block some PHP2Shell (CVE-2026-109618 and CVE-2026-109619) requests while you patch, and Cloudflare switched on rules for Free and paid plans on 21 October 2026. It cannot fix PHP. The PHP project says updating is the only safe choice, so move to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or a vendor backport, and restart the workers.

FactDetailSource
What PHP says"There are no complete mitigations, updating is the only safe choice"PHP notice
Fixed releases8.5.12 · 8.4.27 · 8.3.36 · 8.2.35, or a vendor package naming both CVEsPHP notice
Cloudflare rulesLive for Free and paid WAF from 21 October 2026, 03:02 UTC; Cloudflare still says patchCloudflare (vendor-claimed)
AWS WAF rulesTwo managed rules in the PHP Application rule group; AWS says they reduce risk and do not close the vulnerabilityAWS (vendor-claimed)
Earliest attempt seen17 October 2026, AWS honeypot telemetryAWS MadPot (vendor-claimed)
CISA KEVBoth CVEs added 26 October 2026: confirmed exploitedCISA KEV
Checked2 November 2026this page
21 OctCloudflare rules live, 03:02 UTC
17 Octfirst attempt AWS saw
9.2CVSS v4, both CVEs

The full facts and fixed versions are on the PHP2Shell facts page. The patch steps per distribution are in the runtime patching walkthrough.

What did Cloudflare actually turn on?

Cloudflare's post, published 21 October 2026 and updated on 23 October, says customers using its free or paid WAF were protected by default from 03:02 UTC on 21 October. That is before the PHP project's 14:00 UTC public release. Cloudflare says the rules use request and response signals to stop attempts and to keep exposed data from reaching attackers.

The coverage depends on the plan, according to the same post and Cloudflare's Managed Rules documentation:

PlanRuleset Cloudflare namesWhat Cloudflare asks of you
FreeManaged Free RulesetPatch PHP and leave the WAF on
Pro, Business, EnterpriseManaged RulesetConfirm the ruleset is deployed in block mode, patch PHP, leave the WAF on

All of this is Cloudflare describing its own product at our 2 November 2026 check. We have not tested the rules, and no outside check can tell you whether a given site's rules are in block mode. Only the Cloudflare dashboard for that zone can.

Why does a WAF not close the hole?

The flaws are in PHP itself. Wiz describes them as sitting below the application, and Sansec says the paths run inside PHP before store code or a store-level shield. A filter in front of the server sees a request. It does not see what the PHP process does with it. If you want the mechanics, what the two CVEs actually are is on its own page.

A request can reach PHP through the WAF or around it. Only the WAF path is filtered, and the fix lives in PHP. Request WAF at the edge sees requests only PHP workers the fix lives here Direct to the origin: no WAF check Patched package plus restarted workers is the only step that changes the PHP.
Where a WAF sits. Traffic that reaches the origin by a path around the proxy is never filtered.

AWS is direct about this in its WAF post: "AWS WAF inspects HTTP requests at the edge. It doesn't parse the internal structure of a multipart body, and it has no visibility into PHP worker memory or server-side configuration." It adds that patching is the only complete fix. The PHP notice puts it in one line, and its own interim settings come with the warning that they "do not make an installation safe".

What are the specific gaps in a WAF rule?

Three gaps matter to an owner, and each one can be checked.

  1. A changed setting. Cloudflare says customers who changed session.upload_progress.name are not covered by its WAF rule for the related session upload progress flaw, CVE-2026-115560, which PHP has not fixed yet. If a developer renamed that setting, the rule does not apply to you.
  2. Traffic that skips the proxy. Patchstack notes that Cloudflare's rules only help if the server accepts traffic only from Cloudflare. If the origin answers anyone who finds its address, the WAF sees none of that traffic. Cloudflare's origin guidance lists three ways to close it: allow only Cloudflare IP ranges, Authenticated Origin Pulls, or Cloudflare Tunnel. Locking the origin to Cloudflare's ranges covers how to set it up and test it.
  3. Variants. Cloudflare says it has seen attackers changing payloads to try to get past its protections, and that its analysts update the rules "when and if new techniques and variations emerge". A rule matches what its authors knew on the day it was written. The PHP update does not depend on that.

A fourth point applies to hosts with a firewall of their own. A statement like "our firewall blocks it" tells you about the firewall. It tells you nothing about the PHP package or the restart.

Which layer does what?

LayerWhat it can doWhat it cannot doDated source
Patched PHP, workers restartedRemoves the bugRemove anything planted before the patchPHP notice, 21 Oct 2026
Vendor WAF rules (Cloudflare, AWS WAF)Block known request shapes at the edgeSee PHP memory or settings; cover direct-to-origin traffic; cover unknown variantsCloudflare, AWS, 21 to 23 Oct 2026
Blocking multipart uploadsCuts one request path, where the site can live without uploadsFix PHP; AWS says to test the effect on the application firstAWS MadPot post, 21 Oct 2026
PHP interim settingsReduce specific pathsMake an installation safe, per the PHP noticePHP notice, 21 Oct 2026
Restricting access to the originKeeps unknown traffic away from unpatched PHPProtect visitors you still let inNCSC UK, CERT-EU
Store plugins and app-level shieldsProtect application codeReach below PHP; Sansec says not to wait for a shield ruleSansec

What do the government agencies say about it?

None of the three official advisories we read leads with a WAF. The UK NCSC alert of 21 October 2026 asks organisations to update, to use the PHP project's temporary mitigations if they cannot, and to consider taking a system offline if neither is possible. CERT-EU, on 23 October, recommends patching as soon as possible and isolating internet-facing resources until the fix is applied and verified. The Dutch NCSC advisory of 21 October points to the four fixed versions.

CERT-EU does name web server and proxy limits on request size, field count, multipart parts, header count and nesting depth for CVE-2026-109618. Those are size limits at the front end, and the PHP notice lists them as exposure reducers only.

What should I do this week if I use a WAF?

Keep it on, and treat it as the temporary layer it is.

  • Find out who runs the PHP for each site: you, your host or an agency. The who patches my website page covers the split.
  • Ask the question below and keep the written reply.
  • On Cloudflare Pro, Business or Enterprise, open the zone's WAF settings and confirm the Managed Ruleset is deployed in block mode, as Cloudflare asks.
  • Ask whether the origin accepts traffic only from your proxy. If it does not, ask the host to close it using one of the three methods above.
  • Look for a changed session.upload_progress.name in the PHP settings if you run the server yourself.
  • Schedule the PHP update. On cPanel hosts, the per-domain update guide shows where, and why the workers need a restart explains the last step.

For [your domain], which patched PHP package serves web requests, and when did the PHP workers last restart? Does the server accept web traffic from anywhere other than the firewall or proxy in front of it? Please answer in writing with the package or build identifier.

Am I affected? Where you stand with a WAF in front

Am I affected? Where you stand right now

A WAF in front of a site does not change the PHP behind it. From outside, a check can read hints about the stack. It cannot see the package changelog, the proxy rules in block mode, or when workers restarted.

  1. Detected Your site serves PHP and the exposed version is below the fixed release for its branch, WAF or not. Treat it as exposed. Ask the host the question above, or patch and restart today.
  2. Unknown The version is hidden, could be a backport, or you cannot tell whether the origin takes traffic around the proxy. This is the common case. Get the package identifier, the restart time and the origin answer from whoever runs the server.
  3. Confirmed by owner evidence You hold a package changelog naming both CVEs and a restart or redeploy after it. The runtime is patched, with or without a WAF. Whether anything got in earlier is a separate question.

No scan, ours included, moves you from "unknown" to "confirmed".

Did a WAF stop anything that already happened?

Not retroactively. AWS saw its first attempt on 17 October 2026, four days before disclosure, and more on 21 October after public proof-of-concept code appeared. That is honeypot telemetry from a vendor, and AWS says it is unclear whether the early attempts would have worked on real systems. The picture firmed up after that. CISA added both CVEs to its Known Exploited Vulnerabilities catalog on 26 October 2026, and watchTowr's FAQ, updated the same day, reports exploitation in its honeypots since 21 October. No primary source we read names a confirmed victim. Attempts versus real compromise is the page that separates the two.

Rules that went live on 21 October do nothing for a file written on the 18th. If PHP was unpatched and reachable from 17 October, follow the compromise checks for your server. The other PHP2Shell guides cover hosts, panels and runtimes.

What can a scan tell me about this?

The free scan reads the stack your site serves and matches each version to known vulnerabilities. It is a lookup: it can say a version is affected, not whether your setup is exposed. It cannot see a vendor backport, which runtime serves a virtual host, whether workers restarted, or whether your WAF is in block mode. Those answers come from your host or your server.

If you need to hand a host or an agency a short list of what to ask, the shared hosting question list is built for that.

Questions people ask

Does being behind Cloudflare mean my PHP is fixed?

Cloudflare's own post says to patch PHP even with its rules on, because they are an extra layer. A site behind Cloudflare can still run vulnerable PHP, and any traffic that reaches the server without passing through Cloudflare gets no WAF check. The answer is the host's package and restart confirmation, not the proxy.

Do I need a paid Cloudflare plan for the PHP2Shell rules?

Cloudflare says Free plans are covered by its Managed Free Ruleset and Professional, Business and Enterprise plans by its Managed Ruleset, all from 21 October 2026. It also tells paid customers to confirm the ruleset is deployed in block mode. Either way it says to patch PHP as well.

Can I wait to update PHP because I have a WAF?

No. The PHP project says updating is the only safe choice, and AWS says a WAF reduces risk but does not close the vulnerability. A WAF buys time to schedule the update. It does not replace it.

My host says a firewall protects us. What should I ask?

Ask which patched package serves your domain, when the PHP workers last restarted, and whether the server accepts traffic from anywhere other than the firewall. A firewall statement answers none of the three.

Does a WAF mean I can skip checking for compromise?

No. Attempts were seen from 17 October, four days before disclosure, and a WAF turned on later cannot undo anything planted earlier. If your PHP was unpatched and reachable from 17 October, check for unexpected PHP files, new admin accounts and cron entries.

Sources

  1. PHP security notice, 21 October 2026 (php.net)Fixed releases, interim mitigations, and the statement that only an update is a complete solution. No newer PHP release at our check on 2 November 2026.
  2. GHSA-6wmf-4rv5-p3rp: CVE-2026-109619 (php/php-src advisory)Affected and fixed versions; updating is the reliable mitigation. Checked 24 October 2026.
  3. GHSA-w8hw-w9fx-j79w: CVE-2026-109618 (php/php-src advisory)
  4. Cloudflare blog: PHP vulnerabilities and WAF protection (21 October 2026, updated 23 October)Vendor statement. Which plans, which rulesets, the block-mode instruction, the changed-setting gap, observed attack traffic. Checked 2 November 2026.
  5. Cloudflare docs: Managed RulesFree Managed Ruleset on all plans; Cloudflare Managed Ruleset on Pro, Business and Enterprise.
  6. Cloudflare docs: protect your origin serverIP allowlisting, Authenticated Origin Pulls and Cloudflare Tunnel.
  7. AWS Security Blog: Using AWS WAF to apply mitigations for PHP2Shell (21 October 2026, updated 23 October)States what a WAF cannot see and that patching is the only complete fix.
  8. Amazon Threat Intelligence: PHP2Shell exploitation attempts seen in MadPot honeypots (21 October 2026)Vendor telemetry; attempts from 17 October.
  9. UK NCSC: critical security issue affecting PHP (21 October 2026)
  10. NCSC-NL advisory NCSC-2026-0443 (21 October 2026)
  11. CERT-EU security advisory 2026-018 (23 October 2026)
  12. Wiz research: PHP2ShellResearcher view that the flaws sit in PHP itself, below the application.
  13. Sansec: PHP2ShellEcommerce view: the paths run inside PHP before store code or a store-level shield.
  14. Patchstack: PHP major vulnerability alert (21 October 2026)
  15. watchTowr: PHP2Shell FAQ (updated 26 October 2026)CVSS 9.2, the KEV listing and exploitation seen in its honeypots since 21 October.
  16. CISA Known Exploited Vulnerabilities catalogBoth CVEs added 26 October 2026, federal due date 29 October. Checked 2 November 2026.

Facts on this page are dated and point at the primary source next to them. If a vendor status changes after the date shown, the vendor's page wins; tell us at support@run.cloud and we will update it.