Type: Directory Traversal
Product: Langchain-Chatchat
Affected versions: 0.3.0
Affected component: libs/chatchat-server/chatchat/server/api_server/openai_routes.py:openai_routes-files-a-full-service-post-v1-files-request-with
Suggested CWE: CWE-22 (Directory Traversal)
Reference: chatchat-space/Langchain-Chatchat#5468
The OpenAI-compatible file upload endpoint /v1/files in Langchain-Chatchat 0.3.0 is vulnerable to path traversal. An attacker can write files to arbitrary locations outside the openai_files directory by crafting malicious filenames.
Condensed from the authorized local validation used for the original report; local filesystem paths are replaced with <local-path>.
ENVIRONMENT SETUP:
- Clone the Langchain-Chatchat repository from GitHub: git clone https://github.com/chatchat-space/Langchain-Chatchat.git cd Langchain-Chatchat git checkout v0.3.0
- Install dependencies in a Python virtual environment: python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e .
- Start the Langchain-Chatchat service: python startup.py -a
- Wait for the service to start. The default endpoint is http://127.0.0.1:8501 EXPLOITATION STEPS:
- Launch Burp Suite and configure your browser to use proxy 127.0.0.1:8080
- In the browser, navigate to the Langchain-Chatchat web interface at http://127.0.0.1:8501 …
Ro1ME