Cloudflare 部署针对 php2shell 漏洞的防护措施
Cloudflare deploys protections against php2shell vulnerability

原始链接: https://blog.cloudflare.com/php-vulnerabilities-waf-protection/

Cloudflare 与合作伙伴披露了两个 PHP 漏洞,php2shell(CVE-2026-109618 和 CVE-2026-109619),影响 PHP 5.4+,可能导致 DoS、RCE 或数据泄露。Cloudflare 在披露前为所有套餐(包括免费套餐)部署了 WAF 保护,并引入了全事务检测以分析请求和响应信号。客户默认仍受保护,但应仍修补 PHP 并保持 WAF 启用。这些漏洞源于请求处理期间不安全的内存处理;攻击者可通过精心构造的 HTTP 请求触发。Cloudflare 将继续监控并更新规则。

Cloudflare 部署了针对 php2shell 漏洞的防护。在链接的 Hacker News 讨论中,评论者就更广泛的安全影响展开辩论:有人警告,强大的开放权重大模型和集中式缓解措施可能让强大的平台成为互联网守门人;有人主张用可证明正确的软件作为防御;还有人说未来需要更多安全专家。
相关文章

原文

Today, Calif.io, Wiz, OpenAI and Quarkslab disclosed two vulnerabilities in PHP, tracked as CVE-2026-109618 and CVE-2026-109619 and known as php2shell. The vulnerabilities affect all web servers running PHP 5.4 or later and they may allow an attacker to cause denial of service, remote code execution, and data exposure when an application processes specially crafted HTTP traffic.

Cloudflare has been part of a coordinated effort to deploy mitigations to protect the Internet, working with PHP foundation, OpenAI and Wiz among others. Cloudflare has developed and deployed web application firewall (WAF) protections since early October 2026, which were deployed about 9 hours ahead of public disclosure. Starting on October 21 3:02 am UTC, Cloudflare customers using our free or paid WAF were protected by default against php2shell.

Cloudflare successfully deployed multiple mitigations for all its customers while the vulnerability was leaked before the official release date and we observed attack traffic targeting our customers. We observed how attackers were mutating the attack payload to try to bypass our protections by tracking the volume of matches and cross-referencing with the rule logic.

Protecting against php2shell required more than standard request-based rules. Request data alone does not always provide enough evidence to distinguish an exploit from legitimate traffic. The origin’s response adds context, helping identify whether an exploit succeeded while reducing the risk of false positives.

To deliver this protection, we developed full transaction detection, a new Cloudflare WAF capability that combines signals from the request and response within the same HTTP transaction. Response rules can then block a matching origin response before it reaches the requester. The php2shell protections are the first managed detections we have released using this capability.

Customers should patch their PHP repos even with WAF protections providing an additional layer of defense-in-depth mitigation. Our security analysts continue monitoring attack activity and update the rules when and if new techniques and variations emerge in the hours and days ahead. You can track new rules in the changelog.

The protections are available and deployed automatically on all plans with WAF deployed, including Free users.

What we know about the vulnerabilities

PHP is used by almost 70% of websites. The php2shell vulnerabilities affect the PHP runtime itself and can allow attackers to execute malicious code on vulnerable servers, expose customer data, or disrupt services. Because PHP underpins widely used platforms such as WordPress and Magento, these flaws could potentially affect a large number of applications across the Internet.

The two vulnerabilities involve how PHP handles memory when something goes wrong while processing a HTTP request. Normally, PHP allocates memory to store the data it needs to process a request, then releases it when that work finishes. If processing stops unexpectedly, for example because it runs out of memory, PHP fails to clean up the memory safely. These vulnerabilities arise when PHP handles an error and then tries to use data that was not fully set up or memory that has already been released.

An attacker can send specially crafted HTTP requests to trigger these conditions. Large requests are one way to put memory under pressure, but the problem goes beyond consuming server resources. By manipulating the data PHP encounters in this invalid memory, an attacker may be able to crash a PHP process, expose sensitive information, or execute code provided by the attacker.

The two vulnerabilities differ in when the unsafe memory access happens:

Vulnerability

What goes wrong

CVE-2026-109618

PHP runs out of memory and interrupts its work before some internal data has been properly initialized. During cleanup of that request, PHP may use this unfinished data as though it were valid.

CVE-2026-109619

A fatal error interrupts a request, leaving PHP holding references to memory that is released when the request ends. When the same PHP process handles a later request, it may follow those outdated references and access memory that is no longer valid and expose sensitive data.

These flaws are in the PHP runtime, so updating website code or a plugin(s) alone does not fix these vulnerabilities. Administrators need to update the PHP software running their applications. If a hosting provider manages PHP, ask the provider to apply the security update.

Administrators can follow the PHP advisory for affected versions and remediation instructions. Keep Cloudflare WAF protections enabled while patching. Restricting unnecessary uploads and limiting upload sizes can also reduce exposure, but these measures do not replace the PHP fix.

New rules

For Free customers, new rules have been released under the Cloudflare Managed Free Ruleset (Ruleset ID 77454fe2d30c4220b5701f6fdfb893ba). Free customers don’t have to take any actions to enable the protection. To override the ruleset behavior you can refer to our documentation.

Rule Description

Rule ID

Generic Rules - Anomalous Execution - 1

4e315666e8e344cdb64119a3b5ccf32f

Generic Rules - Anomalous Execution - 2

00c10e6cc4da4bd08722adeebcd95984

Generic Rules - Anomalous Execution - 3

48ddf592361e4fdb97a8a85982dab691

Generic Rules - Anomalous Execution - 4

3556683d512a47f2937899c524b1a4c6

Generic Rules - Anomalous Execution - 5

da07c85852e34625bb478496302ede46

Generic Rules - Anomalous Execution - 6

19373a83abb840e18ab3ce5a7975ce1b

Generic Rules - Anomalous Execution - 7

07f0b6ddaabf40b1b2042dade8d613fa

Protection for paid plans has been released as part of the Cloudflare Managed Ruleset (Ruleset ID efb7b8c949ac4650a09736fc376e9aee). If you are on a Professional, Business, or Enterprise plan, review your Managed Ruleset deployment to confirm it’s deployed block mode.

Rule Description

Rule ID

Generic Rules - Anomalous Execution - 1

c1d409ad838f47f59446f21cc438d5dd

Generic Rules - Anomalous Execution - 2

f9a45927414245e3a64bb12d0a0c2f64

Generic Rules - Anomalous Execution - 3

771c654ae1154d4daa72f4e1545d163c

Generic Rules - Anomalous Execution - 4

217005865f0145f392300bac212afcc9

Generic Rules - Anomalous Execution - 5

38efdb17ea594501bb55a1d71867b12e

Generic Rules - Anomalous Execution - 6

4148ae686fdb4d01be673fab9d9c073d

Generic Rules - Anomalous Execution - 7

1389aa259617437392ce149c48143645

To better identify exploit attempts, Cloudflare developed full transaction detection, a new WAF capability that analyzes both sides of the same HTTP transaction. While some malicious payloads can be identified using the request alone, the response contains useful signals that can be used to create rules with higher confidence, reducing false positives. A matching full transaction rule can block the origin response before it reaches the requester. Learn how it works in our full transaction detection blog post.

The following rules have been deployed to the new Cloudflare Managed Response Firewall Default for customers on all plans, including Free:

Rule Description

Rule ID

Default block for High confidence Signatures

afffe22785674c80a31875c848d2242a

Note: rule descriptions will be updated soon.

Review events and customize protection

To analyze blocked requests, visit Security > Security Analytics > Events. Filter by the rule IDs in the table above and inspect the matched request, action, and path. Events identify whether the action came from a managed or custom rule. Customers who need to tailor the protection can update the scope of the Managed Ruleset to the parts of an application where it is relevant.

Update PHP and keep the protection enabled

Cloudflare customers using our Managed Ruleset are protected by default. We recommend following the advisory recommendation and applying the vendor update to your PHP repos as soon as possible while keeping the WAF protection enabled as an additional protection. Our WAF analysts will continue to update protections as new techniques emerge.

联系我们 contact @ memedata.com