Skip to content

Cloudflare Free WAF: Security Rules php2shell Vulnerabilities

Cloudflare Free WAF: Security Rules php2shell Vulnerabilities
Cloudflare Free WAF security rules for PHP2Shell: managed rules, custom rules and the PHP patch

UPDATED · Oct 23, 2026
Cloudflare’s newest PHP2Shell changelog entry is dated Oct 22 and only renamed the rules (detection and Block action unchanged). Free plans have the protection on by default. Official rule IDs · Main PHP2Shell guide
The short version
  1. Free plan = 5 custom rules plus Cloudflare’s own managed rules, which already cover PHP2Shell (CVE-2026-109618 and CVE-2026-109619).
  2. Check, do not rebuild. Confirm the managed rules are on and watch the events. Add the optional custom rules below only if they fit your site.
  3. Rules are a stopgap. Cloudflare itself says to update PHP and keep the WAF on as an extra layer.

Cloudflare calls the rules that filter your traffic security rules. In its current dashboard, custom rules are one type of security rule, next to the managed rules Cloudflare maintains for you. This guide explains which ones protect you from PHP2Shell on the Free plan, shows the official rule IDs, adds two small custom rules you can copy, and warns about the mistakes that quietly turn protection off.

Two kinds of rules on the Free plan

TypeWho writes itPHP2Shell roleYour job
Managed rulesCloudflareOfficial protectionMake sure they are on. Free plans get them automatically.
Custom rules (up to 5 on Free)YouExtra, optionalAdd narrow rules that block things your site never needs.
PHP updateYour hostThe real fixAsk for the fixed PHP build and a restart.

On the Free plan, Cloudflare’s documentation lists a limit of 5 custom rules, and all actions except Log. That means you cannot run a rule in “watch only” mode, so test carefully and keep each rule narrow.

Today’s update (October 23, 2026)

Oct 21
Default protection started

Cloudflare says free and paid WAF customers were protected by default from October 21 at 03:02 UTC, about nine hours before public disclosure.

Source: Cloudflare blog

Oct 22
Rule names refined

Two emergency changelog entries renamed the seven Free and seven Managed rules to mention the two CVEs. The rule IDs, detection logic and Block action stayed the same.

Source: WAF changelog

Cloudflare says its analysts will keep updating the rules as new attack variations appear, so check the changelog again before you rely on this post. A fuller breakdown is in the Cloudflare Free WAF setup guide.

Security rules checklist

Security rules checklist for PHP2Shell: Managed, Events, No PHP, Uploads, No Skip, Patch
Steps 1 and 2 are the essentials. Steps 3 and 4 are optional extras you can test on your own site.

Step-by-step

Step 1 · 5 min
Confirm the managed rules are on
  • Free plan: the PHP2Shell rules sit in the Cloudflare Managed Free Ruleset and are enabled by default.
  • Pro, Business, Enterprise: open your zone’s WAF managed rules and check that the Cloudflare Managed Ruleset is deployed in block mode.
  • Your site must be proxied (orange cloud in DNS), or traffic skips every rule.

Menu names have changed over time (“Security → WAF” in older dashboards, “Security rules” in the newer one). Use Cloudflare’s managed rules page if you get lost.

Step 2 · 5 min
Watch the events

Go to Security → Security Analytics → Events and filter by the rule IDs in the next section. Look at the path, the action and whether a managed or custom rule acted. Blocks show the shield working and that someone is probing you. They do not prove nobody got through.

Official Cloudflare rule IDs

From Cloudflare’s October 21 announcement. The October 22 changelog renamed these to “PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619)” #1 to #7. The full Free and paid tables are in the setup guide.

Free plan
Managed Free Ruleset ID
77454fe2d30c4220b5701f6fdfb893ba

Rule IDs, #1 to #7:

4e315666e8e344cdb64119a3b5ccf32f
00c10e6cc4da4bd08722adeebcd95984
48ddf592361e4fdb97a8a85982dab691
3556683d512a47f2937899c524b1a4c6
da07c85852e34625bb478496302ede46
19373a83abb840e18ab3ce5a7975ce1b
07f0b6ddaabf40b1b2042dade8d613fa
Paid plans + all plans
Other IDs

Cloudflare Managed Ruleset ID (Pro, Business, Enterprise):

efb7b8c949ac4650a09736fc376e9aee

Response rule for every plan, in the Managed Response Firewall Default (“Default block for High confidence Signatures”):

afffe22785674c80a31875c848d2242a
Step 3 · 10 min · optional
Custom rule A: no PHP files in uploads

Nothing in wp-content/uploads should ever run as PHP. This rule blocks any request for a .php file there. It is a general hardening rule, not a PHP2Shell patch, and it uses up 1 of your 5 free rules.

  1. Open Security rules (or Security → WAF → Custom rules) and choose Create rule.
  2. Name it “Block PHP in uploads”, click Edit expression and paste:
(starts_with(http.request.uri.path, "/wp-content/uploads/") and ends_with(http.request.uri.path, ".php"))
  1. Set the action to Block and deploy.
  2. Open a few image and media pages to confirm nothing broke.

If the editor reports a syntax error, build the same rule in the visual builder: URI Path starts with /wp-content/uploads/ AND URI Path ends with .php.

Step 4 · 10 min · advanced, optional
Custom rule B: no file uploads on login paths

Cloudflare’s advisory says restricting unnecessary uploads reduces exposure. Login and cron files never need to receive files, so this narrow rule blocks form-data uploads sent to them. It is an extra layer that Cloudflare and PHP do not list as an official fix.

(http.request.method eq "POST" and any(http.request.headers["content-type"][*] contains "multipart/form-data") and http.request.uri.path in {"/wp-login.php" "/xmlrpc.php" "/wp-cron.php"})
  • Action: Block. Test by logging in normally afterwards.
  • Do not widen it to the whole site unless you are sure you accept no uploads. Media uploads, contact forms with attachments and some plugins send files with this format. If you ever widen it, leave out /wp-admin/ and /wp-json/.
  • If anything breaks, switch the rule off in the dashboard.

If you copy a rule from another site, note it may be written for different paths and could block your own forms.

Step 5 · important
Never “skip” the managed rules

A common trick is an “allow my own IP” rule with the Skip action. Cloudflare’s custom rules can skip other security features, and if you skip the managed rules your own browser (or an attacker who shares your IP address, such as on a shared office network) is no longer filtered. Keep allow rules narrow and never skip the managed rules for the whole site.

Step 6 · ongoing
Patch PHP and keep the rules on

Ask your host for the fixed build (8.5.12, 8.4.27, 8.3.36 or 8.2.35, or a vendor-patched package), and for a PHP restart. Then keep the WAF on. See the main PHP2Shell guide for the message to send.

What security rules cannot do

Limit
They are not a patch

The flaw is in the PHP runtime. Only updating PHP closes it.

Limit
They only see proxied traffic

If your origin server’s IP is reachable directly, attackers can skip Cloudflare. Ask your host to accept web traffic only from Cloudflare where possible.

Limit
New variations can slip by

Cloudflare reports attackers changing payloads. Rules improve after they are seen.

Limit
Only 5 free custom rules

Keep each rule short and specific, and delete rules you no longer need.

Frequently asked questions

Do I need custom rules at all for PHP2Shell?

No. Cloudflare’s managed rules are the official protection and are on by default for Free. Custom rules are optional hardening.

Can I test a rule without blocking?

Not on the Free plan, because the Log action is not offered there. Keep rules narrow, test straight away and turn a rule off if it breaks something.

What if a real visitor gets blocked?

Open the event, note the rule ID and path, then adjust the scope of the rule. For a managed rule, use Cloudflare’s scope settings rather than switching it off.

Is a Page Rule the same thing?

No. Page Rules and Configuration Rules change settings like caching and redirects. Blocking attacks is done by security rules and managed rules.

Does this protect my Blogger blog?

Blogger is not affected, because it runs on Google’s servers. This guide is for self-hosted PHP sites such as WordPress and WooCommerce.

Official sources

Read next: the PHP2Shell protection guide, the cleanup guide if you suspect a break-in, and how to upgrade WordPress to PHP 8.3.

Rule IDs and dates checked on October 23, 2026 against Cloudflare’s blog and WAF changelog. Rule syntax and menus change, so check Cloudflare’s documentation before you deploy. This guide is general information, not a security audit.

Written by

MNM is a blogging expert with over 10 years of experience. Since 2020, he has been a top destination for bloggers to find tips and growth strategies for their blogs. The content created by MNM is clear and of high quality, especially for those who want to begin their blogging journey.

Share X Facebook