/

CVE-2026-42048

Severity:

CRITICAL RISK

(9.6)

Path Traversal in Langflow Knowledge Bases Deletion API

CVE-2026-42048

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File/Directory Deletion and Service Disruption

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Langflow's Knowledge Bases deletion endpoint previously concatenated user-supplied names directly into filesystem paths, enabling a path traversal condition.

An authenticated attacker could craft specially formatted knowledge base names to delete arbitrary directories on the server, causing data loss and service disruption.

Affected context

This vulnerability affects Langflow deployments exposing the Knowledge Bases API (DELETE /api/v1/knowledge_bases) where:

  • Knowledge base identifiers are accepted from authenticated users and mapped to directories on disk.
  • The server process has permission to delete those directories.
  • Path handling logic constructs filesystem paths by directly appending user input to a base directory without enforcing strict directory boundaries.

It is most relevant in environments where application data, configuration, or other sensitive directories reside on the same filesystem accessible to the Langflow process.

Exploit preconditions

  • Attack surface: HTTP API endpoint DELETE /api/v1/knowledge_bases.
  • Required access: Valid authenticated access with permission to invoke knowledge base deletion.
  • Trigger point: Sending a deletion request where the name or identifier parameter contains path traversal sequences (for example, segments that resolve outside the intended knowledge base directory).
  • Why exploitation is possible: The server concatenates user-supplied values into filesystem paths without normalizing and validating them against an allowed base directory, allowing the resolved path to escape its intended scope.

Why this happens

The underlying bug is a classic path traversal issue, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

The application treats a user-controlled knowledge base name as a trustworthy path segment and appends it directly to a base directory when constructing deletion targets.

Without canonicalization, normalization, or strict checks that the final path remains within an approved root, specially crafted values can cause the filesystem operation to target directories outside the intended knowledge base storage area.

In abstract terms, this reflects a design pattern where file operations depend on untrusted input for path resolution, instead of using validated identifiers mapped to server-controlled paths.

Potential impact

  • Deletion of arbitrary directories accessible to the Langflow process on the server.
  • Loss of application data, including knowledge bases and other stored artifacts.
  • Removal of configuration or runtime directories, leading to partial or complete service outage.
  • Potential corruption of other applications or services sharing the same filesystem.
  • Increased operational overhead due to restoration from backups and incident response efforts.

General mitigation guidance

Effective mitigation focuses on confining filesystem access and eliminating direct path construction from user input:

  • Use opaque, server-generated identifiers for knowledge bases and maintain a mapping from IDs to absolute paths stored in a trusted datastore.
  • Normalize and canonicalize any path derived from user input, then enforce that it resides within a predefined base directory before performing filesystem operations.
  • Avoid accepting raw path fragments or directory names from clients; treat user input as data keys, not filesystem paths.
  • Apply strict allowlists for valid identifier formats (e.g., UUIDs or constrained slugs) to reduce the chance of path traversal sequences.
  • Run the Langflow service under a minimally privileged account, with filesystem permissions restricted to only the directories needed for operation.
  • Consider isolating application data on dedicated directories or volumes to limit blast radius if a path-based flaw occurs.

How teams detect issues like this

Organizations can detect and monitor for similar vulnerabilities through:

  • Static analysis rules that flag direct concatenation of user input into file paths or use of path-unsafe APIs in request handlers.
  • Code reviews that require explicit checks showing:
  • Canonicalization of paths before use.
  • Enforcement that resolved paths remain under known base directories.
  • Separation between user-facing identifiers and internal filesystem paths.
  • Security testing and fuzzing of file-related endpoints with path traversal patterns to validate defensive checks.
  • Runtime monitoring for suspicious deletion patterns, such as removal of directories outside expected data roots or repeated delete operations from a single account.
  • Incorporating automated secure coding checks into CI pipelines to prevent reintroducing path traversal patterns.

Sources

SourceLink
github.comgithub.com/langflow-ai/langflow/security/advisories/GHSA-9whx-c884-c68q

Frequently asked

questions

Yes. Any authenticated user with access to the affected deletion endpoint can exploit it remotely via HTTP, provided they can control the knowledge base name in the request.

The attacker must be authenticated to Langflow and have permission to invoke the Knowledge Bases deletion API. No direct operating system or shell access is required; exploitation happens entirely through the web API.

The safest pattern is to decouple user input from filesystem paths by using server-controlled identifiers and a secure mapping layer, combined with strict path canonicalization and enforcement that all file operations remain within a designated root directory.

Adopt a consistent design rule that user input is never treated as a filesystem path. Use centralized utilities for file operations that:

  • Accept only validated identifiers.
  • Perform canonicalization and boundary checks.
  • Are covered by automated tests and static analysis rules.

Complement this with least-privilege filesystem permissions so that even if a logic error occurs, its impact is constrained.

Find out what's already
exploitable in your codebase.