CVE-2024-8546
Executive Summary
CVE-2024-8546 is a Stored Cross-Site Scripting (XSS) vulnerability in the ElementsKit Elementor addons plugin for WordPress, affecting all versions up to and including 3.2.7. The flaw resides in the plugin's Video widget, where insufficient input sanitization and output escaping on user-supplied attributes allow authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. These scripts execute whenever a user accesses an injected page, leading to potential session hijacking, credential theft, or defacement.
This vulnerability is specific to the WordPress ecosystem and does not involve Apache or Nginx directly. The CVSS score of 6.4 (Medium) reflects the need for authentication and user interaction, but the stored nature of the XSS amplifies its impact in multi-user environments.
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 vendor (Elementskit) and apply patches as soon as they become available. 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-level)
- User Interaction: Required (victim must visit the page)
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
The threat level is elevated due to the stored nature of the XSS, which can persist across sessions and affect multiple users without additional exploitation steps.
Deep Dive & Mechanics
The vulnerability exists in the Video widget of the ElementsKit plugin. The widget accepts user-supplied attributes (e.g., video URL, custom parameters) that are not properly sanitized or escaped before being rendered in the HTML output. An attacker with contributor-level access can craft a malicious video URL or attribute containing JavaScript payloads. When the page is saved and viewed by another user, the payload executes in the context of the victim's browser.
Root Cause: The plugin uses esc_attr() or similar functions inconsistently, or fails to apply context-aware escaping for HTML attributes that can contain JavaScript (e.g., onerror, onload). The lack of output escaping on the src attribute or custom data attributes allows injection of event handlers.
Attack Flow:
- Attacker logs in with contributor-level privileges.
- Creates or edits a page/post using the ElementsKit Video widget.
- Injects a malicious payload into a widget attribute (e.g.,
src="javascript:alert(1)"or anonerrorevent). - The payload is stored in the database.
- When an administrator or visitor loads the page, the script executes.
Vulnerable vs. Patched Code
Vulnerable Code (<= 3.2.7):
// In elementskit/widgets/video/video.php (simplified)
$video_url = $settings['video_url'];
echo '<div class="video-container" data-src="' . $video_url . '">';
The $video_url is directly concatenated into the HTML without escaping, allowing injection of " onerror="alert(1)".
Patched Code (Hypothetical):
$video_url = esc_url($settings['video_url']);
echo '<div class="video-container" data-src="' . esc_attr($video_url) . '">';
Proper use of esc_url() and esc_attr() prevents injection by encoding special characters and disallowing javascript: schemes.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with ElementsKit plugin <= 3.2.7
- Contributor-level account or higher
Exploit Steps:
- Log in as a contributor.
- Create a new page and add the ElementsKit Video widget.
- In the video URL field, enter a malicious payload:
" onerror="alert(document.cookie) - Save the page.
- When an admin or visitor views the page, the JavaScript executes.
Proof-of-Concept Payload:
" onfocus="alert(1)" autofocus="true
This triggers when the element receives focus, which can happen automatically with autofocus.
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual attributes in the
wp_postmetatable, specifically for theelementskit_video_urlmeta key. - Look for patterns like
onerror,onload,javascript:in video widget settings.
Hardening:
- Restrict contributor-level access to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in POST requests to
wp-admin/admin-ajax.phpandwp-admin/post.php. - Use a security plugin like Wordfence to detect and block stored XSS.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/elementskit-lite/widgets/video/video.php(version <= 3.2.7) - Database Entry:
wp_postmetawithmeta_keycontainingelementskit_video_urlandmeta_valuecontaining suspicious JavaScript patterns. - Network: HTTP requests to pages containing the malicious widget with unusual query parameters or attributes.
- Logs: WordPress debug logs showing PHP warnings related to
esc_attroresc_urlfailures.
Detection Engineering
YARA Rule
rule CVE_2024_8546_Stored_XSS {
meta:
description = "Detects malicious payloads in ElementsKit Video widget"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-8546"
strings:
$payload1 = /onerror\s*=\s*["']?[^"']*alert/i
$payload2 = /onload\s*=\s*["']?[^"']*alert/i
$payload3 = /javascript\s*:\s*alert/i
$payload4 = /onfocus\s*=\s*["']?[^"']*alert/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-8546 Stored XSS in ElementsKit Video Widget
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects stored XSS payloads in WordPress ElementsKit plugin
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: wordpress
detection:
selection:
meta_key: 'elementskit_video_url'
meta_value|contains:
- 'onerror'
- 'onload'
- 'javascript:'
- 'onfocus'
condition: selection
falsepositives:
- Legitimate use of JavaScript in video URLs (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-8546 Stored XSS in ElementsKit Video Widget"; flow:to_server,established; content:"POST"; http_method; content:"wp-admin/post.php"; http_uri; content:"elementskit_video_url"; http_client_body; pcre:"/(onerror|onload|onfocus|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the ElementsKit plugin until a patch is available.
- Restrict contributor-level accounts to only trusted users.
- Scan the database for existing malicious payloads using the YARA rule above.
Long-term Fix:
- Apply the vendor patch when released (monitor the plugin's changelog).
- Upgrade to version 3.2.8 or later once available.
Workaround:
- Use a WAF to block XSS patterns in POST requests.
- Implement Content Security Policy (CSP) headers to mitigate script execution.
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.