WP Rocket Flaw CVE-2026-125812: Check Your Site After Updating

WP Rocket flaw under attack: update to 3.24.2, then check your cache folders

On 25 November, attackers started using a WP Rocket bug to plant PHP files on WordPress sites. No login needed: a faked performance report makes your site download a file from the attacker’s server and save it where it will run. WP Rocket fixed it in 3.24.2 on 19 November. As with every bug like this, updating closes the door but doesn’t remove anything that already came through it.

Last updated 4 December 2026. We read Patchstack’s analysis of the attacks, WP Rocket’s own advisory, its changelog, and the coverage from The Hacker News, BleepingComputer and heise. We downloaded WP Rocket 3.24.1 and 3.24.2 from its public GitHub repository and compared them. We did not run the attack, and won’t show how.

The short version

  • Who’s affected: WP Rocket 3.15 to 3.24.1, but only if LazyLoad for CSS background images or Self-host Google Fonts is switched on. Some reports call the second one “Host Fonts Locally”. It’s the same setting. Both are off by default.
  • Fixed in 3.24.2, released 19 November. 3.24.3 (26 November) is the current release and is fine too.
  • Can’t update yet? Turn both settings off, under WP Rocket > Page Optimization > Image & Media (the Media tab on versions before 3.24).
  • Had either setting on before you updated? Check for planted PHP files. The update won’t remove them.

What happened

Date (2026) What happened
4 November The bug reported to Patchstack by a researcher credited as Vorelito, according to Patchstack’s database entry.
18 November The fix merged into WP Rocket’s code on GitHub from a private security fork.
19 November WP Rocket 3.24.2 released. The changelog only says “Improve validation of cached CSS, font and preconnect files.”
23 November Patchstack publishes the advisory as CVE-2026-125812, CVSS 9.8.
25 November, 15:27 UTC First exploitation attempt Patchstack recorded. The attacker tested by hand, then retried with encoded variants once blocked.
26 November Fully automated attacks, with tens of thousands of attempts blocked that day. 3.24.3 released, with no security entries.
27 November Patchstack’s write-up. WP Rocket updates its advisory and publishes a helper plugin.

Patchstack says several separate groups are at it, and that they “use both feature paths, sometimes in one request”, so a site with either setting on is a target. The payload files sit on bare IP addresses, on wildcard DNS names like nip.io, on temporary trycloudflare.com tunnels and on other WordPress sites that were probably hacked first. BleepingComputer quotes Patchstack’s figure of more than 25,000 blocked requests.

WP Rocket runs on about 5.5 to 5.6 million sites, depending on which report you read, so even a small share with these settings on is a lot of sites. NHS England has flagged it too, as cyber alert CC-4906, though we couldn’t load that page to read it.

What the fix changed

WP Rocket’s beacon script runs in your visitors’ browsers and reports things back to admin-ajax.php with the action rocket_beacon. That endpoint works for logged-out visitors, which is how it has to work. Its security token is printed in the page for every visitor, so it doesn’t stop an attacker. One of the things the beacon reports is a list of outside domains your page connects to. WP Rocket saves those and later prints them in your page’s head as preconnect hints.

In 3.24.1 almost anything was accepted as a “domain”. The fix, one security merge, tightens five places.

1. Only real domains are stored

The beacon handler now keeps an entry only if it’s a plain http or https origin: scheme, host and optional port, with no path, query or login part. Older rows are re-checked before printing.

2. The Google Fonts check now parses the URL

Self-host Google Fonts looks at the links in your page head and downloads anything that looks like a Google Fonts stylesheet. In 3.24.1 “looks like” meant the text //fonts.googleapis.com/css appeared somewhere in the link. A link to any other server with that text tucked into its query string passed. The preconnect hints are added to the head before the fonts feature runs, so a “domain” planted through the beacon could reach this check. From inc/Engine/Media/Fonts/Frontend/Controller.php:

// 3.24.1
return ! empty( $this->find( '(?:https?:)?\/\/fonts\.googleapis\.com\/css.+', $url ) );

// 3.24.2 (shortened)
$parsed = wp_parse_url( html_entity_decode( $url, ENT_QUOTES ) );
return 'fonts.googleapis.com' === strtolower( $parsed['host'] )
    && in_array( strtolower( $parsed['path'] ), [ '/css', '/css2' ], true );

3. Font files stay in the fonts folder and must be fonts

This is the part that wrote the file. WP Rocket downloads the stylesheet, finds every url(https://...) in it, downloads each one and saves it under wp-content/cache/fonts/, using the path from the URL as the file name. In 3.24.1 that path went straight onto the end of the folder name:

// 3.24.1, inc/Engine/Media/Fonts/Filesystem.php
$font_path  = wp_parse_url( $font_url, PHP_URL_PATH );
$local_path = $fonts_basepath . $font_path;

Nothing stopped ../ segments, which climb out of the fonts folder, and nothing checked the extension or the contents. So whoever controls the stylesheet controls the file name, where it lands and what’s in it. That’s the path traversal in the CVE. In 3.24.2 a new get_local_font_path() allows only letters, digits, dots, dashes, underscores and slashes, resolves .. so it can’t leave the fonts folder, requires a .woff2, .woff, .ttf, .otf or .eot name, and double-checks the final path is still inside. A new is_font_content() then checks the first bytes of the download really are a font file. Anything that fails stays a remote link.

4. The background-image cache gets the same treatment

LazyLoad for CSS background images copies stylesheets into wp-content/cache/background-css/. The function that turns a stylesheet URL into a file path, FilesystemCache::generate_path(), was this in 3.24.1:

return $root_path . $parsed_url_host . '/' . $parsed_url_path;

Same problem: no .. handling and no extension check. In 3.24.2 it resolves dot segments, refuses names that don’t end in .css or .css.json, refuses inner script extensions like .php, .phtml or .phar, and checks the result is still inside the cache folder. If any of that fails, the stylesheet isn’t fetched at all. A fifth change stops WP Rocket treating a link as a stylesheet just because the text rel=stylesheet appears somewhere inside the tag. It now reads the tag’s actual rel attribute. That one matters because a preconnect hint could otherwise be passed off as a stylesheet.

Do the two settings really gate it?

From the code, yes. The fonts download only runs when host_fonts_locally is on, and the background-image copy only when lazyload_css_bg_img is on. These are the only two places in the fix that write downloaded content to disk. The beacon and preconnect hints are on by default, but on their own they only store and print text. That matches what both WP Rocket and Patchstack say.

One thing we couldn’t fully square. The vulnerable background-image function is word for word the same in 3.15 as in 3.24.1, which fits the “from 3.15” range. But the fonts feature first appears in 3.18 and the beacon’s preconnect hints in 3.19. We didn’t trace how an attacker would reach the background-image path on 3.15 to 3.18. Treat the whole 3.15 to 3.24.1 range as affected, as the vendor does.

About the helper plugin

For agencies with lots of sites, WP Rocket published a small plugin, “WP Rocket | Mitigate CVE-2026-125812”, in its wp-rocket-helpers repository. We read it. It forces both settings off, and keeps them off if someone saves the settings page, but only while WP Rocket is older than 3.24.2. On multisite you activate it on each subsite. It doesn’t patch WP Rocket’s code and it doesn’t scan or clean anything. It’s a stopgap for sites you can’t update today, mainly ones with an expired licence.

Check your site, in this order

Back up files and database first, even if the site may be dirty: you’ll want the evidence. Run the commands from your WordPress folder.

1. Find your WP Rocket version

In wp-admin, it’s on the Plugins screen. With WP-CLI:

wp plugin get wp-rocket --field=version

3.24.2 or higher means you’re patched against new attempts. On a multisite network, WP Rocket is installed once, so one check covers it.

2. See whether either setting is on

wp option pluck wp_rocket_settings lazyload_css_bg_img
wp option pluck wp_rocket_settings host_fonts_locally

1 means on. On multisite, add --url= for each subsite. If both are 0 and always have been, the documented attack paths weren’t open on your site. If you don’t know their history, assume they might have been on.

3. Update

wp plugin update wp-rocket

This needs an active licence. Without one, turn both settings off and keep them off, or use the helper plugin. The rest of this list is about what happened before you updated.

4. Look where the files would land

The vulnerable code writes under wp-content/cache/fonts/ and wp-content/cache/background-css/, and with ../ it can climb out into wp-content/ and beyond. Patchstack’s indicators are PHP files named like wp-media-*.php in wp-content/, wp-content/uploads/ and wp-content/wp-rocket-config/.

find wp-content -name 'wp-media-*.php'
find wp-content/cache/fonts wp-content/cache/background-css -type f -name '*.php'
find wp-content/uploads -name '*.php'
ls -la wp-content/wp-rocket-config/

The two cache folders should hold only CSS, JSON and font files. The wp-rocket-config folder normally holds one PHP file per site, named after your domain, like example.com.php, plus a few JSON files. Any other PHP file in there needs a look. Don’t search only by name: attackers rename files once a name is public.

5. Find recently changed PHP files without trusting dates

Malware often backdates its files so -newermt misses them. The “changed” time is set by the system and is much harder to fake:

find wp-content -name '*.php' -newerct '2026-11-23'
wp core verify-checksums
wp plugin verify-checksums --all

Every plugin you’ve updated since then will show up, WP Rocket included, and premium plugins can’t be checked against WordPress.org. You’re looking for PHP files you can’t explain.

6. Check administrators and must-use plugins

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
wp plugin list --status=must-use
ls -la wp-content/mu-plugins/

A dropped PHP file can create users and install anything. Look for admins created since late November and must-use plugins you didn’t add. Must-use plugins load on every request and never show on the normal Plugins screen. Since a must-use plugin can hide users from WP-CLI too, also ask the database (change wp_ if wp db prefix says otherwise):

wp db query "SELECT u.ID, u.user_login, u.user_registered FROM wp_users u JOIN wp_usermeta m ON m.user_id = u.ID WHERE m.meta_key = 'wp_capabilities' AND m.meta_value LIKE '%administrator%'"

7. Look for what the beacon stored

This check comes straight from the code. The beacon’s domain reports are kept in their own table, and 3.24.2 skips bad rows when it prints them but doesn’t delete them. A row with a path or query string, or a nip.io or trycloudflare.com host, means someone tried:

wp db query "SELECT url, domains, created_at FROM wp_wpr_preconnect_external_domains WHERE domains LIKE '%nip.io%' OR domains LIKE '%trycloudflare%' OR domains LIKE '%googleapis%'"

Real Google Fonts entries match the last condition, so read the rows. Old rows get cleared over time, so empty isn’t proof, and a hit shows an attempt, not success.

8. Check your logs

Real visitors send beacon requests all day, so the endpoint alone proves nothing. Patchstack suggests looking for beacon requests from clients that never loaded the page they report on, and for your server connecting out to nip.io names or trycloudflare.com tunnels, which your host can check better than you. Patchstack also lists the ten IPs behind the most blocked attempts.

Does updating clean a hacked site?

No. WP Rocket’s advisory says so plainly: “Any files or accounts an attacker already created require separate investigation.” 3.24.2 stops new files being written. A PHP file that’s already sitting in wp-content runs just the same after the update. If you find one, treat the whole site as compromised: remove the files, delete accounts you didn’t create, change every admin password, replace the keys in wp-config.php (wp config shuffle-salts), change your database and hosting passwords, and reinstall core, plugins and themes from fresh copies. Then tell your host. We walked through that whole list after a server breach in our shared hosting breach checklist.

It’s the same pattern as the Ninja Forms attacks in October: a quiet fix, then the advisory, then attacks within days. That’s why we keep a running list of this year’s WordPress security updates. Credit to WP Rocket for fixing it before anything was public.

Frequently asked questions

I’m on WP Rocket 3.24.1 but both settings are off. Am I at risk?

Not through the documented attack paths. The code that writes downloaded files only runs when LazyLoad for CSS background images or Self-host Google Fonts is on. Update anyway, because a setting can be switched on later and 3.24.2 also tightens what the beacon stores.

Is “Host Fonts Locally” a different setting from “Self-host Google Fonts”?

No. Self-host Google Fonts is the label on the WP Rocket settings screen. Host Fonts Locally is the name used inside the plugin’s code and logs, and some news reports used it. The stored option is called host_fonts_locally.

Will updating to 3.24.2 remove anything an attacker planted?

No. The update stops new files being written, but files and accounts created before it stay in place and keep working. Check wp-content, uploads, wp-rocket-config, mu-plugins and your administrator list, and clean up anything you find.