Summary
Flowise contains an arbitrary file access issue where chatflowId and chatId parameters are not validated as UUIDs or numeric identifiers before being used in file system operations.
An unauthenticated attacker can leverage path traversal values to read and write arbitrary files via exposed API endpoints, which can ultimately lead to remote code execution when writable paths are abused.
Affected context
This vulnerability occurs in Flowise deployments that expose the /api/v1/chatflows, /api/v1/get-upload-file, and /api/v1/openai-assistants-file/download endpoints without additional access controls.
It is triggered when the application accepts unvalidated chatflowId and chatId parameters and uses them directly to construct storage file paths.
Environments where the application process can access sensitive directories or write to executable locations are especially at risk, though exact impact depends on host configuration and deployment hardening.
Exploit preconditions
- Attack surface: Publicly accessible HTTP API endpoints:
/api/v1/chatflows(viaaddBase64FilesToStorage)/api/v1/get-upload-file/api/v1/openai-assistants-file/download(viastreamStorageFile)- Required access: No authentication is required if these endpoints are exposed as described; attacker only needs network access to the Flowise instance.
- Trigger point: Supplying crafted
chatflowIdorchatIdvalues containing path traversal sequences (e.g.,../../../../../tmp) in API requests. - Why exploitation is possible: The application fails to validate or constrain these identifiers to expected formats (UUIDs or numbers) and uses them directly to build file system paths, allowing navigation outside the intended storage directory and arbitrary file read/write.
Why this happens
The root cause is improper neutralization of input used in file paths, mapped to CWE-73: External Control of File Name or Path.
Instead of treating chatflowId and chatId as opaque identifiers and enforcing strict validation and directory constraints, the code composes file system paths using these untrusted parameters.
This pattern allows attackers to introduce relative path components (../) or absolute paths, escaping the intended storage area and interacting with files elsewhere on the server's filesystem.
Potential impact
- An attacker may read arbitrary files accessible to the Flowise process, including configuration files, credentials, or logs.
- An attacker may write arbitrary files to locations writable by the application, potentially planting backdoors or modifying application behavior.
- Arbitrary file write could lead to remote code execution if written files are later interpreted as code, scripts, or configuration by the system.
- The attacker could exfiltrate sensitive data or tamper with stored application data and user content.
General mitigation guidance
Mitigation should focus on strictly constraining file path construction and reducing trust in user-supplied identifiers.
Common defensive patterns include:
- Validating
chatflowIdandchatIdas well-formed UUIDs or numeric IDs, rejecting any value that does not match expected patterns. - Using application-level storage keys and mapping them to filesystem locations internally, rather than allowing direct path influence from client input.
- Enforcing a fixed base directory for file operations and preventing navigation outside it by normalizing paths and checking for traversal sequences.
- Running the application with least-privilege filesystem permissions, limiting readable and writable areas to dedicated storage directories.
- Separating executable code paths from user-controlled storage directories to reduce the chance that written files are executed.
How teams detect issues like this
Detection efforts can leverage a combination of code-level and runtime signals:
- Static analysis rules that flag concatenation of request parameters into filesystem paths or calls to file APIs without prior validation.
- Code review checklists that highlight any use of IDs or path fragments from HTTP parameters in file operations, and verify that inputs are normalized and constrained.
- Logging and monitoring of file access patterns, including unusual traversal into system directories or unexpected write operations from API flows.
- Security policies in CI/CD pipelines that require validation routines for resource identifiers and restrict direct use of user input in I/O paths.
- Optional use of automated application security testing tools that simulate path traversal payloads against file-related endpoints.

