CVE-2024-10834

9.1 CRITICAL

📋 TL;DR

This vulnerability in eosphoros-ai/db-gpt version 0.6.0 allows attackers to write arbitrary files to any location on the server by exploiting the RAG-knowledge endpoint. Attackers can overwrite critical system files or create SSH keys, potentially leading to complete system compromise. All users running the vulnerable version are affected.

💻 Affected Systems

Products:
  • eosphoros-ai/db-gpt
Versions: Version 0.6.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects installations with the RAG-knowledge endpoint enabled and accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system takeover via SSH key injection or critical system file overwrite, leading to persistent backdoor access, data theft, or service disruption.

🟠

Likely Case

Unauthorized file creation/modification in web directories leading to web shell deployment, privilege escalation, or data manipulation.

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploit requires access to the vulnerable endpoint but is straightforward once access is obtained.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Version 0.6.1 or later

Vendor Advisory: https://huntr.com/bounties/0d598508-151a-4050-9ccd-31bb82955e7a

Restart Required: Yes

Instructions:

1. Update to version 0.6.1 or later using pip: pip install --upgrade db-gpt
2. Restart the db-gpt service
3. Verify the fix by checking the version

🔧 Temporary Workarounds

Disable RAG-knowledge endpoint

all

Temporarily disable the vulnerable endpoint until patching is possible

Modify configuration to disable RAG-knowledge API endpoint

Implement file path validation

all

Add input validation to reject absolute paths in filename parameters

Implement server-side validation to check for absolute paths in doc_file.filename

🧯 If You Can't Patch

  • Implement strict file system permissions to restrict web user write access to sensitive directories
  • Deploy web application firewall (WAF) rules to block requests containing absolute paths in filename parameters

🔍 How to Verify

Check if Vulnerable:

Check if running version 0.6.0 and if RAG-knowledge endpoint is accessible

Check Version:

pip show db-gpt | grep Version

Verify Fix Applied:

Verify version is 0.6.1 or later and test that absolute paths in filename parameters are rejected

📡 Detection & Monitoring

Log Indicators:

  • Requests to RAG-knowledge endpoint with absolute paths in filename parameters
  • File write operations to unexpected system locations

Network Indicators:

  • HTTP POST requests to /api/v1/rag/knowledge with suspicious filename parameters

SIEM Query:

source="web_logs" AND uri="/api/v1/rag/knowledge" AND (filename CONTAINS "/" OR filename CONTAINS "..")

🔗 References

📤 Share & Export