If you look after WordPress sites that run WP Rocket, checking the version number is only half of today’s job. The WP Rocket vulnerability CVE-2026-125812 lets an unauthenticated attacker, someone with no account at all, write a PHP file to the server and run it. Patchstack has seen it exploited since November 25, and the attacks are now automated. Sites are exposed when they run a release before 3.24.2 with one of two optimization features switched on: LazyLoad for CSS background images, or self-hosted Google Fonts. Both are off by default. On sites that someone has tuned for Core Web Vitals, they are often on.
The fix shipped on November 19. It stops new attacks. It does nothing about files an attacker already dropped, and that second half of the cleanup is the part that tends to get skipped.
Where the WP Rocket vulnerability comes from
WP Rocket measures pages in the visitor’s browser. A small script records things like which background images and fonts a page uses and reports back to a public AJAX endpoint: POST /wp-admin/admin-ajax.php with action=rocket_beacon. The plugin then acts on the URLs in that report. For LazyLoad it downloads stylesheets and stores processed copies under wp-content/cache/background-css/. With self-hosted fonts, font files end up under wp-content/cache/fonts/.
A beacon has to be reachable by anyone, and WP Rocket did not check the reported URLs strictly enough. An attacker sends a crafted report pointing at a stylesheet or font on a server they control. WP Rocket fetches it and saves it to a path the attacker chose through the URL, .php extension included. The attacker then requests that file and the web server executes it. Patchstack scores it 9.8 out of 10 on CVSS.
One line of string concatenation
You can trace the bug in the public source. In 3.24.1, generate_path() in inc/Engine/Common/Cache/FilesystemCache.php builds the destination like this:
$parsed_url_path = trim( $parsed_url['path'], '/' );
// ...
return $root_path . $parsed_url_host . '/' . $parsed_url_path;
trim() only strips slashes at either end. A ../ in the middle survives, so a URL path with a couple of those resolves to a location outside the cache directory the moment the file is written. That is a textbook path traversal (CWE-22): input from outside walks out of the directory it was meant to stay in. Nothing checked the file extension either. According to Ostorlab’s analysis, the Google Fonts code follows the same pattern.
Version 3.24.2 normalizes the path first and then checks it twice:
$path = ltrim( rocket_realpath( '/' . $path ), '/' );
if ( ! $this->is_valid_path( $path ) ) {
return '';
}
$file_path = $root_path . '/' . $host . '/' . $path;
if ( ! $this->is_inside_root( $file_path, $root_path . '/' . $host ) ) {
return '';
}
Prefixing a slash before normalizing means .. stops at the host directory instead of climbing past it. is_valid_path() now only accepts file names ending in .css or .css.json and rejects executable extensions, and is_inside_root() compares the resolved result with the real cache directory. That is exactly what any code that turns URLs into file paths should do. The remarkable part is that a plugin running on millions of sites went without it until November 2026.
About three hours from CVE to first attack
The timeline shows how little slack is left. The researcher Vorelito reported the bug through Patchstack’s bug bounty program on November 4. WP Rocket released 3.24.2 on November 19, with a single changelog line reading “Improve validation of cached CSS, font and preconnect files”. No CVE, no hint of severity. Patchstack added the entry to its database on November 23, and the CVE record went live on November 25 at 12:09 UTC. Patchstack logged the first exploitation attempt at 15:27 UTC the same day.
Patchstack says the first attacker worked by hand and retried with encoded variants when blocked. A day later automated campaigns had taken over, and on November 26 alone it blocked tens of thousands of attempts. Payloads sit on bare IP addresses, wildcard DNS names such as nip.io, short-lived trycloudflare.com tunnels and WordPress sites that were probably compromised earlier. Some attackers send both variants in one request so that one of them lands whichever feature the site uses.
As of November 28 there is no public proof of concept. That matters less than it sounds when the source diff above spells out the fix.
Checking your sites
WP Rocket is a commercial plugin, so it does not appear in the WordPress.org directory. If you manage a fleet, WP-CLI is the quickest way to read the version and the two settings that matter. Internally they are called lazyload_css_bg_img and host_fonts_locally, which is also what the vendor’s own helper plugin uses:
wp plugin get wp-rocket --field=version
wp option pluck wp_rocket_settings lazyload_css_bg_img
wp option pluck wp_rocket_settings host_fonts_locally
Anything below 3.24.2 combined with a 1 on either option is exploitable. The current release is 3.24.3 from November 26, which adds an opt-in AI assistant and a bug fix. Updates only arrive with an active licence. For sites whose licence has lapsed, and every agency has a few of those, WP Rocket says to switch both features off under WP Rocket › Page Optimization › Image & Media. For larger fleets it publishes a small mitigation plugin that forces both options to zero through filters while a vulnerable version is installed:
wp plugin install ./wp-rocket-mitigate-cve-2026-125812.zip --activate
On multisite it has to be activated per subsite, not network-wide. One inconsistency worth knowing: the vendor lists 3.15 through 3.24.1 as affected, while the CVE record says everything before 3.24.2. In practice it makes no difference. If you are still on 3.14, you have other problems.
After the update, look for leftovers
If either feature was enabled on a vulnerable release, updating is not enough. Patchstack’s indicators are unexpected PHP files in wp-content/wp-rocket-config/, in wp-content/uploads/ or directly in wp-content/, for example named wp-media-*.php. PHP has no business in the cache tree at all. A first pass from the WordPress root:
find wp-content/cache -type f \( -name '*.php' -o -name '*.phtml' -o -name '*.phar' \)
find wp-content/wp-rocket-config wp-content/uploads -type f -name '*.php' -newermt 2026-11-19
find wp-content -maxdepth 1 -type f -name '*.php' -newermt 2026-11-19
grep '"POST /wp-admin/admin-ajax.php' /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head
On a clean site the first command prints nothing. The second will legitimately show WP Rocket’s per-domain config file in wp-rocket-config, and its modification time should match your own settings changes. Any other new PHP file there or in uploads deserves a close look, though on its own it proves nothing. The last line counts POST requests to admin-ajax.php per IP. You will not see rocket_beacon in the access log because the action travels in the request body, but heavy traffic from an address that never loaded a normal page is still a useful signal. Patchstack also suggests checking outbound connections from the web server to unfamiliar hosts, especially nip.io and trycloudflare.com.
If you find something, treat the site as compromised. Deleting the file is not the end of it: keep a copy for analysis, rotate the database password and salts in wp-config.php, and review admin accounts and scheduled tasks. Code that ran once could have changed other files. The cleanup looks the same as after the file upload flaw in Contact Form 7, where a planted file was also the way in.
Keep PHP out of cache and upload folders
This bug makes a good case for hardening that works regardless of the plugin. Cache and upload directories never need to execute PHP. On nginx, one block does it, and it has to sit above your general PHP block because nginx evaluates regex locations in order:
location ~* ^/wp-content/(cache|uploads)/.*\.(php|phtml|phar)$ {
deny all;
}
On Apache, an .htaccess in both folders does the same:
<FilesMatch "\.(php|phtml|phar)$">
Require all denied
</FilesMatch>
To be fair, that only covers part of the surface. A path traversal can write anywhere the PHP process has write access, including wp-content/ itself. The real fix is giving the web server user as few write permissions as possible and shipping plugin updates through deployments rather than the dashboard. It is less convenient. It also turns a bug like this one from code execution into a failed write. None of it replaces updates, for plugins or for core, as the recent WordPress 7.1.5 security release showed.
Our take
WP Rocket fixed the bug quickly. Fifteen days from report to release is a decent turnaround for a large commercial plugin. The communication was weaker. A changelog line that reads like routine maintenance gives admins no reason to move an update up the queue, and once the CVE record appeared, attackers moved faster than many update cycles. Anyone running several CMS platforms saw the same thing that week with the Drupal installer flaw, which was also under active attack.
What we would do today: get every site onto 3.24.3, and switch both options off wherever the licence has expired. Then run the searches above on every site where either feature was on before the update. Beyond that, the PHP block for cache and upload folders belongs on every WordPress server, not just the ones running WP Rocket.
Sources: WP Rocket security advisory, Patchstack’s analysis of the attacks, release 3.24.2 on GitHub, the CVE record and Ostorlab’s code analysis.




