PHP Site Audit

Hosting

Does Cloudflare WAF protect a site from PHP2Shell?

The direct answer

A Cloudflare WAF can inspect and act on proxied HTTP requests when relevant rules are deployed and enabled. That is a traffic filter, not a PHP update: it does not replace vulnerable code on the origin. Cloudflare documents possible false negatives and direct-origin bypass. Ask whether all traffic is proxied and get the host to confirm the fixed package or backport and worker restart.

Separate the traffic path from the PHP runtime

A reverse proxy sits between visitors and an origin server. When a DNS record is proxied, requests for that hostname can pass through Cloudflare, where configured WAF rules may evaluate them. Requests that go directly to the origin do not receive those proxy controls. A hostname can also be unproxied or routed differently from the main website.

PHP2Shell concerns PHP itself. The PHP project's October 21 advisory calls for updating web-serving PHP installations. A WAF configuration does not install a new PHP package, replace a container image, or restart a PHP worker.

When interpreting Cloudflare evidence, distinguish an event in the Cloudflare dashboard from an origin log entry. The first describes traffic seen by the configured edge service; the second describes what reached the server, subject to the origin's logging. Neither alone describes the PHP package. Ask the respective owners to preserve the relevant time window and explain what their logs can and cannot show.

What Cloudflare says to check

Cloudflare's managed-rules documentation says rulesets must be deployed and false negatives can occur. Its troubleshooting guidance recommends confirming that DNS records are proxied, appropriate rulesets are active, exceptions are not skipping evaluation, and direct access to the origin is restricted. Those checks establish aspects of traffic coverage; they do not certify that a particular PHP2Shell request pattern will be blocked.

Avoid claims such as ‘Cloudflare blocks PHP2Shell’ unless you have current vendor evidence for the exact rule, plan, configuration, and traffic path. No generic WAF label proves a request was blocked or that the underlying origin is patched. Ask the operator to review security events and origin logs if available.

What an owner should ask

Ask the DNS or hosting administrator: Are all production hostnames proxied? Can visitors reach any origin IP directly? Which managed rulesets are deployed? Are relevant exceptions or allow rules in place? Do logs show requests reaching the origin through another route? These are coverage questions for the WAF owner.

Separately ask the server administrator which PHP package or image serves each site, which vendor advisory covers both PHP2Shell CVEs, and when patched workers became active. If the provider uses a backport, request its package advisory. ‘WAF enabled’ does not close these runtime questions.

Use layered evidence

Keep the mitigation record in two columns: edge controls and origin remediation. Record covered hostnames, proxy status, rule-configuration review date, origin restriction status, package/build evidence, and restart time. If any item is unknown, assign someone to verify it rather than assume the setting applies account-wide.

If the site has unusual errors or signs of unauthorized activity, treat that as a separate incident question and involve the hosting or security team. A WAF event may show a blocked or allowed request, but is not a full forensic record. Do not run attack payloads against production to test a rule.

A useful review also looks at traffic that never enters the expected proxy path. Old DNS records, a second hostname, a cloud load balancer, or an IP address exposed in a certificate or configuration can create another route. Have the network owner assess whether the origin accepts requests only through trusted proxy addresses and whether the application correctly handles forwarded visitor information. Cloudflare's documentation is about the behavior of configured services; it cannot establish your zone settings.

A WAF may remain one layer in a defense plan while the PHP update is scheduled, but document the owner and expiry of any temporary rule or exception. Overly broad rules can block ordinary forms or file uploads, and a narrowly tailored rule can miss another request shape. Ask the administrator to use the platform's event records and test normal site workflows after a configuration change.

Decision checklist

  • Confirm hostnames and origin ownership.
  • Verify proxy status for each hostname.
  • Check deployed WAF rules and bypass paths with the administrator.
  • Ask the runtime owner for PHP package/backport and worker evidence.
  • Keep WAF observations and patch confirmation as separate evidence.

Common questions

If my WAF blocks attacks, can I skip the PHP update?

No. The WAF may reduce some traffic, but it does not patch the origin. Confirm the PHP vendor fix with the host.

Does a proxied Cloudflare DNS record prove every request uses the WAF?

No. Check every hostname and whether the origin is reachable directly through another address or route.

Can I test by sending an exploit request?

Do not probe a production system. Ask the provider to review configuration, security events, and origin logs.

Sources and further reading

Related guides