NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Langflow

CVE-2026-42048: Langflow Knowledge Bases API is Vulnerable to Path Traversal

criticalCVSS 3.1 9.6GHSA-9whx-c884-c68q

Langflow 1.8.4 and earlier has a path traversal in the bulk delete endpoint of the Knowledge Bases API. A logged-in user can pass `../` sequences in kb_names and make the server delete directories anywhere the application can write, including other users' knowledge bases. Upgrade to Langflow 1.9.0.

Published May 5, 2026 · Updated Nov 16, 2026 · Analysis Oct 28, 2026

What an attacker can do

The handler delete_knowledge_bases_bulk in src/backend/base/langflow/api/v1/knowledge_bases.py builds file paths by hand from the user-supplied kb_names list. The other knowledge base endpoints resolve paths through _resolve_kb_path(). The bulk delete handler skips that and passes the result straight to shutil.rmtree(), with no check that the path stays inside the caller's own directory.

An attacker needs a valid account on the Langflow instance (low privileges) and network access to the API. They send DELETE /api/v1/knowledge_bases with a name such as ../victim_user/kb_name. The server then deletes that directory. Result: another tenant's knowledge base vanishes, or any directory the Langflow process can write to is removed, such as application files or co-located backups.

This is a destructive flaw, not a data-theft one: the CVSS vector shows high integrity and availability impact and no confidentiality impact. The scope change reflects that the damage reaches beyond the caller's own data. Multi-user Langflow deployments, where several people share one server, carry the most risk.

Who is affected

The pip package langflow at 1.8.4 and earlier. Any instance that exposes the Knowledge Bases API to authenticated users is affected. The advisory gives no lower bound. Check your version:

pip show langflow

langflow

Ecosystem
PyPI
Affected
<= 1.8.4
Fixed in
1.9.0
Check
pip show langflow

How to fix it

Upgrade to Langflow 1.9.0:

pip install --upgrade "langflow>=1.9.0"

The fix in PR 12243 applies Path.resolve() and checks that the path starts with the authenticated user's directory. A later backport from PR 12337 uses Path.is_relative_to() to close prefix-ambiguity bugs. The advisory names no workaround. If you cannot upgrade, limit who has accounts and keep backups on a separate filesystem.

How to tell if you were hit

Search API or reverse proxy logs for DELETE requests to /api/v1/knowledge_bases whose body contains .. or absolute paths in kb_names. Check for knowledge base directories, or other application directories, that disappeared without a matching user action. Users reporting missing knowledge bases is another signal. Compare backups against the live data directory if you suspect deletion.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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

Credited to ddlxstudio, nekros1xx, AntonioABLima, Cristhianzl, andifilhohub.

Questions

Is Langflow 1.8.4 affected by CVE-2026-42048?

Yes. Versions up to and including 1.8.4 are affected. The patched version is 1.9.0.

Does the attacker need an account?

Yes. The advisory requires an authenticated user, and the CVSS vector lists low privileges required. No user interaction is needed.

Can this flaw read or leak files?

The advisory describes deletion only. The vector rates confidentiality impact as none.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Langflow vulnerabilities

All Langflow entries