WP Rocket 3.24.2 fixes CVE-2026-125812: cache path traversal rated as unauthenticated RCE (CVSS 9.8)
WP Rocket before 3.24.2 let crafted URLs write fetched content outside its CSS and font caches. Patchstack rates it as unauthenticated RCE. Update to 3.24.2 now.
WP Media has fixed a critical vulnerability in WP Rocket, the premium WordPress caching plugin, in version 3.24.2 (released November 19, 2026). The flaw, tracked as CVE-2026-125812, was publicly disclosed by Patchstack this week. It is a path traversal (CWE-22) in how the plugin maps remote URLs to files on disk, and Patchstack classifies it as unauthenticated remote code execution. The CNA-supplied CVSS v3.1 score is 9.8.
All versions before 3.24.2 are affected. The official changelog entry is a single line: "Security: Improve validation of cached CSS, font and preconnect files".
What went wrong
According to ZeroPath's analysis of the v3.24.1...v3.24.2 diff, the "LazyLoad for CSS background images" feature caches rewritten stylesheets under wp-content/cache/background-css/. The on-disk location came from FilesystemCache::generate_path(), which simply joined the URL's host and path onto the cache root:
..segments in the path were never resolved,- the host was not validated (a URL like
http://../xput..straight into the path), - the file name and extension were not restricted.
So a crafted URL could make the plugin write fetched content (served from a server the attacker controls) to an arbitrary location under an arbitrary name, such as a .php file in the web root. The "Host Fonts Locally" code (Fonts\Filesystem::write_font_css()) had the same pattern.
What 3.24.2 changes
- Host validation rejects empty hosts,
.., separators,:and control characters. - Paths are normalized from a rooted
/, so..clamps at the host directory. - Cached CSS must end in
.cssor.css.json. Names with embedded executable extensions (x.php.css,x.phtml.css,x.cgi.css) and dot files like.htaccessare refused. - A final
realpathcontainment check makes sure the result stays inside the cache root. - Local fonts must match a strict font-path pattern, and the downloaded bytes must start with a real WOFF2/WOFF/TTF/OTF/EOT signature.
Exploitation status
Patchstack expects the bug to be exploited. However, the sources reviewed by ZeroPath don't confirm exploitation in the wild, and there is no public exploit. Rapid7 lists it as not in CISA KEV. The issue was reported by researcher Vorelito.
What to do
- Update WP Rocket to 3.24.2 or later on every site. It's a premium plugin, so check that each site's licence is still active and that auto-updates actually reach it.
- If you can't update right away, consider temporarily turning off LazyLoad for CSS background images and Host Fonts Locally.
- Look in
wp-content/cache/and the web root for unexpected.php,.phtmlor.htaccessfiles created recently. - Block PHP execution in
wp-content/cache/andwp-content/uploads/at the web-server level as defence in depth.
Sources: ZeroPath CVE-2026-125812 analysis, WP Rocket changelog.
Stuck on an old WordPress or PHP stack where updating plugins breaks things? RescuePHP can help you patch, harden and upgrade legacy sites safely.