OSV 1.4.0 · github-reviewed · 修改于 2026-07-20 21:41
发布时间
2026-06-17 01:35
GitHub 审查时间
2026-06-17 01:35
NVD 发布时间
2026-06-24 01:16
源文件
advisories/github-reviewed/2026/06/GHSA-79ph-745m-6wxq/GHSA-79ph-745m-6wxq.json
Langflow 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.
The vulnerability exists in the create_knowledge_base function within src/backend/base/langflow/api/v1/knowledge_bases.py.
This 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.
For the Create endpoint, an attacker can supply traversal sequences or absolute paths in the name field:
../victim_user/evil_kb
or
/tmp/pwned
This 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.
Any Langflow instance exposing this endpoint to authenticated users is vulnerable. This exposes the server to:
/app/data).embedding_metadata.json and schema.json files in attacker-targeted paths, potentially corrupting existing knowledge bases.The issue was addressed in PR #12337. The fix introduces the helper function, which uses instead of 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 .
_validate_kb_path_containment()Path.is_relative_to()startswith()403 ForbiddenThanks to the security researchers who responsibly disclosed this vulnerability: