Your caching plugin is supposed to make your site faster. For six days in late November, on millions of WordPress sites, it could also make an attacker's code run — no login required, two HTTP requests, and your server quietly saving a stranger's PHP file as if it were a stylesheet.

The flaw is CVE-2026-125812, a critical path traversal bug in WP Rocket, WP Media's premium caching plugin. It scores 9.8 on the CVSS scale, and it is not a theoretical one: Patchstack, the company that issued the CVE, recorded the first exploitation attempt on November 25, 2026 at 15:27 UTC — three hours after the CVE was published — and by the next day the attempts had become automated campaigns, tens of thousands of blocked requests in a single day. If you manage WordPress sites, this is a hands-on audit you can run today.

01What happened, in six dates

Researcher Vorelito reported the flaw to Patchstack's bug bounty program on November 4, 2026. WP Media shipped the fix quietly in WP Rocket 3.24.2 on November 19 — its changelog carried a single understated line: "Improve validation of cached CSS, font and preconnect files." The CVE was published on November 25 at 12:09 UTC. The first attack followed at 15:27 UTC the same day. By November 26, exploitation was automated, and WP Rocket released 3.24.3, a feature and bugfix release that is not the security floor — 3.24.2 is.

That six-day gap between fix and public disclosure is exactly the window attackers love: the patch existed, but most sites had not installed it, and the disclosure told everyone — including the bots — where to look.

WP Media's own advisory says the flaw affects WP Rocket versions 3.15 through 3.24.1, and only when one of two optional features is switched on: "LazyLoad for CSS background images" or "Self-host Google Fonts" (also called "Host Fonts Locally"). The CVE record is broader, listing every version before 3.24.2. Both features are off by default — but they are exactly the kind of thing a performance-tuned site turns on, and WP Media says the plugin runs on more than 5.5 million websites. The exposed population is large even if it is a fraction of the total.

02How two requests become a shell

WP Rocket measures pages in the visitor's browser. A small script records things like which background images and fonts a page uses, then reports the results back to the site through WordPress's public AJAX endpoint: POST /wp-admin/admin-ajax.php with action=rocket_beacon. WP Rocket then uses those reported URLs to fetch and cache the CSS and font files the page needs.

The problem is that the plugin trusted those reported URLs. It did not validate them strictly enough. A crafted beacon report can include a URL full of ../ segments, and WP Rocket will happily follow it — fetching content from a server the attacker controls and writing it to disk as a PHP file, outside the cache directory it was supposed to stay in. The attacker then requests that file in a browser, and the server executes it. Two requests, no authentication, and the attacker has remote code execution as the web server user.

The vulnerable code lives in two functions, one per feature: FilesystemCache::generate_path() handles the lazy-loaded CSS background images, writing processed copies under wp-content/cache/background-css/; Fonts\Filesystem::write_font_css() handles the locally hosted fonts, writing under wp-content/cache/fonts/. Neither resolved the .. segments, validated the host, or restricted the file extension before writing. The traversal is the root flaw, classified as CWE-22; the PHP execution is what it buys.

03Step 1: inventory your fleet

If you manage one site, the Plugins page in the dashboard shows the version. If you manage a fleet, WP-CLI is the fastest way. Run these as the site's user, from the WordPress directory:

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

The first command prints the installed version. The next two print 1 if the dangerous feature is on, empty if it is off. Anything below 3.24.2 combined with a 1 on either option is exploitable. For a fleet, loop the same three commands over every site root:

for d in /var/www/*/; do
  echo "== $d"
  (cd "$d" && wp plugin get wp-rocket --field=version 2>/dev/null)
done

Note that WP Rocket is a commercial plugin, so it does not appear in the WordPress.org directory — check the plugin folder directly if WP-CLI reports nothing. And do not assume auto-update ran: confirm the running version on each site.

04Step 2: read the verdict

Your situationWhat it means
3.24.2 or newer, updated before November 25Not exposed during the known attacks
Below 3.24.2, both features off the whole timeNot on the vulnerable path — update anyway
Below 3.24.2, either feature onExposed — patch now, then hunt for compromise

If you cannot tell which sites had either option on, treat every WP Rocket site as exposed. The settings are one toggle away from the vulnerable path, and the safe assumption is cheaper than the wrong one.

05Step 3: patch — or neutralize, if you cannot patch yet

Update WP Rocket to 3.24.2 or later on every site, including client and staging sites. That closes the hole. If a site's licence has lapsed and you cannot update right away, switch both features off under WP Rocket → Page Optimization → Image & Media, or use WP Rocket's own mitigation plugin, wp-rocket-mitigate-cve-2026-125812.zip, which forces both options to zero through filters while a vulnerable version is installed:

wp plugin install ./wp-rocket-mitigate-cve-2026-125812.zip --activate

This is a stopgap, not a fix. The vulnerable code is still there; the features are just switched off. Update as soon as you can.

06Step 4: hunt for planted files

Updating does not remove a file an attacker already planted. If a site was exposed, check for it before you declare the job done.

First, look for PHP where it should never be — cache directories hold CSS, fonts, and images, not code:

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

Patchstack's indicators include unexpected PHP files in wp-content/wp-rocket-config/, in wp-content/uploads/, or directly in wp-content/ — files named like wp-media-*.php are a known pattern. Check wp-content/mu-plugins/ too; anything you do not recognize there is worth a closer look.

Second, check the logs. Every attack starts with a POST to the beacon endpoint, so search your web server logs for requests to /wp-admin/admin-ajax.php with action=rocket_beacon since November 25:

grep 'rocket_beacon' /var/log/nginx/access.log | grep '25/Nov/2026'

Legitimate beacon traffic exists — the script runs on every visit — so you are looking for the odd ones out: bursts from a single IP, requests with strange payloads, or beacon hits on sites that never had the features on. Wordfence and Sucuri have both published signatures for this endpoint abuse if your WAF or security plugin can use them.

Third, check for the aftermath: unfamiliar administrator accounts under Users, new plugins you did not install, and scheduled tasks or cron entries you do not recognize. A webshell planted on November 25 has had a week to do its work.

One caution: do not run WP-CLI as root on a site you suspect is infected. WP-CLI loads the site's code — including any attacker files — so running it as root can hand the attacker root. Investigate as an unprivileged user, or from a clean copy of the site.

07Step 5: if you find something, assume the worst

A planted file means the attacker had code execution, and code execution means they could have done anything the web server user can do: read configuration files, steal database credentials, add admin accounts, and pivot. Restore from a clean backup taken before November 25, rotate every secret the site touches — WordPress admin passwords, hosting and database credentials, salts and keys — and have the site professionally cleaned if you are not sure you found everything. A single deleted file is not proof the attacker is gone.

08The lesson is the endpoint

The technical fix in 3.24.2 is a few lines of validation. The real lesson is architectural: WP Rocket built a public endpoint that accepts URLs from anonymous visitors and then fetches and writes those URLs to disk. That is a trust boundary, and it was drawn in the wrong place — the browser's report was treated as a request from the site owner rather than as untrusted input from a stranger.

Every plugin you install adds endpoints like this one. Most of them never make the news. The audit above is not really about WP Rocket; it is a habit worth building for any plugin that touches the filesystem on behalf of anonymous visitors: know what version you run, know which of its features are on, and know what files it is allowed to write — before the bots do.

Update to 3.24.2, check your cache directories for PHP that should not be there, and treat a quiet log as an open question until you have actually looked.

09Sources

  • Patchstack — "Critical WP Rocket RCE (CVE-2026-125812) Under Active Attack" — https://patchstack.com/articles/critical-wp-rocket-rce-cve-2026-125812-under-active-attack/
  • NVD entry for CVE-2026-125812 — https://nvd.nist.gov/vuln/detail/CVE-2026-125812
  • Malware News — "WP Rocket Vulnerability CVE-2026-125812 Lets Attackers Plant PHP Files" — https://malware.news/t/wp-rocket-vulnerability-cve-2026-125812-lets-attackers-plant-php-files/127771
  • InstaWP — "WP Rocket Vulnerability CVE-2026-125812: What To Know" — https://instawp.com/wp-rocket-rce-cve-2026-125812/
  • Code404Zero — "WP Rocket Vulnerability: Attackers Plant PHP via the Cache" — https://code404zero.com/en/wp-rocket-vulnerability-cve-2026-125812/
written by

kou documents what’s learned about threat intel, attack surface, and practical defense — from the dark side of the internet.