PoC Published for W3 Total Cache Flaw Exposing 1M+ Sites to RCE

PoC Published for W3 Total Cache Flaw Exposing 1M+ Sites to RCE

Security researchers have published a proof-of-concept exploit for a critical remote code execution vulnerability in W3 Total Cache, one of WordPress’s most popular caching plugins with over one million active installations.

The flaw, tracked as CVE-2025-9501, allows attackers to execute arbitrary code on vulnerable websites under specific conditions.

Field Details
CVE ID CVE-2025-9501
Affected Product W3 Total Cache Plugin for WordPress
Affected Versions Versions prior to patch (1M+ installations)
Vulnerability Type Unauthenticated Command Injection / Remote Code Execution

Understanding the Command Injection Vulnerability

The vulnerability stems from an unauthenticated command-injection flaw in W3 Total Cache’s page-caching mechanism.

Security researcher Julien Ahrens from RCE Security analyzed WPScan’s brief advisory and developed a working exploit for the vulnerability, which was initially discovered by researcher “wcraft.”

The code execution occurs in the plugin’s _parse_dynamic_mfunc function within the PgCache_ContentGrabber class.

This function uses PHP’s eval() function to execute code contained in specially formatted comments within cached pages.

Page Cache is enabled in the plugin
Page Cache is enabled in the plugin

When the plugin processes cached content, it searches for these dynamic function comments and executes the code contained within them.

The exploit works by injecting malicious code through WordPress comments that include the mfunc tag format.

Once the page is cached, the plugin processes these comments and executes the code whenever the cached page is served to visitors.

While the vulnerability is technically straightforward, several conditions must be met for successful exploitation.

First, attackers must know the value of the W3TC_DYNAMIC_SECURITY constant, which is a unique security string defined in the WordPress configuration file. Without this secret value, the attack cannot proceed.

Second, WordPress comments must be enabled for unauthenticated users. If comments are disabled or require authentication, the vulnerability can only be exploited by authenticated users with comment privileges.

unauthenticated RCE
Unauthenticated RCE

Third, the Page Cache feature must be enabled in W3 Total Cache. Although this is the plugin’s core functionality, it is turned off by default on fresh installations.

These prerequisites significantly reduce the attack surface, but sites meeting these conditions remain vulnerable to complete system compromise.

Successful exploitation grants attackers complete control over the affected WordPress installation, allowing them to steal sensitive data, install backdoors, or launch further attacks.

Website administrators using W3 Total Cache should immediately update to the latest patched version of the plugin.

If updates are not immediately available, temporary mitigations include turning off the Page Cache feature or restricting comment functionality to authenticated users only.

Organizations should also review their W3TC_DYNAMIC_SECURITY constant configuration and ensure it uses a substantial, unpredictable value rather than default or documented examples.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and set GBH as a Preferred Source in Google.



Source link