Cloudflare WAF Strengthens Defense Against Critical PHP Vulnerabilities Including phpAfterShell

Original announcement: Cloudflare · 2026-11-20. Read the official announcement.

Summary of the phpAfterShell Discovery and PHP Security Updates

On November 19, 2026, security researchers disclosed a critical vulnerability named phpAfterShell (CVE-2026-126714) affecting PHP’s default file-based session handler. This flaw allows for potential remote code execution with a high severity score of 9.2/10. The PHP project responded immediately with security releases for PHP versions 8.2.36, 8.3.37, 8.4.28, 8.5.13, and 8.6.0, which also included patches for 16 other security issues, six of which are critical.

Who Should Care?

Developers and administrators running PHP-based web applications, particularly those using vulnerable versions of PHP (prior to the patched releases mentioned), need to be alert. This includes organizations using infrastructure where PHP is embedded in content management systems, plugins, or container images. Because PHP runs a significant portion of the web, exploitation of this vulnerability could have broad impact.

Cloudflare WAF’s Role and Coverage

Cloudflare has updated its Web Application Firewall (WAF) to protect all customers, including those on the Free plan, against attempted exploits of phpAfterShell. The WAF leverages existing PHP remote code execution rules first developed for earlier php2shell vulnerabilities, now enhanced to detect phpAfterShell attack patterns.

  • The relevant WAF rule is enabled by default and set to Block mode.
  • Additional rules have been added to address other PHP flaws such as a FastCGI request smuggling vulnerability (CVE-2026-129289) and SOAP extension flaws (CVE-2026-15353 and CVE-2026-129506); these initially log detections and allow users to tune blocking.

It is important to note the WAF serves as an additional defense layer—not a replacement for prompt patching—because some attack vectors occur outside of HTTP request inspection or depend on server states not visible to the WAF.

Recommended Developer Actions

To mitigate risk effectively, developers and security teams should:

  1. Verify that Cloudflare WAF’s relevant rules are active:
    • Free plan users have phpAfterShell protection enabled by default; no immediate action needed.
    • Paid plans should ensure the Cloudflare Managed Ruleset is deployed and the PHP Remote Code Execution Attack rule (#6) is set to Block.
    • Review logs for new rules concerning PHP-FPM and SOAP vulnerabilities; after verifying no false positives, switch their action from Log to Block.
  2. Upgrade PHP to one of the fixed versions (8.2.36, 8.3.37, 8.4.28, 8.5.13, or 8.6.0) as soon as possible.
  3. Restart PHP processes or containers fully to load patched versions.
  4. Disable session.upload_progress.enabled if it remains enabled (especially post-upgrade), as it can be exploited.
  5. Limit storing untrusted data in PHP session storage.
  6. Consider using Cloudflare’s WAF attack scoring feature if on Business or Enterprise plans to detect suspicious payloads with machine learning.

Limitations and Ongoing Monitoring

While Cloudflare’s WAF significantly lowers immediate exploitation risk, it cannot block exploits that occur outside of HTTP request inspection, such as internal server-side deserialization attacks or direct traffic that bypasses Cloudflare.

Cloudflare’s security analysts continue to monitor emerging attack techniques and will update WAF rules accordingly. Developers should stay informed by tracking updates in the Cloudflare Zero Wire briefing and WAF changelog.

Practical Checklist for Developers

  1. Check PHP version: Confirm your PHP runtime is at or above patched version numbers.
  2. Restart PHP services: Ensure all PHP workers reload the updated version.
  3. Review Cloudflare WAF rules: Confirm PHP Remote Code Execution Attack #6 rule is enabled and set to Block.
  4. Analyze logs for new PHP-FPM and SOAP rules: Set these from Log to Block after ruling out false positives.
  5. Disable session.upload_progress: Set session.upload_progress.enabled=0 in configurations.
  6. Minimize untrusted data in sessions: Audit session usage to avoid risky storage of user data.
  7. Use WAF attack scores: On Business or Enterprise plans, configure rules to block requests with high risk scores.

Related Code Crushers coverage

Leave a Comment

Scroll to Top