AAK-MCP-LANGFLOW-CVE-2026-12940-001: Langflow MCP stdio launcher env-var-injection RCE (from 1.0.0 below 1.13.0)
- Severity
- CRITICAL
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py- Auto-fixable
- No.
- SARIF name
LangflowMcpStdioEnvInjectionRce
What it detects
IBM Langflow OSS (langflow) from 1.0.0 through 1.10.1 is vulnerable to unauthenticated remote code execution through its MCP stdio launcher: the DANGEROUS_ENV_VARS blocklist in src/lfx/base/mcp/util.py omits SHELLOPTS, BASHOPTS, and PS4, so an unauthenticated attacker can inject those environment variables into a launched stdio MCP server process and achieve arbitrary code execution (CVE-2026-12940, CVSS 9.8). The same 1.11.0 floor also remediates five further Langflow OSS CVEs disclosed for 1.0.0–1.10.3: CVE-2026-17623 (command-field RCE in MCP server configurations), CVE-2026-17626 (host-file read/modify via unfiltered Docker volume-mount and device-mapping args), CVE-2026-8446 (MCP composer OAuth authentication bypass), CVE-2026-9077 (writing arbitrary MCP server configurations into host IDE config files), and CVE-2026-7646 (resources/read path traversal reading the JWT signing secret, the SQLite DB, and process env). A seventh, CVE-2026-9186, raised the floor past those: Langflow OSS 1.0.0–1.11.2 trusts a spoofed X-Forwarded-For: 127.0.0.1 header to satisfy its localhost-only guard on MCP-config installation, so a remote authenticated attacker writes arbitrary IDE configuration files (~/.cursor/mcp.json and siblings) — which 1.11.0, 1.11.1 and 1.11.2 are all exposed to. Three further IBM advisories then moved the floor again, all scoped 1.0.0 through 1.11.5: CVE-2026-85025 (CRITICAL 9.8) — unauthenticated arbitrary code execution and access to other users' chat sessions through publicly shared MCP project endpoints, because public-flow security restrictions and session isolation are both enforced improperly; CVE-2026-78575 (HIGH 8.8) — a remote authenticated attacker executes arbitrary commands through improperly validated command-line arguments in the MCP stdio server configuration; and CVE-2026-81941 (HIGH 8.8) — a non-administrative authenticated user runs OS commands at the application's privilege level by building a flow whose MCP Tools component uses a local stdio subprocess transport, bypassing both LANGFLOW_CUSTOM_COMPONENT_ADMIN_ONLY and LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS. Those are fixed in 1.11.6. CVE-2026-101861 (CVSS 4.1) then moved the floor to 1.12.0: from 1.0.16 through 1.11.6, an authenticated caller's Tool-Mode input options reach eval() in schema.py when a component is converted into a LangChain tool through ComponentToolkit.get_tools(), a custom-component save through the API included, so an option object with a crafted __repr__ runs code (GHSA-33p4-w7j3-33mw). Treat < 1.12.0 (and unpinned) as exposed; 1.11.6 is exposed to that one alone. Three more advisories sit under that floor: CVE-2026-105697 (CVSS 9.9) and CVE-2026-105740 (CVSS 9.9), the MCP stdio transport running a configured command through bash -c with no allowlist (fixed in 1.10.3 and 1.9.0), and CVE-2026-105741 (CVSS 7.1), a spoofed X-Forwarded-For on the MCP-config install endpoint from 1.5.0 (fixed in 1.10.3). So does CVE-2026-105699 (CVSS 4.0 7.1): from 1.6.8, a project-scoped MCP connection's resources/read returned another user's flow files without checking that the flow belonged to the caller (fixed in 1.9.1). IBM's records of 29 Oct 2026 then moved the langflow floor to 1.13.0: CVE-2026-110186 (CVSS 9.8, arbitrary code through improper control of code generation), CVE-2026-93680 (CVSS 9.8, a security-restriction bypass through improper authentication), CVE-2026-110193 (CVSS 8.8, a low-privileged user has the Agentic Assistant generate or submit component code that runs) and CVE-2026-110192 (CVSS 6.5, API credentials exposed to an authenticated user) affect 1.0.0 through 1.12.8 and are fixed in 1.13.0; CVE-2026-104339 (CVSS 9.8, OS command injection) affects 1.0.0 through 1.12.3, fixed in 1.12.4, and CVE-2026-107327 and CVE-2026-107329 (CVSS 9.9 each, code execution by an authenticated user) 1.0.0 through 1.12.4, fixed in 1.12.5. IBM's other Langflow OSS records, published from 7 Oct to 8 Nov 2026 with bulletins 7290694, 7293015 and 7293016, affect 1.0.0 through 1.12.2, 1.12.3 or 1.12.4 and are fixed in 1.12.3, 1.12.4 or 1.12.5, under that floor, so they are in the references and move nothing. Treat langflow < 1.13.0 (and unpinned) as exposed. The same code ships as langflow-base and lfx, which reached 1.12.0 in the same release as langflow, so both are read at that floor; no IBM bulletin or CNA record names either package for the October records, so their floors stay at 1.12.0. Pre-1.0.0 releases of langflow predate the MCP stdio launcher and are not in the affected range.
How to fix
Upgrade langflow to >= 1.13.0 (or langflow-base / lfx, where those are installed directly, to >= 1.12.0) and pin it. Do not pass an attacker-influenced environment through to a launched stdio MCP server; blocklist (or, better, allowlist) the process environment, including SHELLOPTS/BASHOPTS/PS4. Derive the client address from the socket, not from a caller-supplied X-Forwarded-For header, when gating localhost-only operations.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-MCP-LANGFLOW-CVE-2026-12940-001
Limitations
Reads langflow, langflow-base and lfx in requirements*.txt at any depth and, at the project root only, in pyproject.toml, Pipfile, .mcp.json, mcp.json, claude_desktop_config.json and the Pipfile.lock, poetry.lock and uv.lock lockfiles, reporting a range that admits an affected version and a reference that states no version. The dependency is not read when it is declared in a sub-directory manifest (services/api/pyproject.toml) or in a lockfile format the reader does not parse (pdm.lock). A compose file's langflowai/langflow image tag is not read. A file over 2 MB, or a lockfile over 32 MiB, is not read. A declaration nested more than 64 levels deep in package.json, a TOML manifest or an MCP config (an MCP server more than 62) is still judged, and reported without a line; a lockfile entry keeps its line at any depth.
References
- CVE: CVE-2026-12940, CVE-2026-17623, CVE-2026-17626, CVE-2026-8446, CVE-2026-9077, CVE-2026-7646, CVE-2026-9186, CVE-2026-85025, CVE-2026-78575, CVE-2026-81941, CVE-2026-101861, CVE-2026-105697, CVE-2026-105740, CVE-2026-105741, CVE-2026-105699, CVE-2026-110186, CVE-2026-93680, CVE-2026-110193, CVE-2026-110192, CVE-2026-104339, CVE-2026-107327, CVE-2026-107329, CVE-2026-104317, CVE-2026-18894, CVE-2026-101288, CVE-2026-88962, CVE-2026-93443, CVE-2026-93445, CVE-2026-93447, CVE-2026-93448, CVE-2026-93449, CVE-2026-93674, CVE-2026-93675, CVE-2026-93677, CVE-2026-93678, CVE-2026-93679, CVE-2026-97655, CVE-2026-97671, CVE-2026-97673, CVE-2026-97674, CVE-2026-97676, CVE-2026-97677, CVE-2026-97678, CVE-2026-97679, CVE-2026-97680, CVE-2026-101329, CVE-2026-101331, CVE-2026-103360, CVE-2026-104334, CVE-2026-104335, CVE-2026-77819, CVE-2026-102590, CVE-2026-103092, CVE-2026-104308, CVE-2026-104309, CVE-2026-104310, CVE-2026-104312, CVE-2026-104314, CVE-2026-104315, CVE-2026-104316, CVE-2026-104324, CVE-2026-104328, CVE-2026-104331, CVE-2026-77817, CVE-2026-90991, CVE-2026-107326, CVE-2026-107328, CVE-2026-107366, CVE-2026-110190, CVE-2026-110196, CVE-2026-110200, CVE-2026-110244, CVE-2026-110245, CVE-2026-110309
- OWASP MCP Top 10: MCP04:2025 (Software Supply Chain Attacks & Dependency Tampering), MCP05:2025 (Command Injection & Execution)
- OWASP Agentic Top 10: ASI04 (Agentic Supply Chain Vulnerabilities), ASI05 (Unexpected Code Execution (RCE))
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-AUTH-01 (Missing Authentication)
- CSA AI Controls Matrix (AICM): STA-08, AIS-07, IVS-04
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-LANGFLOW-CVE-2026-12940-001.md: the page then shows that text, with the registry reference appended under it.