---
id: "CVE-2026-42048"
page: "https://infrastack.ai/live/CVE-2026-42048"
kind: "vulnerability"
aliases: ["CVE-2026-42048", "GHSA-9whx-c884-c68q"]
title: "Langflow Knowledge Bases API is Vulnerable to Path Traversal"
severity: "critical"
cvss: 9.6
epss: 0.04195
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "langflow", "fixed": ["1.9.0"], "affected": "<= 1.8.4", "ecosystem": "pypi"}, {"name": "langflow", "fixed": ["1.9.0"], "affected": "< 1.9.0", "ecosystem": "vendor"}, {"via": "cpe", "name": "langflow", "fixed": ["1.9.0"], "affected": "< 1.9.0", "ecosystem": "pypi"}]
ecosystems: ["pypi", "vendor"]
tags: ["ai-apps", "ai-tooling", "cwe-22", "langflow", "python", "self-hosted"]
not_affected_if: ["langflow-1.9.0-or-later", "no-multi-user-access"]
published_at: "2026-05-05T18:28:59+00:00"
first_seen_at: "2026-11-16T15:17:21+00:00"
updated_at: "2026-11-16T15:37:59+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-9whx-c884-c68q", "first_seen_at": "2026-11-16T15:17:21+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-42048", "first_seen_at": "2026-11-16T15:37:59+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.04195, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-42048"}]
---

# Langflow Knowledge Bases API is Vulnerable to Path Traversal

Link for people: https://infrastack.ai/live/CVE-2026-42048 (this .md is for agents)

Langflow's bulk delete endpoint for Knowledge Bases builds file paths from user-supplied names without checking them, so path traversal sequences are accepted. An authenticated attacker can make the server call a recursive delete on arbitrary directories, including other users' knowledge bases.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:langflow affected <= 1.8.4 fixed 1.9.0
- vendor:langflow affected < 1.9.0 fixed 1.9.0
- pypi:langflow affected < 1.9.0 fixed 1.9.0

## How to check

- Check the installed version with `pip show langflow`; versions `1.8.4` and earlier are affected.
- Check whether the Knowledge Bases API is reachable by users who hold accounts on your instance.

## Fix

- `langflow` upgrade to `1.9.0` or later (fixed in PR #12243, with containment checks backported from PR #12337).

## Timeline

- 2026-11-16T15:17:21+00:00 ghsa https://github.com/advisories/GHSA-9whx-c884-c68q
- 2026-11-16T15:37:59+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-42048

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/langflow-ai/langflow/security-advisories/GHSA-9whx-c884-c68q
- [advisory] Maintainer's advisory: github.com https://github.com/langflow-ai/langflow/security/advisories/GHSA-9whx-c884-c68q

## From the sources

## 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

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
