Summary
Flowise versions before 3.1.3 contain a command execution vulnerability in the Custom MCP node when the stdio protocol is enabled. An authenticated user may manipulate environment variables and command arguments to execute arbitrary system commands when the node processes a configured runtime command.
Affected context
The vulnerability occurs in Flowise deployments using the Custom MCP node with CUSTOM_MCP_PROTOCOL set to stdio. It becomes risky when authenticated users can configure or influence the node's environment variables, command arguments, or working-directory behavior, and when validation does not fully constrain the resulting process invocation.
Exploit preconditions
- Attack surface: Flowise Custom MCP node configuration and process execution
- Required access: An authenticated account with permissions to create or modify relevant node configurations
- Trigger point: Startup or execution of a Custom MCP process using the stdio protocol
- Why exploitation is possible: User-influenced environment variables, arguments, and execution context can bypass intended validation and affect the commands or interpreter behavior used by the node
Why this happens
The underlying flaw is insufficient separation between user-controlled configuration and operating-system process execution. Environment variables, command arguments, and working-directory values are accepted or composed in a way that permits validation bypasses and unintended command interpretation.
This behavior maps to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code, because attacker-influenced values can alter how a runtime interpreter or process launcher evaluates and executes configured instructions.
Potential impact
- An attacker may execute arbitrary operating-system commands
- The Flowise host or container could be compromised
- Application data, credentials, or connected services may be exposed
- Attackers could modify workflows or abuse Flowise as a platform for further movement
- The vulnerability could contribute to data integrity or supply-chain risks
General mitigation guidance
Mitigation generally focuses on reducing trust in node configuration and preventing user-controlled values from influencing process execution.
Common defensive patterns include:
- Allowing only fixed, explicitly approved commands and arguments
- Treating environment variables and working-directory settings as administrator-controlled configuration
- Applying strict schema validation and canonicalization before process creation
- Avoiding shell interpretation and dynamic evaluation of configuration-derived values
- Running spawned processes with least privilege and isolated filesystem, network, and operating-system permissions
- Restricting access to Custom MCP configuration to trusted administrators
- Separating the Flowise service account from sensitive host and cloud credentials
How teams detect issues like this
Organizations can look for:
- Static analysis findings involving dynamic process creation, shell invocation, or interpreter execution
- Code review signals where node configuration values flow into environment construction, command arguments, or working-directory selection
- Security policies that prohibit user-controlled values from reaching process-launching APIs
- Runtime monitoring for unexpected child processes, unusual command interpreters, or outbound connections from Flowise workers
- Audit events showing unexpected changes to Custom MCP nodes or stdio protocol settings
Automated code review and software composition analysis tools may help identify unsafe process-execution patterns, but should be complemented by manual review of authorization and trust boundaries.

