Your WP Rocket Plugin Is Dangerous: Here’s What to Fix
Two settings in WP Rocket can make your WordPress site faster. On a vulnerable version, turning on either one could let a stranger run code on your server. They wouldn’t even need a WordPress account.
WP Rocket released the fix on November 19th. Six days later, security firm Patchstack spotted the first attack attempt in its logs. By the following day, it was blocking tens of thousands of attempts.
I’m Dustin Gray, and I’ve been building production software for 25 years. If you use WP Rocket, I’ll show you how to tell whether your site was exposed and what to check even if you’ve already updated.
Let’s start with the two settings. The first is called Lazy Load for CSS Background Images. It delays loading a background image until someone scrolls close to it.
The second is called Self-Host Google Fonts. It lets your site serve its own copy of a font. Both settings are off by default, but if you’ve ever tried to improve your page speed score, you may have switched one on.
So, was your site exposed? WP Rocket runs on more than 5.5 million websites, and the number exposed to this flaw is unknown. For your site to have been at risk, two things had to be true at the same time.
First, you were running WP Rocket version 3.15 through 3.24.1. Second, at least one of those two settings was on. Either setting was enough.
So, how does a feature that loads images or fonts let somebody run code? When someone visits a page, WP Rocket asks their browser to send back a report. The plugin uses that report to decide which files to fetch and save on your site.
Here’s where it went wrong. The vulnerable plugin trusted file addresses in that report without checking them carefully enough. Someone could send a false report and trick the site into saving a file containing their own code.
They could then run that code on your server. That’s what the security advisory calls remote code execution. The flaw carries a severity score of 9.8 out of 10, and attackers move quickly.
On November 25th, Patchstack saw what looked like someone testing the flaw by hand. By November 26th, automated attacks were hitting sites at scale. That six-day gap was the time between the fix coming out and the first attempt Patchstack saw.
Here’s what to check today. Open your WordPress dashboard and go to Plugins. Find WP Rocket and look at the installed version.
Version 3.24.2 contains the fix. If you’re running an affected version, update now. Then check the plugin screen again to make sure you’re on 3.24.2 or later.
If you can’t update yet, turn off both settings. Open WP Rocket, go to Page Optimization, then open Image and Media. On versions before 3.24, open the Media tab instead.
Switch off Lazy Load for CSS Background Images. Switch off Self-Host Google Fonts. Save your changes, confirm both are off, and leave them off until you’ve installed the fix.
If you manage several sites, WP Rocket also has a helper plugin that can switch both settings off in bulk.
Now, what if you’ve already updated? If either setting was on while you were running a vulnerable version, the update closes the flaw. But an attacker who got in beforehand may still have access.
Ask your host or web team to check three things. First, look for unexpected PHP files. Start in the wp-content folder itself, then check the uploads and wp-rocket-config folders inside it.
Patchstack saw file names starting with wp-media and ending in .php. A name like that is a reason to inspect the file.
Second, check your WordPress administrator accounts. Can your team account for everyone on that list?
Third, check the server logs. Remember the report that a visitor’s browser sends to WP Rocket? Ask your host to look for reports from visitors who appear never to have loaded the page, because that’s a clue worth investigating.
If your team confirms a malicious file or an unauthorised administrator account, treat the site as compromised. Deleting the first thing you find can leave another way in.
If someone else looks after your website, here’s the question I’d send them today. Was either of those WP Rocket settings on before we patched? And if it was, did we check whether anyone got in?