/

CVE-2025-71336

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in Flowise Custom MCP

CVE-2025-71336

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution with Full System Compromise

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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_PASSWORD are unset.
  • Trigger point: Submission of a crafted JSON payload combined with the x-request-from: internal header, 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-from headers.
  • 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.

Sources

SourceLink
github.comgithub.com/FlowiseAI/Flowise/security/advisories/GHSA-6933-jpx5-q87q
vulncheck.comvulncheck.com/advisories/flowise-unsandboxed-remote-code-execution-via-custom-mcp

Frequently asked

questions

Exploitability depends on exposure and configuration. Instances running with default settings (no authentication) and reachable from the network are highly exposed because attackers can directly send crafted requests to the vulnerable endpoint. Deployments behind strict access controls are less exposed but still at risk if internal attackers or compromised services can reach the endpoint.

An attacker needs network-level access to the Flowise instance and the ability to send HTTP requests to /api/v1/node-load-method/customMCP. In many setups, no application-level authentication is required, especially when the environment variables for credentials are not configured, making it accessible to anyone who can reach the service.

The most resilient fix is to remove or strictly contain command-executing capabilities from user-accessible HTTP endpoints, and to only allow tightly controlled, predefined operations through authenticated, authorized interfaces. Where command execution is unavoidable, inputs should be rigorously validated, separated from command construction, and executed in sandboxed, least-privilege environments.

Prevention relies on designing features so that untrusted input never influences command strings or process invocation paths, and on establishing strong authentication and role-based authorization around operational controls. Complement this with secure coding guidelines that discourage direct shell calls, automated security checks in CI, and regular code reviews focused on areas that manage external process execution or system-level operations.

Find out what's already
exploitable in your codebase.