PYSEC-2026-4237: Langflow: OS command injection (RCE) via arbitrary command in MCP stdio server configuration
Langflow is a tool for building and deploying AI-powered agents and workflows. Before Langflow 1.10.3, the MCP stdio transport launched whatever command / args a user put in an MCP server configuration, with no allowlist and (before 1.10.3) wrapped in bash -c "exec {command} ...". Any user able to reach the MCP server settings ("Settings → MCP Servers → Add MCP Server", POST/PATCH /api/v2/mcp/servers/{servername}) or to build a flow with the MCP Tools component could add a "server" whose command is an arbitrary OS command (touch, rm -rf, a reverse shell, ...). The command runs on the Langflow host as the Langflow process user as soon as Langflow tries to connect to the server (listing servers, loading tools, running the flow) — even when the UI then reports that the stdio server failed to start. With the default LANGFLOWAUTOLOGIN=true, GET /api/v1/autologin hands out a token without credentials, so on an exposed instance running the default configuration this is reachable without an account. AUTOLOGIN is documented as a development-only setting; with it disabled, any authenticated (non-admin) user can exploit it. This issue is fixed in Langflow 1.10.3, langflow-base 0.10.3, and lfx 1.10.3.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Langflowto a version that resolves this vulnerability.Fixed in 1.10.3 - Upgrade
Upgrade
langflow-baseto a version that resolves this vulnerability.Fixed in 0.10.3 - Upgrade
Upgrade
lfxto a version that resolves this vulnerability.Fixed in 1.10.3
Event History
Frequently Asked Questions
Who can exploit this issue on an exposed Langflow instance?
If LANGFLOW_AUTO_LOGIN=true, the default setting described here, an unauthenticated user can obtain a token from /api/v1/auto_login and reach the affected functionality. If auto-login is disabled, any authenticated user, including a non-admin user, can exploit it.
What attacker action causes the command to run?
An attacker can create or modify an MCP server configuration through the MCP server settings or POST/PATCH /api/v2/mcp/servers/{server_name}, or build a flow using the MCP Tools component. The configured command executes as the Langflow process user when Langflow connects to the server, such as while listing servers, loading tools, or running the flow.
Does a reported MCP stdio server startup failure prevent exploitation?
No. The command can execute when Langflow attempts to connect even if the UI subsequently reports that the stdio server failed to start.
What should be done if upgrading cannot happen immediately?
Disable LANGFLOW_AUTO_LOGIN to prevent unauthenticated token issuance, and restrict access to authenticated users who are trusted not to create or modify MCP server configurations or flows containing MCP Tools components. This does not remove the risk from authenticated non-admin users.
Which versions contain the fix?
The issue is fixed in Langflow 1.10.3 and langflow-base 0.10.3. The provided data does not include the complete fixed-version information for all affected packages.