CVE-2026-12940: Langflow: unauth RCE via MCP env var injection
CRITICALLangflow's Model Context Protocol (MCP) stdio launcher fails to strip the SHELLOPTS, BASHOPTS, and PS4 environment variables from its DANGEROUS_ENV_VARS blocklist, letting an attacker who can reach the MCP tool-launch endpoint smuggle a classic bash trick (PS4 command substitution under xtrace) into a spawned subprocess and execute arbitrary OS commands with zero authentication and zero user interaction. This deserves immediate attention: CVSS 9.8 (AV:N/AC:L/PR:N/UI:N) means any internet-reachable Langflow instance is a one-shot RCE target, and Langflow sits in the same class of agent-framework tooling — alongside Flowise, Ollama, and BentoML — that attackers have already weaponized with public Metasploit modules once technical details surface. There is no EPSS score, CISA KEV listing, or Nuclei template yet and no public exploit has been observed, but the underlying flaw (a missing entry in an env-var blocklist) is trivial to turn into a PoC once IBM's advisory circulates. Patch to the fixed Langflow release above 1.10.1 immediately; until then, block public access to Langflow's MCP endpoints and watch for Langflow child processes spawned with SHELLOPTS, BASHOPTS, or PS4 set. Treat any internet-facing Langflow deployment as compromised-until-patched given the pre-auth network vector.
What is the risk?
Critical. The combination of no authentication, no user interaction, low attack complexity, and full confidentiality/integrity/availability impact (CVSS 9.8) makes this a textbook pre-auth RCE. The only current mitigating factors are the absence of a CISA KEV listing, EPSS score, Nuclei template, or known public exploit — but those are lagging indicators, not evidence of low risk, given how mechanically simple the exploitation path (bash env var injection) is once the DANGEROUS_ENV_VARS gap is known. Langflow's popularity as a low-code AI agent/pipeline builder means exposure is plausibly widespread even though dependent-count and OpenSSF Scorecard data are unavailable here.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Langflow | pip | — | No patch |
Do you use Langflow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step-
1) Upgrade Langflow past 1.10.1 to the version referenced in IBM's advisory as soon as it is available. 2) Until patched, do not expose Langflow's MCP endpoints to the public internet — restrict access to trusted internal/VPN networks only. 3) Detect exploitation attempts by monitoring for Langflow child processes spawned with SHELLOPTS, BASHOPTS, or PS4 environment variables set, or unexpected bash processes running with xtrace enabled. 4) Rotate any credentials (LLM API keys, vector DB creds, other service tokens) reachable from the Langflow host, since RCE could have exfiltrated them even without visible signs. 5) Audit any other internally built MCP-server launchers for the same class of env-var blocklist gap — this is a generalizable design flaw, not a Langflow-only bug.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-12940?
Langflow's Model Context Protocol (MCP) stdio launcher fails to strip the SHELLOPTS, BASHOPTS, and PS4 environment variables from its DANGEROUS_ENV_VARS blocklist, letting an attacker who can reach the MCP tool-launch endpoint smuggle a classic bash trick (PS4 command substitution under xtrace) into a spawned subprocess and execute arbitrary OS commands with zero authentication and zero user interaction. This deserves immediate attention: CVSS 9.8 (AV:N/AC:L/PR:N/UI:N) means any internet-reachable Langflow instance is a one-shot RCE target, and Langflow sits in the same class of agent-framework tooling — alongside Flowise, Ollama, and BentoML — that attackers have already weaponized with public Metasploit modules once technical details surface. There is no EPSS score, CISA KEV listing, or Nuclei template yet and no public exploit has been observed, but the underlying flaw (a missing entry in an env-var blocklist) is trivial to turn into a PoC once IBM's advisory circulates. Patch to the fixed Langflow release above 1.10.1 immediately; until then, block public access to Langflow's MCP endpoints and watch for Langflow child processes spawned with SHELLOPTS, BASHOPTS, or PS4 set. Treat any internet-facing Langflow deployment as compromised-until-patched given the pre-auth network vector.
Is CVE-2026-12940 actively exploited?
No confirmed active exploitation of CVE-2026-12940 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-12940?
1) Upgrade Langflow past 1.10.1 to the version referenced in IBM's advisory as soon as it is available. 2) Until patched, do not expose Langflow's MCP endpoints to the public internet — restrict access to trusted internal/VPN networks only. 3) Detect exploitation attempts by monitoring for Langflow child processes spawned with SHELLOPTS, BASHOPTS, or PS4 environment variables set, or unexpected bash processes running with xtrace enabled. 4) Rotate any credentials (LLM API keys, vector DB creds, other service tokens) reachable from the Langflow host, since RCE could have exfiltrated them even without visible signs. 5) Audit any other internally built MCP-server launchers for the same class of env-var blocklist gap — this is a generalizable design flaw, not a Langflow-only bug.
What systems are affected by CVE-2026-12940?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, AI pipeline orchestration, MCP tool integration, RAG pipelines.
What is the CVSS score for CVE-2026-12940?
CVE-2026-12940 has a CVSS v3.1 base score of 9.8 (CRITICAL).
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0049 Exploit Public-Facing Application AML.T0050 Command and Scripting Interpreter AML.T0072 Reverse Shell AML.T0112 Machine Compromise Compliance Controls Affected
What are the technical details?
Original Advisory
IBM Langflow OSS 1.0.0 through 1.10.1 are vulnerable to unauthenticated remote code execution via environment variable injection in the MCP (Model Context Protocol) stdio launcher. The vulnerability exists in src/lfx/src/lfx/base/mcp/util.py where the DANGEROUS_ENV_VARS blocklist fails to include SHELLOPTS , BASHOPTS , and PS4 environment variables.
Exploitation Scenario
An adversary scans for internet-facing Langflow instances and sends an unauthenticated request that triggers Langflow's MCP stdio launcher to spawn a subprocess, crafting the request so that SHELLOPTS, BASHOPTS, or PS4 are set in the resulting environment. Because Langflow's blocklist doesn't strip these variables, bash evaluates PS4 (normally used for xtrace prompts) as a command substitution, executing attacker-supplied shell commands with the privileges of the Langflow service account. From there the attacker reads local secrets such as LLM API keys and vector store credentials, pivots to other systems the Langflow pipeline orchestrates, or drops a reverse shell for persistence — all without ever authenticating to the application.
Weaknesses (CWE)
CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Primary
CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') CWE-78 — Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'): The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
- [Architecture and Design] If at all possible, use library calls rather than external processes to recreate the desired functionality.
- [Architecture and Design, Operation] Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2026-10561 10.0 Langflow: auth bypass + unauthenticated RCE (CVSS 10)
Same package: langflow CVE-2026-10134 10.0 Langflow: unauthenticated RCE via tool_code injection
Same package: langflow CVE-2026-33309 9.9 langflow: Path Traversal enables file access
Same package: langflow CVE-2026-55255 9.9 Langflow: IDOR allows cross-user flow execution
Same package: langflow CVE-2026-7873 9.9 Langflow: authenticated RCE enables credential theft
Same package: langflow