Back to the notes

Cloudflare rolled a WAF rule in 23 minutes for a PHP zero-day

When CVE-2024-4577 dropped, Cloudflare had WAF protection live before most people finished reading the disclosure. That is how defensive infrastructure should work.

01equipment.jpg
Alice Wondrak-Biel / Wikimedia Commons. Resized and converted to WebP. Public domain

Cloudflare published their response timeline for the php2shell vulnerability. Twenty-three minutes from public disclosure to a deployed WAF rule blocking the attack vector. No vendor patch required, no restart window, no change control meeting. The vulnerability itself is a Windows-specific path traversal in PHP CGI mode. Attackers could inject command-line arguments through malformed URLs because of how Windows handles certain Unicode characters in file paths. Classic CGI injection, just dressed up with character encoding. What caught me is the deployment speed. Most organisations are still figuring out if they are even vulnerable twenty-three minutes after a CVE drops. Cloudflare had detection live, blocking real exploit attempts, before the first proof-of-concept scripts hit GitHub. This only works because the WAF rules live in their edge network. No client-side updates, no configuration pushes to a thousand servers. Write the rule once, deploy globally, protect everyone behind the proxy. That architecture advantage is worth more than the specific vulnerability. The post includes actual request patterns they blocked. Encoded soft hyphens, best-fit mappings for dash characters, all the Windows path normalisation tricks. Reading those examples is more educational than most penetration testing courses. I have seen organisations take weeks to deploy a critical patch because it requires application downtime. Meanwhile every CGI endpoint is exposed, waiting for someone to script the public exploit. A WAF that deploys in minutes turns a zero-day into a non-event for anyone behind it. This is what good defensive infrastructure looks like. Not perfect prevention, but fast enough reaction that the window of exposure is measured in minutes, not days. The vulnerability is still there in the underlying PHP install, but the exploit path is blocked before most people wake up.


Source: Cloudflare deploys protections against php2shell vulnerability

Back to all notes

Behind the notes

Vikrant
Sharma.

Artificial Intelligence Engineer intern at Voxon Photonics in Adelaide. Studying a Master of Information and Communications Technology at UniSC, with a focus on data, machine learning and security.

Meet the person behind the work