CVE-2024-5215
Executive Summary
CVE-2024-5215 is a Stored Cross-Site Scripting (XSS) vulnerability in the HT Mega – Absolute Addons For Elementor WordPress plugin, affecting all versions up to and including 2.5.5. The flaw arises from insufficient input sanitization and output escaping on user-supplied attributes across multiple widgets. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts into pages. These scripts execute whenever a user accesses the compromised page, leading to potential session hijacking, data theft, or defacement. The vulnerability has a CVSS score of 6.4 (Medium) and an EPSS score of 0.0%, indicating low exploitation likelihood at the time of analysis. No public exploit code or patch is currently available.
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 resides in a WordPress plugin ecosystem. The plugin is distributed via the official WordPress plugin repository and can be installed through the WordPress admin dashboard. Users should verify the integrity of the plugin file (e.g., via checksums) and ensure they are not using compromised versions from third-party sources. The lack of a patch increases supply chain risk, as unpatched installations remain vulnerable.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Requires contributor-level access.
- User Interaction (UI): None (N) – No user action needed for execution.
- Scope (S): Changed (C) – Impact may extend beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. While the CVSS score is 6.4, the requirement for authenticated access reduces the immediate threat. However, the stored nature of the XSS means that any user visiting the compromised page is affected, making it a significant risk for multi-user WordPress sites.
Deep Dive & Mechanics
The vulnerability exists in multiple widgets of the HT Mega plugin. The plugin fails to properly sanitize user-supplied attributes (e.g., class, id, style, or custom data attributes) before rendering them in the HTML output. An attacker with contributor-level access can create or edit a page using a vulnerable widget and inject malicious JavaScript code into an attribute. When the page is rendered, the injected script executes in the context of the victim’s browser.
Root Cause: The plugin uses esc_attr() or similar functions inconsistently, or not at all, for certain attributes. Additionally, output escaping functions like esc_html() or wp_kses() are not applied to attribute values that are directly echoed into the DOM.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates a new page or edits an existing one using a vulnerable HT Mega widget.
- Attacker inserts a malicious payload into a widget attribute, e.g.,
onmouseover="alert('XSS')"or a more sophisticated script. - The page is saved and published.
- Any user (including administrators) visiting the page triggers the XSS payload.
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on common XSS fixes.
Vulnerable Code (Example from a widget):
echo '<div class="' . $attributes['class'] . '">';
Patched Code (Hypothetical):
echo '<div class="' . esc_attr($attributes['class']) . '">';
The patched version uses esc_attr() to sanitize the attribute value, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with HT Mega plugin version <= 2.5.5.
- Contributor-level account credentials.
Steps:
- Log in to WordPress as a contributor.
- Navigate to Pages > Add New.
- Add an HT Mega widget (e.g., "Heading" or "Button").
- In the widget settings, locate an attribute field (e.g., "CSS Class" or "Custom ID").
- Inject a payload such as:
or a more covert payload:" onmouseover="alert('XSS')" onfocus="alert('XSS')" autofocus=" - Save and publish the page.
- Access the page as any user to trigger the XSS.
Proof of Concept (PoC) Code:
<!-- Injected via widget attribute -->
<div class="my-class" onmouseover="alert('XSS')">Content</div>
Blue Team (Detection & Mitigation)
Detection:
- Monitor for unusual attribute values in page content, especially event handlers like
onmouseover,onclick, etc. - Use Web Application Firewall (WAF) rules to block common XSS patterns.
- Review WordPress user activity logs for suspicious page edits by contributors.
Mitigation:
- Disable or remove the HT Mega plugin until a patch is released.
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
File-based IOCs:
- Modified page/post content containing event handler attributes (e.g.,
onmouseover,onfocus). - Presence of
<script>tags or encoded JavaScript in widget attribute values.
- Modified page/post content containing event handler attributes (e.g.,
Network-based IOCs:
- HTTP requests to external domains from the WordPress site (if the payload exfiltrates data).
- Unusual outbound traffic patterns from the web server.
Log-based IOCs:
- WordPress audit logs showing page edits by contributor-level users with suspicious attribute changes.
- Web server logs containing requests with XSS payloads in query strings or POST data.
Detection Engineering
YARA Rule
rule CVE_2024_5215_HT_Mega_XSS {
meta:
description = "Detects stored XSS payloads in HT Mega widget attributes"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-5215"
strings:
$xss1 = /on\w+\s*=\s*["'][^"']*["']/ nocase
$xss2 = /<script[\s>]/i
$xss3 = /javascript\s*:/i
condition:
any of ($xss*) and filesize < 10MB
}
Sigma Rule
title: CVE-2024-5215 HT Mega Stored XSS Detection
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects stored XSS payloads in WordPress page content via HT Mega plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
http.response.body|contains:
- 'onmouseover='
- 'onfocus='
- 'onclick='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of event handlers in custom code
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-5215 HT Mega Stored XSS Payload"; flow:to_server,established; content:"onmouseover="; nocase; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the HT Mega plugin until a patched version is released.
- Review and clean any pages/posts created by contributor-level users for malicious content.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
Long-term Fix:
- Monitor the plugin’s official repository for a security update (version > 2.5.5).
- Apply the patch as soon as it becomes available.
- Conduct a security audit of all WordPress plugins and themes.
Workaround:
- If the plugin cannot be disabled, restrict contributor-level access to only trusted users.
- Use a security plugin (e.g., Wordfence) to add an additional layer of XSS protection.
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.