CVE-2024-4458
Executive Summary
CVE-2024-4458 is a Stored Cross-Site Scripting (XSS) vulnerability in the Themesflat Addons For Elementor WordPress plugin, affecting all versions up to and including 2.1.2. The flaw resides in multiple widgets where URL parameters are insufficiently sanitized and output-escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts into pages. When a user visits the compromised page, the injected script executes in the context of the victim’s browser, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is specific to the WordPress ecosystem and does not involve Apache or Nginx directly. The plugin extends Elementor, a popular page builder, and the insecure handling of URL parameters in its widgets creates the attack vector.
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 is a WordPress plugin vulnerability, not an NPM, PyPI, Go, or Ruby package. However, the plugin is distributed via the WordPress plugin repository and can be installed through the WordPress admin dashboard. Users should verify the integrity of the plugin by checking its checksum against the official repository. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (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)
- User Interaction: Required (Victim visits page)
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
The medium severity reflects the need for authenticated access and user interaction, but the potential for widespread exploitation in multi-author WordPress sites is significant.
Deep Dive & Mechanics
The vulnerability exists in several widgets provided by the Themesflat Addons For Elementor plugin. These widgets accept URL parameters (e.g., via $_GET or $_POST) and render them directly into the page without proper sanitization or output escaping. Specifically, the plugin fails to use WordPress’s built-in escaping functions like esc_url(), esc_html(), or wp_kses() on user-supplied URL parameters before outputting them in the widget’s HTML.
An attacker with contributor-level access can create or edit a page using the vulnerable widget. By crafting a malicious URL parameter (e.g., ?param=<script>alert('XSS')</script>), the injected script is stored in the page content. When any user (including administrators) visits the page, the script executes in their browser.
The attack flow:
- Attacker logs in with contributor credentials.
- Creates a new page or edits an existing one using a vulnerable widget.
- Inserts a malicious payload into a URL parameter field (e.g., a custom link or attribute).
- Publishes the page.
- Victim visits the page → script executes.
Vulnerable vs. Patched Code
Vulnerable Code (example from widget):
// In a widget's render method
$url_param = $_GET['custom_url'];
echo '<a href="' . $url_param . '">Click here</a>';
Patched Code (expected fix):
// Properly escape the URL
$url_param = isset($_GET['custom_url']) ? esc_url($_GET['custom_url']) : '';
echo '<a href="' . $url_param . '">Click here</a>';
The patched version uses esc_url() to sanitize the URL, preventing script injection. Additionally, all output should be escaped with esc_html() or wp_kses() as appropriate.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- WordPress site with Themesflat Addons For Elementor <= 2.1.2 installed and active.
- Attacker account with Contributor role or higher.
Steps:
- Log in to WordPress as a contributor.
- Create a new page or edit an existing one.
- Add a vulnerable widget (e.g., "Custom Link" or "Button").
- In the URL parameter field, enter:
javascript:alert(document.cookie)or a crafted XSS payload like" onmouseover="alert(1)". - Publish the page.
- Send the page link to the victim.
Example Payload:
" onfocus="alert('XSS')" autofocus="
Lab Setup:
- Use a local WordPress instance (e.g., via Docker) with the vulnerable plugin.
- Install a debugging tool like Xdebug to trace the vulnerability.
Blue Team (Defender)
Detection:
- Monitor for pages created or edited by contributor-level users containing suspicious URL parameters.
- Use web application firewalls (WAF) to block common XSS patterns.
- Review server logs for requests with
?param=<script>patterns.
Hunting:
- Search the WordPress database for posts containing
<script>tags in post meta or content fields. - Use the following SQL query to find potentially malicious content:
SELECT ID, post_title, post_content FROM wp_posts WHERE post_content LIKE '%<script%';
Indicators of Compromise (IOCs)
- File Hashes: (None available; plugin files may be modified)
- Network Indicators: HTTP requests containing
?param=<script>or similar XSS patterns. - Host Indicators: Presence of unexpected JavaScript in WordPress page content or post meta.
- Log Entries: WordPress audit logs showing page creation/editing by contributor users with unusual parameters.
Detection Engineering
YARA Rule
rule CVE_2024_4458_XSS_WordPress {
meta:
description = "Detects stored XSS payloads in WordPress pages related to CVE-2024-4458"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-4458"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$url_param = /(?:href|src|action|data)=["']?javascript:/i
condition:
$xss_payload or $url_param
}
Sigma Rule
title: CVE-2024-4458 Stored XSS in Themesflat Addons For Elementor
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts via URL parameters in WordPress pages
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains:
- '?param='
- '&custom_url='
cs-method: 'GET'
condition: selection
falsepositives:
- Legitimate use of URL parameters
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-4458 Stored XSS Attempt"; flow:to_server; content:"?param="; http_uri; nocase; pcre:"/<script[^>]*>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if no patch is available.
- Restrict contributor roles to trusted users only.
- Implement a Web Application Firewall (WAF) to block XSS payloads.
Long-term Fix:
- Update to a patched version once released by Themesflat.
- Apply the following code fix to the plugin files (if custom development is possible):
// In each vulnerable widget, replace direct output with escaped output
echo esc_url($url_param);
Workarounds:
- Use a security plugin like Wordfence to add virtual patching.
- Manually audit all pages created by contributors for malicious content.
Valters IT signature: This report is provided for educational and defensive purposes only. Unauthorized exploitation of this vulnerability is illegal.
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.