☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 6.4 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-3989

CVE-2024-3989 Cross-Site Scripting in Ht mega
📅 PUBLISHED: 2024-05-09 20:03 UTC 🔄 UPDATED: 2026-08-12 14:52 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.23%
👁️
0.23% probability
5.7× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1203
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 6.4
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: N User Interaction None
S: C Scope Changed
C: L Confidentiality Low
I: L Integrity Low
A: N Availability None
6.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-3989 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 plugin's Gallery Justify 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. When a user accesses a page containing the malicious widget, the injected script executes in the context of the victim's browser, potentially leading to session hijacking, data theft, or further compromise of the WordPress site.

This vulnerability is specific to the WordPress ecosystem and does not involve the underlying web server (Apache or Nginx). The CVSS score of 6.4 (Medium) reflects the need for authenticated access but the potential for significant impact due to the stored nature of the attack.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
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 directly from the WordPress dashboard or via manual upload are at risk. The plugin is not an NPM, PyPI, Go, or Ruby package, but it is a critical component of the WordPress supply chain. Organizations should audit their WordPress installations for the presence of this plugin and ensure it is either updated or removed if no patch is available.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
  • Base Score: 6.4 (Medium)
  • Attack Vector (AV): Network (N) – The vulnerability can be exploited remotely.
  • Attack Complexity (AC): Low (L) – No special conditions are required.
  • Privileges Required (PR): Low (L) – The attacker needs contributor-level access or higher.
  • User Interaction (UI): None (N) – The victim does not need to perform any action beyond viewing the page.
  • Scope (S): Changed (C) – The vulnerable component impacts resources beyond its security scope.
  • Confidentiality (C): Low (L) – Limited data exposure possible.
  • Integrity (I): Low (L) – Limited ability to modify content.
  • Availability (A): None (N) – No impact on availability.

Threat Level: Medium. While the CVSS score is moderate, the stored XSS nature and the widespread use of Elementor and its add-ons elevate the risk. An attacker with contributor access can compromise multiple pages and potentially escalate privileges.

Deep Dive & Mechanics

The vulnerability exists in the ht-mega-for-elementor plugin's Gallery Justify Widget. This widget allows users to create image galleries with a justified layout. The widget accepts user-supplied attributes (e.g., image URLs, captions, or custom CSS classes) that are not properly sanitized or escaped before being rendered in the HTML output.

When an authenticated user with contributor-level access or higher creates or edits a page using this widget, they can inject malicious JavaScript code into one of the widget's attributes. For example, an attacker could inject a payload into the caption attribute of an image:

<img src="..." alt="" caption="<script>alert('XSS')</script>" />

Because the plugin does not sanitize the caption attribute or escape it before output, the injected script is stored in the WordPress database. When any user (including administrators or visitors) views the page, the script executes in their browser.

The attack flow:

  1. Attacker logs in with contributor-level credentials.
  2. Attacker creates or edits a page using the Gallery Justify Widget.
  3. Attacker injects malicious JavaScript into a widget attribute (e.g., caption, link URL, or custom class).
  4. The malicious payload is stored in the database.
  5. When a victim visits the page, the script executes, potentially stealing cookies, redirecting to malicious sites, or performing actions on behalf of the victim.

Vulnerable vs. Patched Code

Vulnerable Code (version <= 2.5.0):

The vulnerable widget likely outputs user-supplied attributes directly without proper escaping. For example, in the plugin's PHP file (e.g., widgets/gallery-justify.php):

// Vulnerable: Direct output without escaping
echo '<div class="ht-mega-gallery-item" data-caption="' . $caption . '">';

Here, $caption is taken directly from user input and inserted into the HTML attribute without using esc_attr() or wp_kses().

Patched Code (hypothetical):

A patched version would sanitize and escape the output:

// Patched: Proper escaping
echo '<div class="ht-mega-gallery-item" data-caption="' . esc_attr($caption) . '">';

Additionally, the plugin should validate that the input does not contain HTML tags or JavaScript event handlers. Since no official patch is available, users must manually apply similar escaping or disable the widget.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A WordPress site with the HT Mega plugin version <= 2.5.0 installed and active.
  • An authenticated user account with contributor-level privileges or higher.

Steps:

  1. Log in to the WordPress admin panel as a contributor.
  2. Navigate to Pages > Add New (or edit an existing page).
  3. Add the HT Mega Gallery Justify widget to the page.
  4. In one of the widget's fields (e.g., image caption or custom CSS class), inject a JavaScript payload. For example, in the caption field:
    " onmouseover="alert('XSS')
    
    Or use a more sophisticated payload:
    <img src=x onerror=alert(document.cookie)>
    
  5. Save/publish the page.
  6. When any user visits the page, the script executes.

Proof-of-Concept (PoC) Payload:

<script>alert('CVE-2024-3989 XSS');</script>

Blue Team (Detection & Hardening)

Detection:

  • Monitor WordPress admin logs for unusual widget attribute values.
  • Use Web Application Firewall (WAF) rules to block common XSS patterns in POST requests to wp-admin/admin-ajax.php or page editing endpoints.
  • Scan pages for stored XSS using automated tools like WPScan or custom scripts.

Hardening:

  • Disable the Gallery Justify Widget if not in use.
  • Restrict contributor-level access to trusted users only.
  • Apply Content Security Policy (CSP) headers to mitigate XSS impact:
    Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:;
    
  • Use a WordPress security plugin (e.g., Wordfence) to add virtual patching.

Indicators of Compromise (IOCs)

  • File Indicators:

    • Presence of the plugin file: wp-content/plugins/ht-mega-for-elementor/widgets/gallery-justify.php
    • Modified or suspicious entries in the wp_posts table containing <script> tags or event handlers in widget attributes.
  • Network Indicators:

    • Outbound connections to known malicious domains from the WordPress server.
    • HTTP requests to wp-admin/admin-ajax.php with suspicious payloads.
  • Log Indicators:

    • WordPress debug log entries showing unescaped output.
    • Web server access logs with requests containing XSS patterns (e.g., <script>, onerror=, onmouseover=).

Detection Engineering

YARA Rule

rule CVE_2024_3989_HT_Mega_XSS {
    meta:
        description = "Detects stored XSS payloads in HT Mega Gallery Justify widget attributes"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-3989"
    strings:
        $payload1 = /<script[^>]*>.*?<\/script>/is
        $payload2 = /on\w+\s*=\s*["']?[^"'\s>]+/is
        $payload3 = /javascript\s*:/is
    condition:
        any of them
}

Sigma Rule

title: CVE-2024-3989 Stored XSS in HT Mega Gallery Justify Widget
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit stored XSS in HT Mega plugin via widget attributes
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
    service: access
detection:
    selection:
        cs-method: 'POST'
        c-uri|contains: '/wp-admin/admin-ajax.php'
        cs-uri-query|contains: 'action=elementor_ajax'
        cs-uri-query|contains: 'ht-mega-gallery-justify'
    keywords:
        - '<script'
        - 'onerror='
        - 'onmouseover='
        - 'javascript:'
    condition: selection and keywords
falsepositives:
    - Legitimate use of JavaScript in widget attributes (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-3989 HT Mega Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=elementor_ajax"; http_uri; content:"ht-mega-gallery-justify"; http_uri; pcre:"/(<script|onerror=|onmouseover=|javascript:)/i"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable the Gallery Justify Widget – If the widget is not essential, deactivate it via the plugin settings or by removing the corresponding PHP file.
  2. Restrict User Roles – Limit contributor-level access to only trusted users. Consider using a role editor plugin to remove the ability to edit pages for low-privilege users.
  3. Apply Virtual Patching – Use a WAF (e.g., Cloudflare, ModSecurity) to block requests containing XSS patterns in widget attributes.

Long-Term Fix:

  • Since no official patch is available, monitor the plugin's repository for updates. If the vendor releases a patched version (e.g., 2.5.1), update immediately.
  • If the plugin is abandoned, consider replacing it with an alternative Elementor add-on that provides similar functionality but is actively maintained.

Workaround:

  • Manually edit the vulnerable file (wp-content/plugins/ht-mega-for-elementor/widgets/gallery-justify.php) to add esc_attr() or wp_kses_post() around user-supplied attributes. However, this will be overwritten on plugin updates.

Valters IT – Securing digital ecosystems through intelligence-driven defense.

👁️ SHODAN DORKS (THREAT HUNTING)

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.

http.html:"wp-content/plugins/ht-mega-for-elementor"
http.html:"ht-mega-gallery-justify"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-3989/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.