CVE-2024-10834 in db-gpt
Summary
by MITRE • 03/20/2025
eosphoros-ai/db-gpt version 0.6.0 contains a vulnerability in the RAG-knowledge endpoint that allows for arbitrary file write. The issue arises from the ability to pass an absolute path to a call to `os.path.join`, enabling an attacker to write files to arbitrary locations on the target server. This vulnerability can be exploited by setting the `doc_file.filename` to an absolute path, which can lead to overwriting system files or creating new SSH-key entries.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 07/18/2025
The vulnerability identified as CVE-2024-10834 affects the eosphoros-ai/db-gpt application version 0.6.0 and specifically targets the RAG-knowledge endpoint functionality. This represents a critical security flaw that stems from improper input validation and path handling within the application's file operations mechanism. The vulnerability exists in how the application processes document file names when uploading content through the RAG knowledge management interface, creating an avenue for malicious actors to manipulate the file system behavior through crafted input parameters.
The technical root cause of this vulnerability lies in the insecure use of os.path.join function which accepts absolute paths without proper validation or sanitization. When an attacker can control the doc_file.filename parameter, they can provide an absolute path that bypasses normal path resolution logic. This flaw enables attackers to write files anywhere within the target server's file system, effectively circumventing the intended directory restrictions. The vulnerability specifically manifests when the application processes uploaded documents through the RAG-knowledge endpoint, where the filename parameter is directly passed to os.path.join without adequate path validation or normalization.
The operational impact of this vulnerability is severe and multifaceted, potentially allowing attackers to execute arbitrary file write operations with the privileges of the application process. An attacker could overwrite critical system files, inject malicious code into existing applications, or create new user accounts with elevated privileges. The most concerning aspect involves the potential for SSH key manipulation, where attackers could inject their own public keys into the system, enabling persistent unauthorized access. Additionally, the vulnerability could be leveraged to create backdoor files, modify configuration settings, or corrupt application data, leading to complete system compromise and data exfiltration capabilities.
This vulnerability aligns with CWE-22, which describes improper limitation of a pathname to a restricted directory, and represents a classic example of path traversal and insecure file handling. From an ATT&CK framework perspective, this issue maps to T1059.001 (Command and Scripting Interpreter: PowerShell) and T1566 (Phishing) as attackers could use this to establish persistent access through SSH key manipulation. The vulnerability also corresponds to T1078 (Valid Accounts) and T1543 (Create or Modify System Process) when attackers leverage the file write capability to establish persistent access or modify system processes. Organizations should implement immediate mitigations including input validation, path sanitization, and privilege separation measures to prevent exploitation of this vulnerability.
The recommended mitigations involve implementing strict input validation on all file name parameters, ensuring that absolute paths are rejected or properly normalized before processing. Application developers should employ proper path validation techniques that verify file paths do not contain directory traversal sequences or absolute path components. Additionally, implementing least privilege principles for the application process, restricting write permissions to specific directories only, and employing proper file handling mechanisms such as using secure temporary directories for file operations can significantly reduce the attack surface. Regular security audits and input validation testing should be conducted to prevent similar vulnerabilities in future releases.