Flowise - Remote Code Execution via MCP Security Bypass in validateCommandFlags and validateArgsForLocalFileAccess
Description
Flowise before 3.1.2 contains multiple OS command injection vulnerabilities in the Custom MCP Server feature due to incomplete command-flag validation and a regex bypass in local file access restrictions. An attacker with a Flowise account of any role, or API access with view/update permissions for chatflows, can configure a malicious MCP server to bypass the validateCommandFlags blocklist (for example, 'docker build' is not blocked, and 'npx --yes' is not blocked while only '-y' is) and the validateArgsForLocalFileAccess checks, resulting in execution of arbitrary commands on the Flowise host.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1Patches
Vulnerability mechanics
Root cause
"Incomplete command-flag blocklists and a regex bypass in local file access validation allow arbitrary command execution via the Custom MCP Server feature."
Attack vector
An attacker with any Flowise account role or API access with view/update permissions for chatflows can configure a malicious Custom MCP Server. Three bypass methods exist: (1) using `docker build` (not blocked) to pull a remote Dockerfile with malicious RUN instructions [ref_id=1]; (2) using `npx --yes` (the long-parameter alias is not blocked while only `-y` is) to auto-install and execute an arbitrary npm package [ref_id=1]; (3) using `node` with a `//`-prefixed absolute path to bypass the regex in `validateArgsForLocalFileAccess` and execute a local uploaded script [ref_id=1]. All three lead to arbitrary command execution on the Flowise host.
Affected code
The vulnerable functions are `validateCommandFlags` and `validateArgsForLocalFileAccess` in `packages/components/nodes/tools/MCP/core.ts`. `validateCommandFlags` uses an incomplete blocklist that omits `build` for Docker and `--yes` for npx. `validateArgsForLocalFileAccess` uses a regex `/^\/[^/]/` that fails to block paths starting with `//`, allowing bypass of local file access restrictions.
What the fix does
The advisory does not include a patch diff, but the fix must address three gaps: add `build` to the Docker blocklist in `COMMAND_FLAG_BLACKLIST`; add `--yes` to the npx blocklist; and correct the regex in `validateArgsForLocalFileAccess` so that paths starting with `//` are also rejected. Without these changes, an attacker can chain the bypasses to achieve RCE.
Preconditions
- authAttacker must have a Flowise account (any role) or API access with view/update permissions for chatflows
- configThe deployment environment must have the `docker` command for the first bypass, or `npx` for the second, or `node` for the third
- inputAttacker must be able to configure a Custom MCP Server via UI or API
Generated on Jun 24, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2News mentions
0No linked articles in our index yet.