Summary
Flowise's Custom MCP feature contains an OS command injection flaw that allows arbitrary command execution through a specially crafted internal request header and JSON payload.
In default or weakly authenticated deployments, an attacker can abuse the /api/v1/node-load-method/customMCP endpoint to run commands on the underlying container or server, leading to full system compromise.
Affected context
This vulnerability appears in Flowise deployments that expose the Custom MCP functionality via the /api/v1/node-load-method/customMCP endpoint.
It is most critical where Flowise is deployed with default settings, without authentication, or without effective role-based access control, and where the application can invoke OS-level commands to launch or manage MCP servers.
The risk increases when the platform is reachable from untrusted networks and runs with elevated privileges or access to sensitive data, logs, or other services.
Exploit preconditions
- Attack surface: HTTP API endpoint
/api/v1/node-load-method/customMCP, reachable over the network. - Required access: Ability to send HTTP requests to the Flowise instance; authentication may not be required if defaults are used and
FLOWISE_USERNAME/FLOWISE_PASSWORDare unset. - Trigger point: Submission of a crafted JSON payload combined with the
x-request-from: internalheader, causing the application to treat the request as trusted and execute associated OS commands. - Why exploitation is possible: The Custom MCP feature executes shell or OS commands based on request data without sufficient validation or sandboxing, and the minimal authentication/authorization model does not adequately restrict or isolate this capability.
Why this happens
The underlying issue is direct use of untrusted request data to construct or trigger OS-level commands in the Custom MCP feature without robust validation, sanitization, or privilege separation.
Flowise implicitly trusts requests marked as internal via the x-request-from header and couples this trust with command execution logic, aligning with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
More generally, the design exposes command-execution capabilities through a network-accessible API without enforcing strong authentication, role-based access control, or sandbox boundaries, allowing attackers to turn configuration or control inputs into arbitrary command execution.
Potential impact
- An attacker can execute arbitrary OS commands on the Flowise host or container.
- The platform's runtime environment may be fully compromised, including access to environment variables, configuration files, and connected services.
- Attackers could deploy additional malware or backdoors, enabling persistent access.
- Sensitive data processed by Flowise, including prompts, documents, and credentials, could be read, modified, or exfiltrated.
- The compromised instance may be used as a pivot point for lateral movement within the broader infrastructure.
General mitigation guidance
Mitigation should focus on minimizing command execution exposure, enforcing strong trust boundaries, and reducing privileges around automation features.
Recommended patterns include:
- Isolate any functionality that needs to run OS commands behind a strict, authenticated control plane and avoid exposing it directly over general-purpose HTTP APIs.
- Replace direct shell command invocation with controlled, parameterized interfaces or well-defined service calls that do not interpret arbitrary user input as commands.
- Apply robust input validation and context-aware constraints to all parameters influencing command execution, rejecting or constraining values outside expected formats and whitelisting permissible operations.
- Implement proper authentication and authorization, including role-based access control, so only tightly scoped, trusted identities may access sensitive operational endpoints.
- Run Flowise and any command-executing components with least privilege, using separate service accounts and restricting filesystem and network access to what is strictly necessary.
- Consider sandboxing command execution (e.g., containers, restricted execution environments) to minimize blast radius should an execution path be abused.
How teams detect issues like this
Detection can rely on combining application-level observability with security-focused analysis of code and infrastructure.
Useful strategies include:
- Static analysis rules that flag direct use of request-derived data in OS command execution APIs (e.g.,
child_process.exec,exec,spawn, or similar primitives), especially where headers or JSON fields change command strings. - Code review practices that focus on features designed to launch external processes or servers, checking for separation between user input, trusted control paths, and execution logic.
- Runtime monitoring and logging of command execution, including correlation of OS-level process creation with specific API endpoints and request metadata such as
x-request-fromheaders. - Behavioral anomaly detection on the Flowise host, watching for unexpected processes, network connections, or file changes originating from the application user or container.
- Policy enforcement in CI/CD pipelines that restrict introduction of new command-executing endpoints without security review, and that fail builds when high-risk patterns like unsanitized shell invocation are detected.

