WP Rocket Font Optimization Path Traversal to RCE (CVE-2026-125812)
Published: 2026-11-27 • Researcher: Joshua van der Poll (PoC); Patchstack (advisory)
- Severity
- Critical
- CVE
- CVE-2026-125812
- Category
- web
- Affected product
- WP Rocket WordPress plugin (font optimization / lazy CSS pipeline)
- Affected versions
- WP Rocket before 3.24.2
- Disclosed
- 2026-11-27
- Patch status
- Unverified
References
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-11-26 |
| Author / Researcher | Joshua van der Poll (PoC); Patchstack (advisory) |
| CVE / Advisory | CVE-2026-125812 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1) |
| Status | Weaponized (lab-validated) |
| Tags | path-traversal, WP Rocket, WordPress, unauthenticated, file-write, RCE, CWE-22 |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | WP Rocket WordPress plugin (font optimization / lazy CSS pipeline) |
| Versions Affected | WP Rocket before 3.24.2 |
| Language / Platform | PHP / WordPress; Python 3 exploit client |
| Authentication Required | No |
| Network Access Required | Yes (target HTTP and attacker callback reachable by the target) |
Summary
CVE-2026-125812 is an unauthenticated path traversal in WP Rocket’s font optimization pipeline. The exploit harvests the public beacon nonce from any page, posts a crafted preload fonts parameter to the unauthenticated rocket beacon AJAX endpoint, and causes WP Rocket to fetch a CSS file from an attacker-controlled callback. A font URL rule inside that CSS contains a traversal path under the fonts cache directory; WP Rocket writes the fetched font content to that resolved path, allowing an arbitrary file write into the WordPress webroot. Writing a PHP file turns the primitive into remote code execution.
Vulnerability Details
Root Cause
The font optimization code builds the destination path from the URL path without confining it to the fonts cache directory. The attacker-supplied font URL can embed //fonts.googleapis.com/css to satisfy the Google-font check, while its url() points at a traversal such as ../../wp-content/uploads/shell.php. FilesystemCache::set() then writes the response body to the traversed path.
Attack Vector
- GET any public page and extract
rocket_beacon_data(the anonymous nonce is identical for all visitors). - POST to
wp_ajax_nopriv_rocket_beaconwithaction=rocket_beaconand apreload_fontsURL that embeds//fonts.googleapis.com/css. - On the next page visit, WP Rocket fetches the CSS from the attacker callback, parses the
url(), downloads the “font”, and writes it to the traversal path. - Request the written PHP file to execute commands.
Impact
Unauthenticated arbitrary file write under the WordPress webroot, leading to remote code execution as the web server user. The write can overwrite files or drop a webshell; the PoC ships a callback server that delivers the CSS and the shell payload.
Environment / Lab Setup
OS: Linux with Docker and Docker Compose
Target: WordPress 6.6 + PHP 8.1 + WP Rocket 3.24.1 (vulnerable) on localhost:8080
Callback: Attacker HTTP server (Python) serving CSS + shell payload
Attacker: Python 3 with requests
Tools: docker compose, python3Setup Steps
| |
The repository’s docker/ lab includes a three-container setup (MariaDB, WordPress + WP Rocket 3.24.1, attacker callback). The WP Rocket plugin ZIP is not vendored in this archive; fetch it from the upstream repository or WordPress.org for lab use.
Proof of Concept
Step-by-Step Reproduction
- Fingerprint the target and extract the WP Rocket beacon nonce from a public page.
- Inject the crafted
preload_fontsURL throughwp_ajax_nopriv_rocket_beacon. - Serve the malicious CSS from the callback: it includes a
url()with a traversal path ending in a PHP file under the webroot. - Trigger a page visit so WP Rocket processes the font and writes the payload.
- Execute the written PHP file, e.g.
/wp-content/uploads/shell.php?cmd=id.
Exploit Code
See
CVE-2026-125812.py, the minimalCVE-2026-125812.min.py, and theserver/+docker/callback/lab files.
The exploit is a two-request chain plus a callback; the full script adds fingerprinting, target lists and a minimal PoC variant.
Expected Output
| |
Detection & Indicators of Compromise
preload_fontsvalues containing//fonts.googleapis.com/csscombined with traversal sequences.- Requests to
wp-admin/admin-ajax.phpwithaction=rocket_beaconfrom unauthenticated clients carrying unusual font URLs. - New PHP files under
wp-content/uploads/or the fonts cache directory. - Outbound requests from the WordPress host to an unexpected callback domain during font optimization.
- WP Rocket version below 3.24.2.
SIEM / IDS rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade WP Rocket to 3.24.2 or later. |
| Workaround | Disable WP Rocket font optimization / lazy CSS until patched; block unauthenticated rocket_beacon font injection at the WAF. |
| Config Hardening | Restrict outbound HTTP from WordPress, monitor webroot writes, and keep the plugin current. |
References
Notes
Reviewed from the 2026-11-27 watchlist. The repository is a real exploit with a three-container lab and a callback server, not a detector or scanner; it is GPL-3.0 licensed (LICENSE.md retained). The WP Rocket plugin ZIP and demo images are not copied into this archive (binary/media assets); the callback server, Docker lab files and exploit clients are included.
The exploit was not executed during preparation. The lab is loopback/local and the PoC is for authorized testing only.
| |