Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/hassham1/cve-2026-120019-w3tc-mfunc-comment-xss-poc
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityLabs & Practice
GitHubhassham1/cve-2026-120019-w3tc-mfunc-comment-xss-poc

CVE-2026-120019-w3tc-mfunc-comment-xss-poc

Docker lab and Python PoC reproducing CVE-2026-120019, an unauthenticated stored XSS in W3 Total Cache <= 2.10.7 via predictable minify placeholder tokens, with a patched 2.11.0 control.

View Repository
15 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    989
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    576
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    354
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    339
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    323
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    315

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-120019 - W3 Total Cache Predictable Minify Placeholder Stored XSS Validation Lab

Security-research material for reproducing and validating CVE-2026-120019: W3 Total Cache <= 2.10.7 lets an unauthenticated commenter plant forged minify-placeholder tokens in comment content; when an HTML-minify pass runs with the predicted md5(time()) namespace, the ignored-comment preserver splices the comment's raw stem-comment content into the attacker's attribute value - script-capable attributes mount outside any comment context, and with page cache enabled the poisoned HTML is served to every subsequent visitor.

  • Affected: W3 Total Cache <= 2.10.7 (preserver namespace code unchanged through 2.10.4-2.10.6; verified identical there)
  • Fixed: 2.11.0 - placeholder namespace from random_bytes(16) plus a collision guard (_ensurePlaceholderHash) that extends the hash until it does not occur in the source HTML; the same hardening applied to Minify_HTML's 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']) namespace
  • CVSS 3.1: 5.4 (AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N) - CWE-79
  • Auth: none; but exploitation requires HTML Minify enabled with the default mfunc entry present in the ignored-comment stems list, and the attacker must predict the md5(time()) placeholder namespace by reading the server clock from the HTTP Date response header within the applicable time window

Use only on systems you own or are explicitly authorized to test. The PoC posts inert comments (the payload marker only sets a JS variable) and writes nothing to disk.

Verdict

Status: proven in the supplied lab.

W3 Total Cache 2.10.7 (WordPress 7.1.2, page cache Disk Enhanced + HTML minify with default stems, commentable post):

comment posted : stem comment + 15 forged md5(time()) placeholder tokens
result         : render with minify pass at a predicted second splices the
                 raw stem comment into an attacker title attribute -
                 autofocus/onfocus escape the comment context
2.10.7 persist : injection served from the page cache to a fresh anonymous
                 GET (stored, not one-shot)
2.11.0         : namespace unpredictable + collision guard; payload inert
                 across the full attempt budget (patched negative control)

The PoC asserts the injected markup (event-handler attributes mounted on an anchor chosen by the attacker) rather than driving a browser; whether autofocus+tabindex triggers focus handlers on load is browser-dependent, but the injection primitive - arbitrary attacker HTML/attributes spliced into a live element context - is the XSS sink the advisory describes, and any script-capable attribute vector the target's output context allows lands the same way.

Root cause (verified against the 2.11.0 fix)

The pipeline. With minify.enabled + minify.html.enable, Minify_Plugin::ob_callback() runs minify_html() over every HTML page render (Minify_Plugin.php:367-371). The HTML-minify pass preserves the configured "ignored comment stems" - by default google_ad_, RSPEAK_, mfunc (ConfigKeys.php:985-995) - across minification using Minify_IgnoredCommentPreserver (Minify_Plugin.php:628-635).

The predictable namespace. The preserver's placeholder tokens are %%IgnoredCommentPreserver_<hash>_<index>%% where the hash is

// lib/Minify/Minify/IgnoredCommentPreserver.php:10, W3TC 2.10.7
$this->_replacementHash = 'IgnoredCommentPreserver_' . md5(time());

second-resolution and fully predictable from any Date response header.

The blind restore. After minification, every token is swapped back with its stored raw comment - no escaping, no context awareness:

// IgnoredCommentPreserver.php:28-33, 2.10.7
public function replace($html) {
    $html = str_replace(array_keys($this->_placeholders),
        array_values($this->_placeholders), $html);

str_replace matches the token text anywhere in the document - including inside attacker-supplied attribute values. Stem-matching is case-insensitive stristr, so a commenter's <!--mfunc ... --> (which wp_kses keeps verbatim because it is an HTML comment) is reserved raw and re-emitted raw.

The fix. 2.11.0 replaces the namespace with CSPRNG output and, decisively, extends it while it occurs anywhere in the source HTML - planted token text can never collide with a real placeholder:

// lib/Minify/Minify/IgnoredCommentPreserver.php, W3TC 2.11.0
protected function _ensurePlaceholderHash( $source = null ) {
    if ( ! \is_string( $this->_replacementHash ) || '' === $this->_replacementHash ) {
        $this->_replacementHash = 'IgnoredCommentPreserver_' . \bin2hex( \random_bytes( 16 ) );
    }
    while ( \is_string( $source ) && false !== \strpos( $source, $this->_replacementHash ) ) {
        $this->_replacementHash .= \bin2hex( \random_bytes( 8 ) );
    }

The same _ensurePlaceholderHash pattern was applied to Minify_HTML's own placeholders ('MINIFYHTML' . md5($_SERVER['REQUEST_TIME']) in 2.10.7) - a second, equally predictable collision domain the advisory title does not name; this lab does not exercise it.

Exploitation flow (as validated)

  1. Target any page with anonymous comments whose URL is rendered through HTML minify (default stems untouched) - the lab: a single post with comments open, page cache Disk Enhanced.
  2. Read the server clock from an uncached response (Date header) and post one comment containing:
    • a stem comment <!--mfunc " autofocus tabindex=1 onfocus=... x=" --> (quote-only body survives wp_kses intact - angle brackets get stripped or entity-encoded), and
    • anchors whose title attributes are forged tokens %%IgnoredCommentPreserver_md5(T)_i%% for each candidate second T in the window and reservation index i (each existing stem comment on the page shifts the index).
  3. Trigger a render within the window (the comment POST's own redirect target is the first candidate render). On a namespace hit, the restore pass splices the raw comment into the anchor's title attribute: the quote closes, and autofocus tabindex=1 onfocus=window.CVE120019X=1 mount as live attributes of the anchor.
  4. The caching render stores the poisoned HTML; every subsequent anonymous visitor is served it from the page cache - the "stored" in stored XSS.

Quick start

Requirements: Docker with Compose v2, Python 3.10+ on the host.

./lab verify

Builds the 2.10.7 lab, requires the injection to fire (and to persist in the page cache), then builds the 2.11.0 lab and requires its absence. Remove everything with ./lab reset.

Expected evidence

Vulnerable control:

[!!!] PLACEHOLDER-TOKEN INJECTION CONFIRMED (stored XSS)
  posted  : comment with 15 forged md5(time()) placeholder tokens
  evidence: raw ignored-stem comment spliced into a title attribute;
            autofocus/onfocus escapes the comment context
  context : ...title=<!--mfunc " autofocus tabindex=1 onfocus=window.CVE120019X=1 x=" --> ...
  persist : injection served from the page cache to a fresh anonymous GET
            (stored, not just one-shot)
RESULT: VULNERABLE CONTROL CONFIRMED

Patched control:

[*] payload present but inert on this render (md5(time()) namespace did not
    match a planted token)
[=] injection not observed within the attempt budget. Either the plugin is
    patched (>= 2.11.0: random_bytes namespace + collision guard) or every
    render second fell outside the predicted window.
RESULT: PATCHED CONTROL CONFIRMED

A marker present only inside the intact HTML comment is not accepted as proof; the stem comment's content must appear outside comment context, spliced into the attacker's attribute (the title=...<!--mfunc signature adjacency in the PoC regex).

Manual lab lifecycle

Download Tool