CVE-2023-50731

9.1 CRITICAL

📋 TL;DR

This is a path injection vulnerability in MindsDB that allows attackers to write arbitrary files to the server filesystem and delete zip/tar.gz files. It affects all MindsDB instances prior to version 23.11.4.1 that expose the file upload functionality.

💻 Affected Systems

Products:
  • MindsDB
Versions: All versions prior to 23.11.4.1
Operating Systems: All platforms running MindsDB
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the file upload functionality which is typically exposed in default configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise through arbitrary file write leading to remote code execution, data destruction via file deletion, and persistence mechanisms.

🟠

Likely Case

Arbitrary file write leading to data exfiltration, service disruption via file deletion, and potential privilege escalation.

🟢

If Mitigated

Limited impact if proper file system permissions restrict write access to sensitive directories.

🌐 Internet-Facing: HIGH - Directly exploitable via HTTP API without authentication in default configurations.
🏢 Internal Only: MEDIUM - Still exploitable by authenticated users or via other attack vectors within the network.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Proof of concept available in GitHub security advisory. Exploitation requires HTTP access to the MindsDB API endpoint.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 23.11.4.1

Vendor Advisory: https://github.com/mindsdb/mindsdb/security/advisories/GHSA-j8w6-2r9h-cxhj

Restart Required: Yes

Instructions:

1. Update MindsDB to version 23.11.4.1 or later using pip: 'pip install --upgrade mindsdb>=23.11.4.1' 2. Restart the MindsDB service 3. Verify the update was successful

🔧 Temporary Workarounds

Disable file upload endpoint

all

Block or disable the vulnerable file upload API endpoint if not required

Configure firewall/load balancer to block requests to /api/files endpoint
Modify MindsDB configuration to disable file upload functionality

Restrict file system permissions

linux

Run MindsDB with minimal file system write permissions

chown -R mindsdb:mindsdb /var/lib/mindsdb
chmod 750 /var/lib/mindsdb
Run MindsDB as non-root user with restricted home directory

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate MindsDB instances from sensitive systems
  • Deploy WAF rules to detect and block path traversal patterns in file upload requests

🔍 How to Verify

Check if Vulnerable:

Check MindsDB version: if version < 23.11.4.1, system is vulnerable. Test by attempting path traversal in file upload name parameter.

Check Version:

python -c "import mindsdb; print(mindsdb.__version__)" or check package manager

Verify Fix Applied:

Confirm MindsDB version is 23.11.4.1 or later. Test that path traversal attempts in file uploads are properly rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file write operations outside expected directories
  • Failed file type validation errors
  • Path traversal patterns in file upload requests

Network Indicators:

  • HTTP requests to /api/files endpoint with suspicious filename parameters
  • Unusual file deletion patterns

SIEM Query:

source="mindsdb" AND (uri_path="/api/files" AND (filename="*../*" OR filename="*..\\*"))

🔗 References

📤 Share & Export