CVE-2026-42048
JSON

9.6critical

Langflow: Path Traversal in Langflow Knowledge Bases API

Severity
9.6critical CVSS:3.1 by GitHub_M
Exploit likelihood
4.20% (higher than 91% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-9whx-c884-c68qPYSEC-2026-377

Description

Langflow is a tool for building and deploying AI-powered agents and workflows. Prior to 1.9.0, Langflow is vulnerable to Path Traversal in the Knowledge Bases API (DELETE /api/v1/knowledge_bases). This occurs because user-supplied knowledge base names are concatenated directly into file paths without proper sanitization or boundary validation. An authenticated attacker can exploit this flaw to delete arbitrary directories anywhere on the server's filesystem, leading to data loss and potential service disruption. This vulnerability is fixed in 1.9.0.

Affected

Product or packageVersionsReported by
langflow-ai langflow< 1.9.0CVE List
langflow (PyPI)before 1.9.0GitHub Advisory Database, PyPA Advisory Database
langflow langflowbefore 1.9.0NVD

All scores

GitHub_M9.6critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H
GitHub9.6critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H
PyPA Advisory Database9.6critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H

Classification

CWE-22

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Langflow is a tool for building and deploying AI-powered agents and workflows. Prior to 1.9.0, Langflow is vulnerable to Path Traversal in the Knowledge Bases API (DELETE /api/v1/knowledge_bases). This occurs because user-supplied knowledge base names are concatenated directly into file paths without proper sanitization or boundary validation. An authenticated attacker can exploit this flaw to delete arbitrary directories anywhere on the server's filesystem, leading to data loss and potential service disruption. This vulnerability is fixed in 1.9.0.

GitHub Advisory Database

Summary

Langflow is vulnerable to Path Traversal in the Knowledge Bases API (DELETE /api/v1/knowledge_bases). This occurs because user-supplied knowledge base names are concatenated directly into file paths without proper sanitization or boundary validation. An authenticated attacker can exploit this flaw to delete arbitrary directories anywhere on the server's filesystem, leading to data loss and potential service disruption.

Details

The vulnerability exists in the delete_knowledge_bases_bulk function within src/backend/base/langflow/api/v1/knowledge_bases.py.

This function constructs file paths directly from the user-supplied kb_names parameter. While other knowledge base endpoints safely route through standard path resolution (e.g., _resolve_kb_path()), the bulk delete handler bypasses this entirely. It builds the path manually and passes it directly to shutil.rmtree() without validating if the resulting path resolves outside the intended user directory.

PoC (Proof of Concept)

For the Bulk Delete endpoint, an authenticated attacker can supply a traversal sequence in the kb_names parameter: ../victim_user/kb_name

Because the path is passed directly to shutil.rmtree() without containment checks, this payload deletes directories outside the intended scope.

Impact

Any Langflow instance exposing this endpoint to authenticated users is vulnerable. This exposes the server to:

  • Cross-user data compromise: Deletion of directories within another tenant's knowledge base space.
  • Arbitrary filesystem manipulation: Directory deletion at any path on the server where the application has write permissions.
  • Service disruption & Data Loss: Deletion of critical application files or unrecoverable data loss if backups are co-located on the same filesystem.

Fixes

The issue was addressed in PR #12243, which applies Path.resolve() to normalize the supplied path and validates that it starts with the authenticated user's directory before deletion. Subsequent updates (backported from PR #12337) introduced robust containment checks using Path.is_relative_to() to prevent prefix-ambiguity bugs.

Acknowledgements

Thanks to the security researchers who responsibly disclosed this vulnerability:

  • @ddlxstudio
  • @nekros1xx
NVD (es)

Langflow es una herramienta para construir y desplegar agentes y flujos de trabajo impulsados por IA. Antes de la 1.9.0, Langflow es vulnerable a un salto de ruta en la API de Bases de Conocimiento (DELETE /api/v1/knowledge_bases). Esto ocurre porque los nombres de bases de conocimiento proporcionados por el usuario se concatenan directamente en las rutas de archivo sin una sanitización o validación de límites adecuada. Un atacante autenticado puede explotar esta falla para eliminar directorios arbitrarios en cualquier lugar del sistema de archivos del servidor, lo que lleva a la pérdida de datos y a una posible interrupción del servicio. Esta vulnerabilidad está corregida en la 1.9.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-42048 changed 2026-05-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-9whx-c884-c68q changed 2026-11-16CC-BY-4.0
NVDCVE-2026-42048 changed 2026-11-11Public domain
PyPA Advisory DatabasePYSEC-2026-377 changed 2026-07-13CC-BY-4.0