CVE-2026-33309: Langflow has an Arbitrary File Write (RCE) via v2 API
Langflow 1.2.0 up to 1.9.0 lets an authenticated user write files anywhere on the host through `POST /api/v2/files/`. A traversal sequence in the multipart upload filename escapes the storage directory, which can lead to remote code execution. It bypasses the earlier fix for CVE-2025-68478. Upgrade to Langflow 1.9.0.
Published Mar 19, 2026 · Updated Jun 6, 2026 · Analysis Oct 31, 2026
What an attacker can do
The earlier fix for CVE-2025-68478 added a ValidatedFileName guard, but it only protects URL path parameters. In src/backend/base/langflow/api/v2/files.py, the upload_user_file route takes file.filename from the multipart Content-Disposition header and passes it on unchanged. The storage layer, LocalStorageService in services/storage/local.py, joins paths with folder_path / file_name and has no check that the result stays under the base directory (CWE-22, CWE-73).
The reporter logged in and uploaded a file named ../../traversal_proof.txt. Langflow returned 201 and wrote it to /app/data/.cache/langflow/, outside the user's own folder. The server log shows a normal line, File ../traversal_proof.txt saved successfully in flow ....
The attacker needs an account. Any account will do, and installs that still use a default admin login are easy to enter. They can overwrite system files, drop in malicious Python components, or replace .ssh/authorized_keys. That gives code execution on the host, which exposes the API keys and databases Langflow connects to.
Who is affected
The pip package langflow from 1.2.0 up to but not including 1.9.0. The reporter tested the 1.7.3 Docker image. Check with:
pip show langflowAny instance where untrusted users can register or log in is at risk.
langflow
- Ecosystem
- PyPI
- Affected
- >= 1.2.0, < 1.9.0
- Fixed in
- 1.9.0
- Check
pip show langflow
How to fix it
Upgrade to langflow 1.9.0:
pip install --upgrade langflow==1.9.0The advisory lists no workaround. It suggests two source-level fixes: strip directories from the multipart filename and reject .., and add a resolve().is_relative_to(base_dir) check in LocalStorageService.save_file. Until you upgrade, limit who can log in or reach the upload route.
How to tell if you were hit
Search Langflow logs for lines like File ../ saved successfully in flow, meaning any saved file name containing .. or a leading /. Check the Langflow cache directory, for example ~/.cache/langflow/ or /app/data/.cache/langflow/, for files outside the per-user UUID folders. Review .ssh/authorized_keys, startup scripts and custom component directories for changes you did not make.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
While reviewing the recent patch for CVE-2025-68478 (External Control of File Name in v1.7.1), I discovered that the root architectural issue within LocalStorageService remains unresolved. Because the underlying storage layer lacks boundary containment checks, the system relies entirely on the HTTP-layer ValidatedFileName dependency.
This defense-in-depth failure leaves the POST /api/v2/files/ endpoint vulnerable to Arbitrary File Write. The multipart upload filename bypasses the path-parameter guard, allowing authenticated attackers to write files anywhere on the host system, leading to Remote Code Execution (RCE).
Details
The vulnerability exists in two layers:
- API Layer (`src/backend/base/langflow/api/v2/files.py:162`): Inside the
upload_user_fileroute, thefilenameis extracted directly from the multipartContent-Dispositionheader (new_filename = file.filename). It is passed verbatim to the storage service.ValidatedFileNameprovides zero protection here as it only guards URL path parameters. - Storage Layer (`src/backend/base/langflow/services/storage/local.py:114-116`): The
LocalStorageServiceuses naive path concatenation (file_path = folder_path / file_name). It lacks aresolve().is_relative_to(base_dir)containment check.
Recommended Fix:
- Sanitize the multipart filename before processing:
from pathlib import Path as StdPath
new_filename = StdPath(file.filename or "").name # Strips directory traversal characters
if not new_filename or ".." in new_filename:
raise HTTPException(status_code=400, detail="Invalid file name")
- Add a canonical path containment check inside
LocalStorageService.save_fileto permanently kill this vulnerability class.
PoC
This Python script verifies the vulnerability against langflowai/langflow:latest (v1.7.3) by writing a file outside the user's UUID storage directory.
import requests
BASE_URL = "http://localhost:7860"
# Authenticate to get a valid JWT
token = requests.post(f"{BASE_URL}/api/v1/login", data={"username": "admin", "password": "admin"}).json()["access_token"]
# Payload using directory traversal in the multipart filename
TRAVERSAL_FILENAME = "../../traversal_proof.txt"
SENTINEL_CONTENT = b"CVE_RESEARCH_SENTINEL_KEY"
resp = requests.post(
f"{BASE_URL}/api/v2/files/",
headers={"Authorization": f"Bearer {token}"},
files={"file": (TRAVERSAL_FILENAME, SENTINEL_CONTENT, "text/plain")},
)
print(f"Status: {resp.status_code}") # Returns 201
# The file is successfully written to `/app/data/.cache/langflow/traversal_proof.txt`
Server Logs:
2026-02-19T10:04:54.031888Z [info ] File ../traversal_proof.txt saved successfully in flow 3668bcce-db6c-4f58-834c-f49ba0024fcb.
2026-02-19T10:05:51.792520Z [info ] File secret_image.png saved successfully in flow 3668bcce-db6c-4f58-834c-f49ba0024fcb.Docker cntainer file:
user@40416f6848f2:~/.cache/langflow$ ls
3668bcce-db6c-4f58-834c-f49ba0024fcb profile_pictures secret_key traversal_proof.txtImpact
Authenticated Arbitrary File Write. An attacker can overwrite critical system files, inject malicious Python components, or overwrite .ssh/authorized_keys to achieve full Remote Code Execution on the host server.
Credited to akshatgit, abhinavagarwal07, Jkavia, andifilhohub.
Questions
- How is this different from CVE-2025-68478?
That bug was fixed in 1.7.1 with a filename validator on URL path parameters. This one uses the multipart upload filename, which the validator does not cover, and the storage layer has no containment check.
- Does the attacker need to log in?
Yes, the CVSS vector requires low privileges. A default or weak login makes that easy.
- Which version fixes CVE-2026-33309?
Langflow 1.9.0. Versions from 1.2.0 up to but not including 1.9.0 are vulnerable.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Langflow vulnerabilities
All Langflow entriesCVE-2026-105697
Langflow: OS command injection (RCE) via arbitrary command in MCP stdio server configuration
critical9.9Oct 7, 2026CVE-2026-105698
Langflow : Cross-user flow access and vertex execution via deprecated /api/v1/build/{flow_id}/vertices endpoints
medium5.4Oct 7, 2026CVE-2026-105699
Langflow has Authenticated Cross-Project File Disclosure via Unscoped MCP Resource Handlers
high7.1Oct 7, 2026CVE-2026-105741
Langflow: IP Spoofing Bypass via `X-Forwarded-For` Allowing Remote Configuration Write
high7.1Oct 7, 2026CVE-2026-10561
Langflow: PythonREPLComponent executes unsandboxed Python code, enabling authenticated RCE and privilege escalation
critical9.9Oct 6, 2026GHSA-j8f7-x8jm-wmm4
Langflow: SSRF in URL-taking components (protection disabled by default / warn-only, not applied to RSS, SearXNG, Web Search, Home Assistant, Glean, Docling)
medium6.3Oct 6, 2026
