{"id":"CVE-2026-42048","aliases":["CVE-2026-42048","GHSA-9whx-c884-c68q","PYSEC-2026-377"],"related":[],"kind":"vulnerability","state":"published","title":"Langflow: Path Traversal in Langflow Knowledge Bases API","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\nLangflow 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.\n\n## Details\nThe vulnerability exists in the `delete_knowledge_bases_bulk` function within `src/backend/base/langflow/api/v1/knowledge_bases.py`. \n\nThis 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.\n\n## PoC (Proof of Concept)\nFor the **Bulk Delete** endpoint, an authenticated attacker can supply a traversal sequence in the `kb_names` parameter:\n`../victim_user/kb_name`\n\nBecause the path is passed directly to `shutil.rmtree()` without containment checks, this payload deletes directories outside the intended scope.\n\n## Impact\nAny Langflow instance exposing this endpoint to authenticated users is vulnerable. This exposes the server to:\n* **Cross-user data compromise:** Deletion of directories within another tenant's knowledge base space.\n* **Arbitrary filesystem manipulation:** Directory deletion at any path on the server where the application has write permissions.\n* **Service disruption & Data Loss:** Deletion of critical application files or unrecoverable data loss if backups are co-located on the same filesystem.\n\n## Fixes\nThe 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.\n\n## Acknowledgements\nThanks to the security researchers who responsibly disclosed this vulnerability:\n* @ddlxstudio\n* @nekros1xx","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-05-05T18:28:59.000Z","modified":"2026-11-16T15:30:03.426Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H","score":9.6,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H","score":9.6,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H","score":9.6,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H","score":9.6,"rating":"CRITICAL"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 1.9.0","status":"affected"}],"vendor":"langflow-ai","product":"langflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.9.0"}],"ecosystem":"PyPI","package":"langflow","purl":"pkg:pypi/langflow","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.9.0"}],"vendor":"langflow","product":"langflow","cpe":"cpe:2.3:a:langflow:langflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.9.0"}],"ecosystem":"PyPI","package":"langflow","purl":"pkg:pypi/langflow","source":"pysec"}],"references":[{"url":"https://github.com/langflow-ai/langflow/security/advisories/GHSA-9whx-c884-c68q","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42048","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/langflow-ai/langflow","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/langflow/PYSEC-2026-377.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/langflow","tags":["package","web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-9whx-c884-c68q","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-13T14:13:40.432Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42048","url":"https://www.cve.org/CVERecord?id=CVE-2026-42048","licence":"CVE Terms of Use","modified":"2026-05-13T14:14:16.193Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9whx-c884-c68q","url":"https://github.com/advisories/GHSA-9whx-c884-c68q","licence":"CC-BY-4.0","modified":"2026-11-16T15:30:03.426Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42048","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42048","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-377","url":"https://osv.dev/vulnerability/PYSEC-2026-377","licence":"CC-BY-4.0","modified":"2026-07-13T16:15:26.989Z"}],"updatedAt":"2026-11-25T22:59:21.443Z","epss":{"score":0.04195,"percentile":0.91178,"date":"2026-12-01T12:00:22.000Z"}}