WP Rocket Flaw Lets Hackers Plant PHP Backdoors via CSS Caching

Threat actors are actively exploiting a critical flaw in WP Rocket to deploy persistent PHP backdoors across vulnerable WordPress installations. Security researchers caught real attacks weaponizing the plugin's background optimization feature to download remote exploit scripts directly onto servers.

How the WP Rocket vulnerability downloads malware

The flaw abuses the plugin's telemetry beacon to trick the local server into fetching attacker-controlled PHP files.

WP Rocket is one of the most widely deployed caching plugins on WordPress, but an optimization helper turned into an open door for remote attackers. In affected releases, the plugin runs a client-side browser script that analyzes page assets and reports URLs back to `/wp-admin/admin-ajax.php` using the `rocket_beacon` action. The server then pulls down those external assets and caches them locally.

Before version 3.24.2, the plugin failed to validate those incoming URLs against strict file types. As detailed in forensic analysis published by NOC.org, attackers send spoofed beacon requests pointing to external `.php` files appended with `?rel=stylesheet`. Believing it is simply retrieving an external style asset, WP Rocket fetches the remote script and saves it inside `wp-content/cache/background-css/` with its executable extension intact.

Security protections like nonces do not stop the probe. Because the required `rocket_beacon_nonce` is printed directly in the public HTML source of every cached page, automated scanning scripts simply grab the token before launching their payload.

Inside the dropper: web shells hidden in plain sight

Once the malicious file hits the cache directory, attackers trigger execution by hammering the site with uncached search queries like `?s=zyx123`. This forces the server to reprocess the page and execute the newly downloaded code.

The primary payload acts as an automated dropper. Upon execution, it climbs up the directory structure to locate `wp-config.php`, plants persistent backdoors across six separate locations, and wipes its original file from the cache folder to erase forensic traces.

To evade standard file integrity monitors, the malware overwrites default WordPress files that administrators rarely inspect. The benign `wp-content/index.php` placeholder—traditionally holding just a silent comment—is replaced with an active web shell. Other copies hide under misleading names like `woo.php` and `wp-content/wp-rocket-helper.php` to masquerade as legitimate plugin components. It reflects a wider pattern across web infrastructure, reminiscent of how the Apache HTTP Server RCE flaw enabled quiet, deep server persistence.

Caching plugins require extensive server write privileges to do their job, making them high-value targets. WP Rocket's decision to fetch arbitrary remote URLs via an unauthenticated AJAX hook—relying solely on a public page nonce—was an accident waiting to happen. If you host WordPress sites, strip execute permissions from your `wp-content/cache/` directory at the web server level. PHP should never run from a cache folder.

TechCortex take

How to tell if your site was compromised

Updating the plugin stops future attacks, but it will not remove malware if an intrusion already occurred. Threat activity started within days of the initial patch release, meaning unpatched sites were exposed to automated scanning swarms.

Administrators should manually inspect critical root and theme directories for rogue files. Any recent modification to `wp-content/index.php` or `wp-content/themes/index.php` warrants immediate quarantine. Look for unexpected additions in your document root such as `woo.php` or `info.php`, and examine edge access logs for suspicious POST calls to `admin-ajax.php` carrying the `rocket_beacon` action paired with rapid hits to `.php` files inside the cache tree.

What it means for site owners

The fix is already available globally. Developer WP Media shipped WP Rocket 3.24.2 to patch CVE-2026-125812, adding strict validation to prevent executable scripts from being saved through the beacon pipeline.

If you manage a WordPress site using WP Rocket, update through your dashboard immediately. If automatic updates were paused or if your site ran versions 3.15 through 3.24.1 with CSS background lazy loading active between late November and now, treat the site as potentially probed and run a full filesystem integrity audit.

With active exploitation ramping up, passive defenses are insufficient. Patch WP Rocket immediately, check your server logs for beacon-related POST spikes, and verify the integrity of your core index files before attackers turn temporary access into permanent control.

Frequently asked questions

Which versions of WP Rocket are vulnerable?

Versions 3.15 through 3.24.1 are vulnerable if features like LazyLoad for CSS background images or Self-host Google Fonts are enabled. The issue was resolved in version 3.24.2.

Does updating WP Rocket remove existing backdoors?

No. Upgrading to 3.24.2 blocks the exploit route, but it does not remove web shells already written to folders like wp-content/index.php. Compromised servers require manual cleanup.

Sources

  1. WP Rocket CVE-2026-125812 Exploits, Dissected | NOC.org. news.ycombinator.com, 2026. https://noc.org/articles/wp-rocket-vulnerability-exploit-cve-2026-125812

More news in Cybersecurity

Latest news