Use case · Retail
Protecting a PHP business from PHP2Shell with a Cloudflare WAF
A flaw in PHP itself can reach a server before the store's own code runs, and the servers cannot all be patched on the same day. This is how GUILDA would keep attacks out at the edge while the patching is done, and leave the defence in place for the next flaw.
The challenge
A flaw in PHP itself, public the day it was fixed
The retailer's online store and customer accounts run on WordPress and PHP, behind Cloudflare. On 21 October 2026, PHP released fixes for two flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, known together as PHP2Shell, and the details became public the same day. Both are reached through file uploads and PHP's upload-progress feature before the application's own code runs, with no login, in every PHP version from 5.4. Application fixes, plugins and input checks cannot stop a request that is handled before they run. Attack attempts were reported the same day. The retailer has several servers, some run by its hosting provider, and they cannot all be patched at once.
Our approach
How we would do it
We would hold the line at Cloudflare first, then close the flaw on every server, and check whether anyone got in before the rules were in place.
Confirm the managed rules are blocking
Check that the zone's managed rulesets are on and that Cloudflare's PHP2Shell rules are in Block mode, not only logging, then turn on the managed response rules where the plan includes them, so a server's answer to an attack can be stopped too.
Limit uploads
Add rate limits on the store's upload paths, and a size limit on uploads at Cloudflare where the plan allows it or at the server's proxy, so an attacker cannot send uploads freely while servers wait for the patch.
Watch the WAF events
Follow the WAF's security events for the PHP2Shell rules and the new limits, to see what is being blocked, from where, and whether a legitimate upload is caught by mistake.
Patch in order of exposure
Upgrade each server to a fixed PHP release, starting with those that take uploads from the internet. Until a server is patched, apply PHP's own mitigations: turn off session upload progress in the server configuration, limit request sizes at the proxy and restart workers.
Look back, and rotate secrets
Search the web server and WAF logs back to mid-October for requests that match the attack. Where a server was exposed before it was protected, rotate its secrets: database passwords, API keys and the application's own keys.
Keep the WAF as a standing layer
Leave the rules, the limits and the event review in place after patching. The WAF is a layer on top of patching, not a fix, and it is the layer that answers first when the next runtime flaw is made public.
What the business keeps
- A WAF configuration it can check
Managed rulesets, PHP2Shell rules and response rules confirmed in Block mode, with the settings written down.
- Upload limits
Rate and size limits on the store's upload paths, at Cloudflare or at the proxy.
- A patch record
Every server, its PHP version before and after, and the date it was patched or mitigated.
- A log review
What the search of the logs back to mid-October found, and the secrets rotated as a result.
- A routine for the next flaw
The steps to confirm new managed rules, watch their events and patch in order of exposure.
Expected outcomes
What the approach is designed to give
Attacks on the flaw are designed to be stopped at Cloudflare before they reach a server
The managed rules and response rules block the attack while servers wait for the patch.
Patching can follow the order of exposure, not the order of panic
Servers that take uploads from the internet are upgraded first, with PHP's mitigations in place until then.
The business is expected to know whether anyone got in before the rules were in place
The log search back to mid-October and the rotated secrets answer that question.
The next runtime flaw meets a defence that is already in place
The WAF, its limits and the event review stay on after patching.
This is an example of how GUILDA would approach this work for a typical business, not a client engagement.
Scope
What the work covered
- PHP2Shell
- Cloudflare WAF
- Web application firewall
- Patch management
- Log review
- WordPress
Related
The services behind this work
Data, Application & Cloud Security
Application security reviews, cloud security assessments and hardening on AWS, Azure and Google Cloud, and data protection design, to OWASP and CIS Benchmarks.
Threat Detection & SIEM Implementation
SIEM implementation on Microsoft Sentinel, Splunk, Elastic Security or Wazuh, with log sources, detection rules and runbooks handed to your team.
Your turn
Does your business run on PHP?
Tell us how your sites are hosted and protected today, and we will show you what holding the line at the edge would take.