CVE-2024-4209
Executive Summary
CVE-2024-4209 is a Stored Cross-Site Scripting (XSS) vulnerability in the Gutenberg Blocks with AI by Kadence WP – Page Builder Features plugin for WordPress. The flaw exists in the countdown timer block, 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 a victim visits the compromised page, the injected script executes in their browser, potentially leading to session hijacking, data theft, or further compromise.
This vulnerability affects all versions up to and including 3.2.36. The CVSS score is 6.4 (Medium), and the EPSS probability is 0.0%, indicating low active exploitation in the wild. However, given the widespread use of Kadence Blocks in WordPress sites, the risk remains significant for unpatched installations.
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 is a WordPress plugin vulnerability. The plugin is distributed via the official WordPress plugin repository and is also available for direct download from the vendor's site. Users should verify the integrity of their plugin files and ensure they are obtained from trusted sources. No known supply chain compromise has been reported for this specific CVE.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): Low – Attacker needs contributor-level access.
- User Interaction (UI): None – No user action is required for the script to execute.
- Scope (S): Changed – The impact extends beyond the vulnerable component.
- Confidentiality (C): Low – Limited data exposure.
- Integrity (I): Low – Limited ability to modify content.
- Availability (A): None – No impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the ability to inject persistent scripts in a widely used page builder plugin elevates the risk for WordPress sites with multiple contributors.
Deep Dive & Mechanics
The vulnerability resides in the countdown timer block of the Kadence Blocks plugin. The block accepts user-defined attributes (e.g., timer duration, end date, custom CSS classes) that are rendered directly into the page HTML without proper sanitization or output escaping.
Root Cause: The plugin uses wp_kses_post() or similar functions that allow certain HTML tags but fail to escape JavaScript event handlers or inline script tags within attribute values. For example, an attacker could inject:
<div class="kb-countdown-timer" data-end-date="2024-12-31" data-oncomplete="alert('XSS')">
If the data-oncomplete attribute is not sanitized, it will be rendered as a valid HTML attribute, and any JavaScript event handler (like onload, onerror, or custom data attributes) can be used to execute arbitrary code.
Attack Flow:
- Attacker logs in with contributor-level privileges.
- Attacker creates or edits a page/post using the Kadence Blocks editor.
- Attacker adds a countdown timer block and injects malicious JavaScript into a vulnerable attribute (e.g.,
data-oncomplete,data-end-date, or a custom CSS class). - The malicious payload is stored in the WordPress database.
- When any user (including administrators) visits the page, the script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (<= 3.2.36):
The plugin likely uses a function like esc_attr() or wp_kses_post() on the attribute values, but these functions do not prevent JavaScript execution in all contexts. For example:
// Vulnerable: Direct output without proper escaping
echo '<div class="kb-countdown-timer" data-end-date="' . $attributes['endDate'] . '">';
Patched Code (Hypothetical):
A proper fix would involve using esc_js() for JavaScript contexts or wp_kses() with a strict allowlist. Additionally, the plugin should use wp_json_encode() for data attributes that are consumed by JavaScript.
// Patched: Proper escaping for JavaScript context
echo '<div class="kb-countdown-timer" data-end-date="' . esc_js( $attributes['endDate'] ) . '">';
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with Kadence Blocks plugin <= 3.2.36
- Contributor-level account or higher
Steps:
- Log in to WordPress as a contributor.
- Create a new page and add the Kadence Blocks countdown timer block.
- In the block settings, locate a vulnerable attribute (e.g., "End Date" or "Custom CSS Class").
- Inject a payload such as:
or" onfocus="alert(1)" autofocus="true"><script>alert(document.cookie)</script> - Save/publish the page.
- When an administrator or visitor views the page, the script executes.
Example Payload for Custom CSS Class:
kb-countdown-timer" onmouseover="alert('XSS')
Blue Team (Detection & Hardening)
Detection:
- Monitor WordPress logs for unusual page edits by contributors.
- Use a Web Application Firewall (WAF) to block common XSS patterns.
- Scan pages for unexpected JavaScript in block attributes.
Hardening:
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Apply the vendor patch as soon as it becomes available.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (None available – plugin files are standard)
- Suspicious Page Content: Look for pages containing:
data-oncomplete,data-end-date, ordata-start-dateattributes with JavaScript code.- Inline
<script>tags within Kadence Blocks. - Unusual event handlers like
onfocus,onmouseover,onerrorin block HTML.
- WordPress Database: Check
wp_poststable for posts containingkb-countdown-timerwith suspicious attribute values. - Network Traffic: Outbound connections from the victim's browser to attacker-controlled domains (if the payload exfiltrates data).
Detection Engineering
YARA Rule
rule CVE_2024_4209_Kadence_XSS {
meta:
description = "Detects stored XSS payloads in Kadence Blocks countdown timer"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-4209"
strings:
$xss1 = /data-(oncomplete|end-date|start-date)\s*=\s*["'][^"']*<script/i
$xss2 = /data-(oncomplete|end-date|start-date)\s*=\s*["'][^"']*on\w+=/i
$xss3 = /kb-countdown-timer[^>]*on\w+\s*=\s*["']/i
condition:
any of them
}
Sigma Rule
title: Stored XSS via Kadence Blocks Countdown Timer
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts in Kadence Blocks countdown timer attributes
author: Valters IT
logsource:
product: wordpress
service: waf
detection:
selection:
http.url|contains: "/wp-json/kadence-blocks/v1/"
http.body|contains:
- "data-oncomplete"
- "data-end-date"
- "data-start-date"
http.body|re: "on\\w+\\s*=\\s*['\"]"
condition: selection
falsepositives:
- Legitimate use of JavaScript in block attributes (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-4209 - Stored XSS in Kadence Blocks Countdown Timer";
flow:to_server,established;
content:"/wp-json/kadence-blocks/v1/"; http_uri;
content:"data-oncomplete"; http_client_body;
pcre:"/on\w+\s*=\s*['\"]/Pi";
sid:1000001;
rev:1;
reference:cve,2024-4209;
)
Remediation & Mitigation
Immediate Actions:
- Update the plugin: If a patched version becomes available, update to the latest version immediately.
- Disable the countdown timer block: Temporarily remove or disable the Kadence Blocks countdown timer block via a custom plugin or filter.
- Restrict user roles: Limit contributor-level access to only trusted users. Consider using a role editor plugin to remove the ability to use Kadence Blocks for low-privilege users.
Long-term Mitigations:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Enforce Content Security Policy (CSP) headers to block inline scripts.
- Regularly audit WordPress plugins for known vulnerabilities.
- Use a security plugin (e.g., Wordfence) to monitor for suspicious activity.
Vendor Contact: Since the patch status is unknown, monitor the Kadence WP website and WordPress plugin repository for updates. If no patch is released, consider replacing the plugin with an alternative.
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.