CVE-2024-11885
Executive Summary
CVE-2024-11885 is a Stored Cross-Site Scripting (XSS) vulnerability found in the NinjaTeam Chat for Telegram WordPress plugin, affecting all versions up to and including 1.0. The flaw resides in the njtele_button shortcode, where user-supplied attributes are not properly sanitized or escaped. This allows authenticated attackers with at least Contributor-level access to inject arbitrary web scripts. When a user (including administrators) visits a page containing the malicious shortcode, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or further compromise of the WordPress site.
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 is specific to the WordPress plugin ecosystem. The plugin is distributed via the official WordPress plugin repository and third-party marketplaces. Since the patch status is UNKNOWN, users must consider the plugin as potentially abandoned or unmaintained. The lack of an official patch increases supply chain risk, as site administrators may unknowingly continue using a vulnerable component. No known public exploit code or proof-of-concept exists at this time.
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
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level)
- User Interaction: Required (victim must visit the page)
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
The medium severity reflects the need for authenticated access and user interaction, but the potential for stored XSS in a WordPress context can lead to privilege escalation and site takeover.
Deep Dive & Mechanics
The vulnerability exists in the njtele_button shortcode handler. The plugin registers a shortcode that accepts user-defined attributes (e.g., button_text, link, color). These attributes are directly output into the HTML without proper sanitization or escaping. For example:
function njtele_button_shortcode($atts) {
$atts = shortcode_atts(array(
'button_text' => 'Chat',
'link' => '#',
'color' => 'blue'
), $atts);
return '<a href="' . $atts['link'] . '" class="njtele-btn" style="background:' . $atts['color'] . '">' . $atts['button_text'] . '</a>';
}
add_shortcode('njtele_button', 'njtele_button_shortcode');
An attacker with Contributor-level access can create a post or page containing:
[njtele_button button_text="<script>alert('XSS')</script>" link="javascript:alert(1)" color="red"]
When the page is rendered, the script executes in the context of the visitor's browser. The lack of wp_kses or esc_attr() on the attributes allows arbitrary HTML/JavaScript injection.
Vulnerable vs. Patched Code
Vulnerable Code (version 1.0):
function njtele_button_shortcode($atts) {
$atts = shortcode_atts(array(
'button_text' => 'Chat',
'link' => '#',
'color' => 'blue'
), $atts);
return '<a href="' . $atts['link'] . '" class="njtele-btn" style="background:' . $atts['color'] . '">' . $atts['button_text'] . '</a>';
}
Patched Code (hypothetical fix):
function njtele_button_shortcode($atts) {
$atts = shortcode_atts(array(
'button_text' => 'Chat',
'link' => '#',
'color' => 'blue'
), $atts);
$safe_link = esc_url($atts['link']);
$safe_text = esc_html($atts['button_text']);
$safe_color = esc_attr($atts['color']);
return '<a href="' . $safe_link . '" class="njtele-btn" style="background:' . $safe_color . '">' . $safe_text . '</a>';
}
The patched version uses esc_url(), esc_html(), and esc_attr() to neutralize malicious input.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with NinjaTeam Chat plugin <= 1.0
- Contributor-level account credentials
Steps:
- Log in as a Contributor.
- Create a new post or page.
- Insert the following shortcode in the content:
[njtele_button button_text="<img src=x onerror=alert(document.cookie)>" link="javascript:void(0)" color="red"] - Publish the post.
- When an administrator or visitor views the post, the XSS payload executes.
Advanced Payload:
[njtele_button button_text="<script>fetch('/wp-admin/admin-ajax.php?action=create_admin_user')</script>" link="#" color="blue"]
Note: This requires a vulnerable AJAX endpoint; adjust based on target.
Blue Team
Detection Steps:
- Monitor for posts/pages containing the
njtele_buttonshortcode with suspicious attributes. - Review user activity logs for Contributor-level users creating posts with unusual shortcode parameters.
- Use the YARA and Sigma rules below to scan for malicious shortcode usage.
Mitigation:
- Disable the plugin immediately if no patch is available.
- Restrict Contributor-level users from using shortcodes via user role editor plugins.
- Implement a Web Application Firewall (WAF) rule to block
njtele_buttonshortcode with script tags.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/ninjateam-chat-telegram/ninjateam-chat-telegram.php - Shortcode pattern:
[njtele_button button_text="<script>...</script>"] - Network: Outbound connections to attacker-controlled domains from WordPress admin pages.
- Logs: PHP error logs showing
unexpected <in shortcode output.
Detection Engineering
YARA Rule
rule CVE_2024_11885_Stored_XSS {
meta:
description = "Detects malicious njtele_button shortcode usage in WordPress posts"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-11885"
strings:
$shortcode = /\[njtele_button[^\]]*\]/
$xss_payload = /<script[^>]*>.*<\/script>/i
$event_handler = /on\w+\s*=\s*['\"][^'\"]*['\"]/i
condition:
$shortcode and ($xss_payload or $event_handler)
}
Sigma Rule
title: CVE-2024-11885 Stored XSS via njtele_button Shortcode
id: 8a7b3c2d-1e5f-4a6b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects creation of posts/pages containing malicious njtele_button shortcode
author: Valters IT
date: 2025-04-10
logsource:
product: wordpress
service: wp_posts
detection:
selection:
post_content|contains: '[njtele_button'
post_content|re: '<script[^>]*>.*</script>'
condition: selection
falsepositives:
- Legitimate use of shortcode with safe attributes
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-11885 Stored XSS via njtele_button Shortcode";
flow:to_server,established;
content:"[njtele_button"; http_client_body;
pcre:"/<script[^>]*>.*<\/script>/i";
classtype:web-application-attack;
sid:1000001;
rev:1;
)
Remediation & Mitigation
- Immediate Action: Disable the NinjaTeam Chat for Telegram plugin until a patch is released.
- Short-term: Use a WordPress security plugin to block shortcode execution for low-privilege users.
- Long-term: Replace the plugin with an alternative that is actively maintained.
- WAF Rule: Add a virtual patch to block requests containing
njtele_buttonwith script tags. - User Training: Educate content creators about the risks of using untrusted shortcodes.
Valters IT
Securing WordPress Ecosystems
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.