/

CVE-2026-56274

Severity:

CRITICAL RISK

(9.9)

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

CVE-2026-56274

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution on Application Host

Severity:

CRITICAL RISK

(9.9)

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 Server feature contains OS command injection flaws that let attackers bypass command-flag blocklists and local file access restrictions.

Any user with a Flowise account, or API client with chatflow view/update permissions, can configure a malicious MCP server and trigger arbitrary command execution on the Flowise host when affected flows are run.

Affected context

This vulnerability occurs in Flowise deployments that enable the Custom MCP Server feature and allow users or API clients to create or modify chatflows incorporating MCP server configurations.

Risk is present where command validation relies on partial blocklists and regex-based filters for arguments, rather than strict allowlists and robust sanitization.

The issue is most relevant in multi-tenant or shared environments where users can define MCP endpoints that ultimately invoke shell commands on the Flowise host.

Exploit preconditions

  • Attack surface: Flowise web UI and API endpoints that create, update, or execute chatflows using the Custom MCP Server integration.
  • Required access: Any Flowise account (regardless of role) or API access with view/update permissions for chatflows; no direct host access is needed.
  • Trigger point: Execution of a chatflow that uses a configured MCP server, causing Flowise to run the underlying system command with insufficient validation of flags and arguments.
  • Why exploitation is possible: Command validation relies on an incomplete blocklist (validateCommandFlags) and a regex-based filter for local file access (validateArgsForLocalFileAccess) that can be bypassed. As a result, attacker-controlled command strings and arguments are passed to the OS shell with inadequate constraints.

Why this happens

The root cause is improper neutralization of special elements in OS commands, aligning with CWE-78: OS Command Injection.

Flowise's validation logic attempts to block dangerous command flags and restrict file access using pattern matching, but these controls are partial and easily circumvented.

Instead of enforcing a strict allowlist of safe commands and arguments, the implementation trusts user-supplied command lines and relies on fragile regex checks, allowing adversaries to craft MCP configurations that execute arbitrary commands on the host.

Potential impact

  • Attackers may execute arbitrary OS commands on the Flowise server.
  • Compromise of the Flowise application, including chatflows, stored prompts, and connected credentials.
  • Unauthorized access to or modification of local files on the host system.
  • Data exfiltration from the server or connected data sources.
  • Use of the compromised host for lateral movement within the infrastructure.
  • Potential full system takeover depending on the privileges of the Flowise process.

General mitigation guidance

Effective mitigation focuses on eliminating opportunities for user-controlled command strings to reach the OS without strict constraints.

Recommended patterns include:

  • Replace generic shell invocation with explicit, parameterized APIs that do not interpret composite command strings (e.g., using child process libraries with fixed executables and argument schemas).
  • Implement strict allowlists of supported commands and flags for MCP servers, rejecting any configuration outside predefined safe operations.
  • Avoid regex-only validation for command arguments; instead, use structured parsing and validation aligned with expected types, paths, and formats.
  • Isolate command execution in hardened sandboxes or containers with reduced privileges and constrained filesystem access, limiting impact even if misuse occurs.
  • Apply least-privilege to the Flowise runtime account so that OS commands, if abused, have minimal system-level capabilities.

How teams detect issues like this

Detection typically involves both code-centric and operational approaches:

  • Use static analysis or security linters to flag dynamic command construction, shell invocations, and reliance on blocklists or regex filters around exec, spawn, or shell wrappers.
  • During code review, look for features that allow users to configure commands, scripts, or endpoints that eventually touch the OS, and verify they are strictly constrained to safe, predefined operations.
  • Establish security policies that prohibit passing raw, user-controlled strings directly to OS command execution APIs, and enforce these policies via CI checks or automated code scanners.
  • Monitor application logs and host telemetry for unusual command patterns initiated from Flowise processes, such as unexpected docker, package manager, or filesystem commands originating from MCP-related workflows.

Sources

SourceLink
github.comgithub.com/FlowiseAI/Flowise/security/advisories/GHSA-m99r-2hxc-cp3q
vulncheck.comvulncheck.com/advisories/flowise-remote-code-execution-via-mcp-security-bypass-in-validatecommandflags-and-validateargsforlocalfileaccess

Frequently asked

questions

Yes. Any attacker who can reach the Flowise web interface or API and has permissions to view or update chatflows can exploit the issue remotely by configuring a malicious MCP server.

The attacker only needs a Flowise account of any role, or API credentials with view/update permissions for chatflows. Direct shell access or administrative OS privileges are not required to trigger command execution.

The safest fix is to stop passing user-controlled command strings to the OS and instead enforce a strict allowlist of supported operations. Commands should be represented as structured parameters, validated against a schema, and executed with libraries that avoid shell interpretation.

Future features that invoke system commands should be designed around least-privilege execution, structured parameter validation, and hard allowlists of permitted actions. Incorporating secure design reviews, automated static analysis for command injection patterns, and strong separation between user input and OS-level operations helps prevent recurrence.

Find out what's already
exploitable in your codebase.