Wysoka

langflow: /profile_pictures/{folder_name}/{file_name} endpoint file reading

  • Ujawniono: 20.03.2026
  • Aktualizacja: 11.10.2026 12:19

Vulnerability

Path Traversal in GET /api/v1/files/profile_pictures/{folder_name}/{file_name}

The download_profile_picture function in src/backend/base/langflow/api/v1/files.py constructed file paths by directly concatenating the user-supplied folder_name and file_name path parameters without sanitization or boundary validation. The resulting path was passed to the filesystem without verifying it remained within the intended directory.

An unauthenticated attacker could supply traversal sequences (e.g. ../secret_key) to navigate outside the profile pictures directory and read arbitrary files on the server filesystem.

This exposed the server to:

  • Sensitive file disclosure — any file readable by the application process could be retrieved
  • Secret key exfiltration — the application's secret_key file, used as JWT signing material, could be read directly via ../secret_key
  • Authentication bypass — with the secret_key in hand, an attacker can forge valid JWT tokens and authenticate as any user, including administrators

Proof of Concept

bash
curl --path-as-is 'http://<host>:7860/api/v1/files/profile_pictures/../secret_key'

A successful response returns the raw secret key value used to sign all JWT authentication tokens in the instance.


Fix

The fix was applied in src/backend/base/langflow/api/v1/files.py (PR #12263).

Two layers of defense were introduced:

1. Typed path validation — the folder_name and file_name parameters were changed from plain str to ValidatedFolderName and ValidatedFileName annotated types that reject traversal characters at the FastAPI input layer.

2. Path containment check — Path.name is used to strip any directory component from the inputs before path construction, and Path.is_relative_to() verifies the resolved path remains within the allowed base directory. This replaces the previous startswith() check, which was susceptible to prefix-ambiguity bugs.

diff
 @router.get("/profile_pictures/{folder_name}/{file_name}")
 async def download_profile_picture(
-    folder_name: str,
-    file_name: str,
+    folder_name: ValidatedFolderName,
+    file_name: ValidatedFileName,
     settings_service: Annotated[SettingsService, Depends(get_settings_service)],
 ):
diff
-        file_path = (config_path / "profile_pictures" / folder_name / file_name).resolve()
+        safe_folder = Path(folder_name).name
+        safe_file = Path(file_name).name
+        file_path = (config_path / "profile_pictures" / safe_folder / safe_file).resolve()

         allowed_base = (config_path / "profile_pictures").resolve()
-        if not str(file_path).startswith(str(allowed_base)):
-            raise HTTPException(status_code=404, detail="Profile picture not found")
+        if not file_path.is_relative_to(allowed_base):
+            raise HTTPException(status_code=404, detail="Profile picture not found")

Workarounds

If you cannot upgrade immediately, restrict network access to the /api/v1/files/profile_pictures/ endpoint at the reverse-proxy or firewall level. Rotating the secret_key is strongly recommended if exposure cannot be ruled out.


Acknowledgements

We thank the security researcher who responsibly disclosed this vulnerability.

Czego dotyczy

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

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) langflow < 1.7.1 1.7.1

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Słabość (CWE)
CWE-22
Platforma
Python (PyPI)
Paczka
langflow
Ujawniono
20.03.2026
Aktualizacja
11.10.2026 12:19

Źródła i licencje

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

OSV / GitHub Advisory Database - GHSA-ph9w-r52h-28p7 - 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. langflow: /profile_pictures/{folder_name}/{file_name} endpoint file reading ten wpis
    Wysoka CVE-2026-33497 < 1.7.1 1.7.1
  8. Wysoka · 7.5 CVE-2026-33484 >= 1.0.0, < 1.9.0 1.9.0
  9. 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.