CVE-2024-3307
Executive Summary
CVE-2024-3307 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the HT Mega – Absolute Addons For Elementor WordPress plugin, versions up to and including 2.4.9. This vulnerability resides in the Countdown widget due to insufficient input sanitization and output escaping. Authenticated attackers with contributor-level access or higher can inject arbitrary web scripts into pages. When a user accesses an injected page, the script executes, potentially leading to session hijacking, defacement, or redirection to malicious sites. The vulnerability is within 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 plugin updates and ensure they are sourced from trusted channels. No known supply chain compromise has been reported, but the unpatched status increases risk for sites using affected versions.
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 or above)
- User Interaction: Required (victim must visit the page)
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: Medium. Exploitation requires authenticated access, but the low complexity and potential for widespread impact on WordPress sites make it a notable risk.
Deep Dive & Mechanics
The vulnerability exists in the Countdown widget of the HT Mega plugin. The widget fails to properly sanitize user-supplied input and escape output before rendering it in the page. An attacker with contributor-level access can craft a malicious payload (e.g., JavaScript) within the widget’s attributes. When the page is saved and later viewed by any user, the payload executes in the context of the victim’s browser.
Root Cause: Insufficient input validation and output escaping in the Countdown widget’s rendering logic. The plugin does not use WordPress’s built-in escaping functions (e.g., esc_attr(), esc_html()) for certain attributes.
Attack Flow:
- Attacker logs in with contributor or higher privileges.
- Attacker creates or edits a page/post using the HT Mega Countdown widget.
- Attacker injects a malicious script into a widget attribute (e.g.,
data-countdownor similar). - The page is saved and published.
- Victim visits the page; the script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (simplified example):
// In vulnerable version, output is not escaped
echo '<div class="ht-countdown" data-countdown="' . $atts['countdown'] . '">';
Patched Code (expected fix):
// Proper escaping using WordPress functions
echo '<div class="ht-countdown" data-countdown="' . esc_attr($atts['countdown']) . '">';
The patch would involve adding esc_attr() or similar escaping to all user-controlled attributes in the Countdown widget.
Exploitation & Lab Setup
Red Team
To simulate exploitation, set up a WordPress instance with HT Mega plugin version 2.4.9. Create a contributor account and inject a payload such as:
<script>alert('XSS')</script>
into the Countdown widget’s attribute field. Save and publish the page. When an admin or visitor accesses the page, the script executes.
Proof of Concept (PoC):
- Install WordPress and HT Mega 2.4.9.
- Log in as contributor.
- Create a new page, add the Countdown widget.
- In the widget settings, set a custom attribute to:
"><script>alert(document.cookie)</script> - Publish the page.
- Visit the page as another user to trigger the XSS.
Blue Team
- Monitor for unusual widget attribute values containing script tags or event handlers.
- Use Web Application Firewall (WAF) rules to block common XSS patterns.
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate script execution.
Indicators of Compromise (IOCs)
- File Indicators: Modified pages/posts containing
<script>tags in HT Mega widget attributes. - Network Indicators: Outbound connections to attacker-controlled domains from compromised pages.
- Log Indicators: Unusual POST requests to
/wp-admin/admin-ajax.phpwith widget data containing JavaScript. - Registry/File Changes: None specific to this CVE.
Detection Engineering
YARA Rule
rule CVE_2024_3307_HT_Mega_XSS {
meta:
description = "Detects stored XSS payloads in HT Mega Countdown widget attributes"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-3307"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$widget_attr = /data-countdown\s*=\s*"[^"]*<script/i
condition:
$widget_attr and $xss_payload
}
Sigma Rule
title: CVE-2024-3307 HT Mega Stored XSS Detection
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects stored XSS attempts via HT Mega Countdown widget
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: 'POST'
http.url: '/wp-admin/admin-ajax.php'
http.body|contains: 'ht-mega-countdown'
http.body|contains: '<script'
condition: selection
falsepositives:
- Legitimate use of script tags in widget (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-3307 HT Mega Stored XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"ht-mega-countdown"; http_client_body; content:"<script"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the HT Mega plugin until a patch is available.
- Restrict contributor-level access to trusted users only.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
Long-term Fix:
- Update to a patched version of HT Mega (once released) that properly escapes output.
- Apply WordPress security best practices: use
esc_attr(),esc_html(), andwp_kses()for all user input.
Workarounds:
- Use a security plugin (e.g., Wordfence) to block malicious requests.
- Manually audit and sanitize any existing pages using the Countdown widget.
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.