Skip to content

Instantly share code, notes, and snippets.

@Ro1ME
Last active September 26, 2026 04:39
Show Gist options
  • Select an option

  • Save Ro1ME/f80ac458836b59adb9c6ceff3993f7f3 to your computer and use it in GitHub Desktop.

Select an option

Save Ro1ME/f80ac458836b59adb9c6ceff3993f7f3 to your computer and use it in GitHub Desktop.
CVE-2026-51882 - Directory Traversal in Langchain-Chatchat (openai_routes.py

CVE-2026-51882

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

Description

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.

Reproduction Notes (condensed, sanitized)

Condensed from the authorized local validation used for the original report; local filesystem paths are replaced with <local-path>.

ENVIRONMENT SETUP:

  1. 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
  2. Install dependencies in a Python virtual environment: python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e .
  3. Start the Langchain-Chatchat service: python startup.py -a
  4. Wait for the service to start. The default endpoint is http://127.0.0.1:8501 EXPLOITATION STEPS:
  5. Launch Burp Suite and configure your browser to use proxy 127.0.0.1:8080
  6. In the browser, navigate to the Langchain-Chatchat web interface at http://127.0.0.1:8501 …

Discoverer

Ro1ME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment