Langflow Knowledge Base Path Traversal / Arbitrary Directory Deletion (CVE-2026-42048)
by EQSTLab · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-42048 (GHSA-9whx-c884-c68q)
- Category
- web
- Affected product
- Langflow (Knowledge Bases bulk delete API)
- Affected versions
- Before 1.9.0 (fixed in 1.9.0); lab pins 1.8.4
- Disclosed
- 2026-07-05
- Patch status
- patched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-05 |
| Author / Researcher | EQSTLab |
| CVE / Advisory | CVE-2026-42048 (GHSA-9whx-c884-c68q) |
| Category | web |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | langflow, path-traversal, arbitrary-file-deletion, cwe-22, api, docker-lab, knowledge-base |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Langflow (Knowledge Bases bulk delete API) |
| Versions Affected | Before 1.9.0 (fixed in 1.9.0); lab pins 1.8.4 |
| Language / Platform | Python PoC + Docker lab targeting the Langflow REST API |
| Authentication Required | Yes (low-privilege authenticated user) |
| Network Access Required | Yes |
Summary
Langflow’s DELETE /api/v1/knowledge_bases bulk-delete endpoint accepts a list of kb_names values and builds a filesystem path for each by joining it onto the current user’s Knowledge Base directory, without normalizing or validating that the resulting path stays inside that directory. Because Python’s pathlib lets an absolute path component on the right side of the / operator override everything before it, an authenticated attacker can pass an absolute path (or a ../-laden relative path) in kb_names to make Langflow recursively delete an arbitrary directory the process has permission to remove — outside the intended Knowledge Base storage root. This is a CWE-22 improper path restriction issue that requires no code execution to cause damage; a single authenticated API call is enough to destroy data.
Vulnerability Details
Root Cause
The bulk-delete handler manually constructs kb_user_path / kb_name without calling Path.resolve() or verifying the resolved path remains inside the authenticated user’s Knowledge Base directory before invoking recursive deletion, unlike other Knowledge Base endpoints that use a safer path-resolution helper.
Attack Vector
- Attacker authenticates to Langflow (low privilege is sufficient,
PR:L). - Attacker sends
DELETE /api/v1/knowledge_baseswith a JSON body such as{"kb_names": ["/target/CVE-2026-42048"]}. - Langflow joins the attacker-controlled
kb_nameonto the base KB directory; because the supplied value is an absolute path,pathlibresolves it to the literal target path, escaping the intended KB root. - Langflow’s deletion helper recursively removes the resolved directory as the Langflow process user.
Impact
An authenticated attacker can delete arbitrary directories reachable by the Langflow process, including other users’ Knowledge Base data or application-owned directories, causing data loss and service disruption without needing code execution.
Environment / Lab Setup
Target: Langflow 1.8.4 (vulnerable), wrapped by a challenge proxy on port 9101
Attacker: Python 3 (stdlib) or curl; Docker to build/run the reproduction lab
Proof of Concept
PoC Script
See
poc.py,challenge-proxy.py,Dockerfile, anddocker-entrypoint.shin this folder.
| |
poc.py sends a DELETE /api/v1/knowledge_bases request with the attacker-controlled kb_names path to the lab’s challenge proxy; a successful exploit is confirmed when the /status endpoint reports the target directory no longer exists. challenge-proxy.py and the Dockerfile stand up a disposable Langflow 1.8.4 instance with a seeded target directory (/target/CVE-2026-42048) for safe, repeatable testing.
Detection & Indicators of Compromise
Signs of compromise:
- Unexpected disappearance of directories outside a user’s own Knowledge Base storage path
- API access logs showing
DELETE /api/v1/knowledge_baseswith anomalouskb_namesvalues (absolute paths,../) - Application errors referencing missing Knowledge Base or runtime directories after a bulk-delete call
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade to Langflow 1.9.0 or later |
| Interim mitigation | Validate and normalize kb_names server-side with Path.resolve() and confirm containment within the user’s KB root before deletion; restrict filesystem permissions available to the Langflow process |
References
Notes
Mirrored from https://github.com/EQSTLab/CVE-2026-42048 on 2026-07-05.
| |