CVE-2026-42867: Langflow Path Traversal Vulnerability
MODERATECVE-2026-42867 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Langflow libraries in the PyPI ecosystem. The issue involves path traversal in knowledge bases api via creation endpoint. Remediation is available by upgrading affected packages to version 1.9.0.
CVE-2026-42867 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L).
How to Fix CVE-2026-42867
To remediate this vulnerability, upgrade all affected Langflow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install langflow>=1.9.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show langflow
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-42867, inspect your installed packages using pip:
pip show langflow
Analyze the terminal output to locate any version of Langflow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.0), your application is affected.
Note: The pip show langflow command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Langflow, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42867 Affected Langflow Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
langflow
|
PyPI |
< 1.9.0
|
1.9.0
|
References
Frequently Asked Questions
What is CVE-2026-42867?
Which Langflow versions are affected?
What version fixes CVE-2026-42867?
Is langflow affected?
What is the CVSS score of CVE-2026-42867?
What CWE is associated with CVE-2026-42867?
How can I check PyPI dependencies for CVE-2026-42867?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-79ph-745m-6wxq",
"modified" : "2026-07-20T13:41:52Z",
"published" : "2026-06-16T17:35:09Z",
"aliases" : [ "CVE-2026-42867" ],
"summary" : "Langflow: Path Traversal in Knowledge Bases API via Creation Endpoint",
"details" : "## Summary\nLangflow is vulnerable to Path Traversal in the Knowledge Bases API (`POST /api/v1/knowledge_bases`). This occurs because user-supplied knowledge base names are used directly to create file paths without proper sanitization or containment checks. An authenticated attacker can exploit this flaw to create directories and write files anywhere on the server's filesystem.\n\n## Details\nThe vulnerability exists in the `create_knowledge_base` function within `src/backend/base/langflow/api/v1/knowledge_bases.py`. \n\nThis function constructs file paths directly from the user-supplied `name` field without sanitization. The value is concatenated with the user's base directory and passed directly to `kb_path.mkdir()`. Immediately following the directory creation, the application writes `embedding_metadata.json` and `schema.json` into this attacker-controlled path.\n\n## PoC (Proof of Concept)\nFor the **Create** endpoint, an attacker can supply traversal sequences or absolute paths in the `name` field:\n\n`../victim_user/evil_kb`\nor\n`/tmp/pwned`\n\nThis forces `kb_path.mkdir()` to create directories and write specific application files (`embedding_metadata.json` and `schema.json`) at any reachable path on the server.\n\n## Impact\nAny Langflow instance exposing this endpoint to authenticated users is vulnerable. This exposes the server to:\n* **Cross-user data compromise:** Creation of directories and files within another tenant's knowledge base space.\n* **Arbitrary filesystem manipulation:** Directory creation at any path on the server where the application has write permissions (e.g., `/app/data`).\n* **Data overwrite:** Overwriting existing `embedding_metadata.json` and `schema.json` files in attacker-targeted paths, potentially corrupting existing knowledge bases.\n\n## Fixes\nThe issue was addressed in **PR #12337**. The fix introduces the `_validate_kb_path_containment()` helper function, which uses `Path.is_relative_to()` instead of `startswith()` to enforce strict path boundaries and prevent prefix-ambiguity bugs. This helper is applied before any filesystem operations. Regression tests were added to verify that traversal payloads return a `403 Forbidden`.\n\n## Acknowledgements\nThanks to the security researchers who responsibly disclosed this vulnerability:\n* @ddlxstudio\n* @nekros1xx",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "langflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.9.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.8.4"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/langflow-ai/langflow/security/advisories/GHSA-79ph-745m-6wxq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42867"
}, {
"type" : "WEB",
"url" : "https://github.com/langflow-ai/langflow/pull/12337"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-79ph-745m-6wxq"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/langflow-ai/langflow"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/langflow/PYSEC-2026-2566.yaml"
}, {
"type" : "WEB",
"url" : "https://pypi.org/project/langflow"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-16T17:35:09Z",
"nvd_published_at" : "2026-06-23T17:16:58Z"
}
}