CVE-2024-2790
Executive Summary
CVE-2024-2790 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.4.8. The flaw resides in the Accordion widget, where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts that execute when any user visits the compromised page. This vulnerability is part of the WordPress ecosystem and does not involve Apache or Nginx directly.
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 verify the integrity of their plugin files and ensure they are sourced from trusted channels. No known supply chain compromise has been reported, but the lack of a patch increases risk for sites using this plugin.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (contributor-level)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
The threat level is medium due to the requirement for authenticated access, but the potential for widespread impact on site visitors and administrators makes it a significant concern.
Deep Dive & Mechanics
The vulnerability exists in the Accordion widget of the HT Mega plugin. When rendering the widget, user-supplied attributes (such as title, content, or custom data attributes) are not properly sanitized or escaped before being output in the HTML. This allows an attacker to inject malicious JavaScript code that is stored in the WordPress database and executed in the browser of any user viewing the page.
The attack flow:
- An attacker with contributor-level access creates or edits a page using the HT Mega Accordion widget.
- The attacker injects a malicious payload into one of the widget's attributes (e.g.,
titleorcontent). - The plugin stores the payload without proper sanitization.
- When a victim (including administrators) visits the page, the payload executes in their browser context.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 2.4.8): The plugin directly outputs user-supplied attributes without escaping. For example, in the Accordion widget template:
echo '<div class="ht-mega-accordion-title" data-title="' . $title . '">';
Patched Code (hypothetical): The plugin should use WordPress's built-in escaping functions:
echo '<div class="ht-mega-accordion-title" data-title="' . esc_attr($title) . '">';
Since no official patch is available, users must apply manual mitigations.
Exploitation & Lab Setup
Red Team
To exploit this vulnerability in a lab environment:
- Set up a WordPress instance with the HT Mega plugin version 2.4.8.
- Log in as a contributor-level user.
- Create a new page and add the HT Mega Accordion widget.
- In the widget settings, inject a payload into the title field:
<img src=x onerror=alert('XSS')> - Save the page and visit it as an administrator to trigger the payload.
Blue Team
To detect exploitation attempts:
- Monitor for unusual content in page/post revisions, especially in custom fields or widget settings.
- Look for patterns like
<script>,onerror,onload, orjavascript:in thewp_postmetatable. - Use Web Application Firewall (WAF) rules to block common XSS payloads in POST requests to
wp-admin/post.php.
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
ht-mega-for-elementor.zip(version 2.4.8):e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Indicators:
- Outbound connections to attacker-controlled domains from WordPress admin pages.
- Unusual JavaScript files loaded from external sources.
- Log Indicators:
- WordPress audit logs showing creation or modification of pages/posts by contributor-level users with suspicious content.
- PHP error logs containing
XSSorscriptkeywords.
Detection Engineering
YARA Rule
rule CVE_2024_2790_HT_Mega_XSS {
meta:
description = "Detects stored XSS payloads in HT Mega Accordion widget"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-2790"
strings:
$payload1 = /<script[^>]*>.*?<\/script>/is
$payload2 = /onerror\s*=\s*["']?[^"'\s>]+/is
$payload3 = /onload\s*=\s*["']?[^"'\s>]+/is
$payload4 = /javascript\s*:\s*/is
condition:
any of them
}
Sigma Rule
title: CVE-2024-2790 HT Mega Stored XSS Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential stored XSS payloads in WordPress HT Mega plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: 'POST'
http.url: '/wp-admin/post.php'
http.body|contains:
- '<script>'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript in page content by administrators
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-2790 HT Mega Stored XSS Payload"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Since no official patch is available, the following mitigations are recommended:
- Disable the HT Mega plugin until a patch is released.
- Restrict contributor-level access to trusted users only.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
- Use WordPress security plugins (e.g., Wordfence) to monitor and block malicious input.
- Regularly audit user roles and permissions to minimize the attack surface.
- Apply virtual patching via WAF or custom
.htaccessrules to filter malicious input.
Valters IT signature: This report is generated for educational and defensive purposes. Always follow responsible disclosure practices.
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.