CVE-2026-101861: Langflow Component Input Schema Unsafe eval() Remote Code Execution
HERMES THREAT SCORE & AGENTIC AI EXECUTION SURFACE
Target:Langflow Visual Agent Builder - schema.py / ComponentToolkit Standard CVSS v3.1 rates this vulnerability at 9.8 (Critical, CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H). The Hermes Threat Score assigns an operational score of 92 (CRITICAL), while the Agentic Security Score (HASS) elevates it to 94 (CRITICAL). In modern generative AI stacks, Langflow functions as the core orchestrator and execution plane for multi-agent workflows, autonomous coding loops, and RAG pipelines. When an untrusted component schema is saved via the API or shared across team workspaces, the unsafe eval() sink executes inside the host container process with unconstrained access to LLM API keys (OpenAI, Anthropic), vector embeddings, database connection strings, and connected agent tools.
CVE-2026-101861: Langflow Component Input Schema Unsafe eval() Remote Code ExecutionVULNERABILITY
Visual framework and multi-agent development environment for building, evaluating, and deploying conversational AI pipelines.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in Langflow Visual AI Builder documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
Attacker registers rogue MCP tools or skills with weaponized docstrings and deceptive metadata that trick the model into routing sensitive user tasks to attacker-controlled functions.
๐ Why is this related? (Evidence & Provenance)
“CVE-2026-101861 weaponizes the agentic attack pattern formalized under AAP-004.”
- [technical_analysis]Pillar Security demonstrated that executing export BASH_ENV in Auto-Run causes bash to source hostile payloads upon subsequent commands. — Source: Pillar Security Research: Bypassing Cursor Auto-Run: When Shell Built-ins Lead to Host RCE (Reliability: HIGH)
Adversarial subversion of structured tool execution arguments (SQL, Shell, Filepath) passed from an LLM agent to host OS tools or MCP endpoints.
๐ Why is this related? (Evidence & Provenance)
“CVE-2026-101861 weaponizes the agentic attack pattern formalized under AAP-003.”
- [technical_analysis]Pillar Security demonstrated that executing export BASH_ENV in Auto-Run causes bash to source hostile payloads upon subsequent commands. — Source: Pillar Security Research: Bypassing Cursor Auto-Run: When Shell Built-ins Lead to Host RCE (Reliability: HIGH)
1. Technical Context & Affected Software Matrix
Section titled โ1. Technical Context & Affected Software MatrixโLangflow is an open-source visual framework for developing multi-agent AI systems, LangChain architectures, and Model Context Protocol (MCP) integrations.
| Parameter | Technical Specification | Operational Impact |
|---|---|---|
| CVE Identifier | CVE-2026-101861 | Global vulnerability tracking reference |
| Advisory Source | VulnCheck Exploit Intelligence / NVD | Weaponized exploit research |
| Vulnerability Class | Improper Neutralization of Directives in Dynamically Evaluated Code (CWE-95) | Arbitrary Python code execution |
| Vulnerable File | src/backend/base/langflow/schema.py | Component schema & LangChain tool generator |
| Vulnerable Function | ComponentToolkit.get_tools() / schema generator | Dynamic typing evaluation via eval() |
| Affected Releases | 1.0.16 <= v < 1.12.0, 0.0.94 <= v < 1.0.0 | Containerized & pip-installed Langflow instances |
| Fixed Release | 1.12.0 | Safe Literal parsing without eval() |
| Agentic Severity (HASS) | 94 / 100 (CRITICAL) | Direct compromise of agent toolchains & API secrets |
2. In-Depth Technical Decomposition
Section titled โ2. In-Depth Technical DecompositionโComponent Transformation in Langflow
Section titled โComponent Transformation in LangflowโIn Langflow, visual nodes represent LLMs, prompts, tools, and custom Python components. To expose custom components to LangChain agents, Langflow generates dynamic Pydantic models where component input options are validated against a generated typing constraint:
USER / API CLIENT (POST /api/v1/custom_component) โ โ Component Schema with Custom 'options' โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ FastAPI Endpoint (Custom Component)โ โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ โ Raw JSON Input Schema โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ ComponentToolkit.get_tools() โ โ in langflow/schema.py โ โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ โ Interpolation: f"Literal[{options}]" โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Unsafe eval() Execution Sink โ <--- [CVE-2026-101861 Vulnerability] โ eval(literal_str) โ Arbitrary Python code executed โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ โ Host Process Shellcode โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Host Operating System Takeover โ โ Steal API Keys, Pivot via Agent โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโRoot Cause Analysis: Unsanitized eval() Sink
Section titled โRoot Cause Analysis: Unsanitized eval() SinkโThe vulnerability stems from the implementation of Literal type generation for dropdown inputs in langflow/schema.py. The function attempts to dynamically construct a typing Literal containing all allowed choices:
# Vulnerable code pattern in langflow/schema.py (versions < 1.12.0)def build_field_type(field_name, field_config): options = field_config.get("options", []) if options: # VULNERABILITY: Formats options representations directly into an eval() string # If options contains objects whose __repr__() yields arbitrary code, # or if options string contains injected python syntax, eval() executes it. options_repr = ", ".join(repr(opt) for opt in options) literal_type_str = f"Literal[{options_repr}]"
# SINK: Direct evaluation without an AST whitelist or restricted globals return eval(literal_type_str, {"Literal": Literal})
return strWhen an attacker crafts a component definition containing a serialized option payload such as:
__import__('os').system('id > /tmp/pwned')or injects an object where repr(opt) returns an expression containing __class__.__base__.__subclasses__(), the call to eval() evaluates the string in the context of the running Python process. Because the globals dictionary only specifies {"Literal": Literal}, Pythonโs built-in name resolution resolves standard builtins (__builtins__), granting immediate execution access to __import__, eval, exec, and standard library modules.
3. Attack Vectors & Real-World Exploitation Chain
Section titled โ3. Attack Vectors & Real-World Exploitation ChainโsequenceDiagram autonumber participant Attacker as Authenticated Actor / Malicious Contributor participant API as Langflow API (/api/v1/custom_component) participant Engine as Langflow Schema Compiler (schema.py) participant Host as Python Runtime Host
Attacker->>API: Authenticate with low-privilege user token Attacker->>API: POST /api/v1/custom_component with weaponized options array API->>Engine: Invoke ComponentToolkit.get_tools() to validate schema Engine->>Engine: Interpolate options into f"Literal[{options}]" Engine->>Host: Execute eval(literal_type_str) Host->>Host: Run __import__('subprocess').Popen(...) Host-->>Attacker: Open reverse TCP connection / exfiltrate .env secrets- Workspace Access: The adversary acquires valid access to a shared Langflow project or registers an account on an open/multi-tenant instance.
- Component Submission: The attacker submits a new custom component definition via
POST /api/v1/custom_componentor imports a poisoned workflow JSON template. - Triggering the Sink: Langflow processes the component to register its input fields as LangChain tools, passing the field options into
build_field_typeinschema.py. - Arbitrary Code Execution: The
eval()statement executes the injected expression, spawning a background process that exfiltrates environment variables (OPENAI_API_KEY,ANTHROPIC_API_KEY,DATABASE_URL) to an external command-and-control server.
4. Forensic Triage & Detection Engineering
Section titled โ4. Forensic Triage & Detection Engineeringโtitle: Langflow Suspicious Child Process Spawn via Python evalid: d4b1a820-912f-4c55-b789-101861000001status: experimentaldescription: Detects unusual child shell processes or command interpreters spawned by the Langflow backend process.references: - https://vulncheck.com/advisories/langflow-code-execution-via-eval-in-component-input-schema - https://github.com/langflow-ai/langflowauthor: Hermes Codex Cyber Intelligencedate: 2026-09-29logsource: product: linux category: process_creationdetection: selection_parent: ParentCommandLine|contains: - "langflow" - "uvicorn langflow" selection_children: Image|endswith: - "/bin/sh" - "/bin/bash" - "/usr/bin/curl" - "/usr/bin/wget" - "/bin/nc" condition: selection_parent and selection_childrenfalsepositives: - Legitimate custom Python components intentionally invoking command-line utilities in sandboxed dev setupslevel: criticaltags: - attack.execution - attack.t1059.006 - attack.defense_evasion// Azure Sentinel / Defender for Endpoint// Detect abnormal network connections or child process executions from Langflow containersDeviceProcessEvents| where InitiatingProcessCommandLine has "langflow" or InitiatingProcessCommandLine has "uvicorn"| where FileName in~ ("sh", "bash", "curl", "wget", "nc", "python", "python3")| where ProcessCommandLine !has "langflow"| project TimeGenerated, DeviceName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, AccountName| sort by TimeGenerated desc#!/usr/bin/env python3"""Langflow Database & Flow Audit ScriptScans stored flow JSON files and database records for weaponized options schemas."""import jsonimport reimport sys
SUSPICIOUS_PATTERNS = [ re.compile(r"__import__", re.IGNORECASE), re.compile(r"subprocess", re.IGNORECASE), re.compile(r"__subclasses__", re.IGNORECASE), re.compile(r"__class__", re.IGNORECASE), re.compile(r"system\(", re.IGNORECASE), re.compile(r"exec\(", re.IGNORECASE), re.compile(r"eval\(", re.IGNORECASE),]
def scan_flow_data(flow_file_path): with open(flow_file_path, "r", encoding="utf-8") as f: data = json.load(f)
findings = [] flow_str = json.dumps(data) for pattern in SUSPICIOUS_PATTERNS: matches = pattern.findall(flow_str) if matches: findings.append(f"Detected suspicious pattern: {matches[0]}")
return findings
if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: python audit_langflow.py <path_to_flow.json>") sys.exit(1) results = scan_flow_data(sys.argv[1]) if results: print(f"[!] ALERT: Potential CVE-2026-101861 exploit patterns found:") for r in results: print(f" - {r}") else: print("[+] Clean: No suspicious eval injection patterns detected.")rule Langflow_CVE_2026_101861_Exploit_Pattern { meta: description = "Detects Langflow custom component export payloads containing Python eval injection tokens" author = "Hermes Codex Cyber Intelligence" date = "2026-09-29" cve = "CVE-2026-101861" strings: $field_options = "\"options\":" ascii $lit_inject1 = "__import__(" ascii $lit_inject2 = "__subclasses__()" ascii $lit_inject3 = "os.system" ascii $lit_inject4 = "subprocess.Popen" ascii condition: $field_options and (1 of ($lit_inject*))}5. Remediation Strategy & Mitigation Controls
Section titled โ5. Remediation Strategy & Mitigation Controlsโ-
Upgrade Langflow to Version 1.12.0 or Later:
Update the deployment container image or pip package immediately:Terminal window pip install --upgrade "langflow>=1.12.0"Langflow 1.12.0 replaces dynamic string evaluation with safe AST inspection and static typing validation.
-
Restrict Custom Component Creation:
Disable untrusted custom component creation in production multi-user environments by configuring environment variables inlangflow.env:Terminal window LANGFLOW_AUTO_SAVING=falseLANGFLOW_STORE=false -
Rotate Compromised API Secrets:
If inspection reveals unauthorized process spawns or unexpected flow definitions:- Immediately rotate all LLM API tokens (OpenAI, Anthropic, Cohere, HuggingFace).
- Revoke and regenerate database credentials and vector store API keys (Pinecone, Qdrant, Chroma).
- Re-deploy the Langflow container with isolated network policies preventing egress to non-essential IP ranges.