Attackers exploit critical code injection flaw in WordPress plugin WP Rocket
The WP Rocket plugin for WordPress has a critical flaw that lets attackers inject and execute arbitrary code.
(Image: heise medien)
A critical security flaw in the WP Rocket caching plugin for WordPress lets attackers on the internet inject and execute malicious code (RCE, remote code execution). They don’t need to log in first. According to Patchstack, WP Rocket runs on more than 5.5 million websites. IT security researchers are already observing attacks exploiting the vulnerability in the wild.
IT security firm Patchstack warns of the flaw in a security advisory. According to the vulnerability description, inadequate validation of a path name allows access to directories that should be restricted — a so-called path traversal vulnerability. It affects WP Rocket versions 3.15 through 3.24.1 and was fixed in version 3.24.2 (CVE-2026-125812, CVSS 9.8, risk: “critical”). Patchstack provides more detail in its analysis: Attackers can write and execute PHP code on vulnerable installations. The only requirement is that either “LazyLoad for CSS background images” or “Host Fonts Locally” is enabled in WP Rocket. Both options are disabled by default, but the researchers say they are commonly used on performance-optimized installations.
Patchstack first observed attacks exploiting the vulnerability last Wednesday, Nov. 25, 2026. Since then, the number of attack attempts has risen sharply, the IT researchers say.
Browser reports provide an entry point
The Patchstack researchers explain that WP Rocket runs a script in website visitors’ browsers to measure each page and send the results to a publicly accessible AJAX endpoint. WP Rocket uses the returned URLs to optimize pages, but does not check them adequately. Attackers can send manipulated reports, causing the vulnerable website to download content from servers controlled by the attackers and save it as a PHP file. That code then runs on the server.
Videos by heise
The IT security researchers also list several indicators of compromise (IOC) that can help admins investigate whether their systems have been exploited. These include unexpected PHP files with names such as “wp-media-*.php” in “wp-content/”, “wp-content/uploads/” or “wp-content/wp-rocket-config/”, as well as outgoing connections from the web server to unknown hosts, “nip.io” names or “trycloudflare.com” tunnels. IT administrators should now check systems running WP Rocket on their WordPress installations where these vulnerable options are enabled.
They should also make sure they have installed the patched version of WP Rocket, 3.24.2 or later. If that isn’t immediately possible, they should disable “LazyLoad for CSS background images” and “Host Fonts Locally.” The update also does not remove files attackers may have already placed on the system.
(dmk)