/

CVE-2025-71338

Severity:

CRITICAL RISK

(10.0)

Path Traversal (CWE-73) in Flowise Document Loader

CVE-2025-71338

Modified

Vulnerability type

Category:

Path Traversal / Filesystem Manipulation

CWE:

CWE-73

Impact:

Arbitrary File Write leading to Remote Code Execution

Severity:

CRITICAL RISK

(10.0)

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

Flowise exposes a path traversal flaw in its document-store loader API that lets attackers write files outside the intended storage directory by abusing the fileName parameter.

When unauthenticated users can send crafted requests with directory traversal sequences, they may overwrite application files such as package.json and potentially gain remote code execution on restart.

Affected context

This vulnerability arises in Flowise deployments that expose the /api/v1/document-store/loader/process endpoint and accept user-controlled file names for document storage.

It is most relevant when the application runs with filesystem write permissions to its own installation path or other sensitive directories, and when restart or deployment processes trust local files (e.g., package.json) for configuration and execution behavior.

The risk increases in environments where this API is reachable without authentication or strong network-level access controls.

Exploit preconditions

  • Attack surface: HTTP requests to the /api/v1/document-store/loader/process endpoint.
  • Required access: Network reachability to the Flowise instance; in affected setups, no authentication is required.
  • Trigger point: Supplying a crafted fileName parameter containing ../ sequences that is used directly to construct filesystem paths.
  • Why exploitation is possible: The server-side code fails to normalize and validate user-supplied path components, allowing traversal out of the intended directory and arbitrary file writes into sensitive locations.

Why this happens

The core issue is improper handling of user-controlled path inputs combined with filesystem write operations.

Flowise relies on the fileName parameter from the request to construct paths without robust normalization, canonicalization, or enforcement of a strict base directory.

This maps to CWE-73: External Control of File Name or Path, where external input influences file system locations and enables writing or modifying files that should not be directly controllable by users.

Abstractly, the insecure pattern is: concatenate untrusted user input with filesystem paths and perform write operations without enforcing directory boundaries or validating the resulting canonical path.

Potential impact

  • Attackers may overwrite critical application files such as package.json.
  • They could introduce or modify scripts that are executed during application startup or build steps.
  • An attacker can potentially achieve remote code execution when the application restarts or is redeployed.
  • They may corrupt configuration or data files, leading to denial of service or loss of integrity.
  • They could plant fraudulent content or logs to mislead operators and obscure other malicious activity.

General mitigation guidance

Effective mitigation focuses on eliminating externally controlled filesystem paths and tightening trust boundaries around file operations.

Common defensive patterns include:

  • Restricting all user-supplied file names to a predetermined, whitelisted storage directory and rejecting any paths that escape it.
  • Normalizing and canonicalizing requested paths, then validating that they remain within an allowed base directory before performing any filesystem write.
  • Using abstract storage interfaces (e.g., object stores or logical identifiers) instead of raw paths derived from user input.
  • Applying least-privilege to the application runtime so it cannot modify its own installation directory or other sensitive system paths.
  • Introducing authentication and authorization checks around document ingestion endpoints, reducing exposure to arbitrary unauthenticated input.

How teams detect issues like this

Detection efforts generally focus on identifying path traversal patterns and uncontrolled file writes in code and runtime behavior.

Useful strategies include:

  • Static analysis rules that flag string concatenation of user-controlled input with filesystem paths, particularly when ../ sequences or absolute paths are allowed.
  • Code reviews that look for direct use of request parameters as file names, missing canonicalization, and absence of base directory enforcement.
  • Logging and alerting on unexpected writes to application root directories or configuration files such as package.json, especially initiated via public-facing APIs.
  • Policy-based controls that prohibit application processes from writing to installation directories, enforced via container runtimes or OS-level mandatory access control.

Sources

SourceLink
github.comgithub.com/FlowiseAI/Flowise/releases/tag/flowise%402.2.7-patch.1
github.comgithub.com/FlowiseAI/Flowise/security/advisories/GHSA-8vvx-qvq9-5948
vulncheck.comvulncheck.com/advisories/flowise-arbitrary-file-write-to-remote-code-execution-via-document-store-api

Frequently asked

questions

Yes. If the /api/v1/document-store/loader/process endpoint is exposed over the network, attackers can exploit the flaw remotely by sending crafted HTTP requests without needing local filesystem access.

The attacker needs network access to the Flowise instance and the ability to reach the vulnerable endpoint. In affected configurations, no prior authentication or special privileges are required.

The most robust fix is to stop using raw user-supplied paths. Instead, constrain all file operations to a dedicated storage directory, canonicalize paths, verify they remain within that directory, and reject any input that attempts to traverse outside it. Combine this with least-privilege filesystem permissions so the application cannot overwrite its own executables or configuration files.

Design APIs so that users supply logical identifiers rather than direct file paths, enforce strict directory boundaries and path validation in all file operations, add authentication and authorization around sensitive endpoints, and incorporate secure coding checks and automated static analysis into the development lifecycle to catch uncontrolled file path usage early.

Find out what's already
exploitable in your codebase.