/

CVE-2026-33017

Severity:

CRITICAL RISK

(9.8)

Dynamic Code Execution in Langflow Public Flow Builder API

CVE-2026-33017

Modified

Vulnerability type

Category:

Dynamic Code Execution

CWE:

CWE-94, CWE-95, CWE-306

Impact:

Unauthenticated Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Langflow's public flow builder API endpoint /api/v1/build_public_tmp/{flow_id}/flow can accept attacker-supplied flow data that contains arbitrary Python code, which is executed via exec() with no sandboxing.

Because this endpoint is intentionally exposed without authentication for public flows, an attacker can remotely trigger code execution on the Langflow server without any valid credentials.

Affected context

This vulnerability affects Langflow deployments that expose the /api/v1/build_public_tmp/{flow_id}/flow endpoint for building public flows.

The issue is present when:

  • The endpoint is accessible over a network (e.g., internet-exposed or reachable within an internal network), and
  • The server accepts the optional data parameter in POST requests and treats it as flow definition input, and
  • Flow node definitions can embed Python code that is passed directly to a Python exec() call.

In such configurations, the API does not require authentication and does not restrict or sandbox the executable code extracted from the supplied flow data.

Exploit preconditions

  • Attack surface: HTTP POST requests to /api/v1/build_public_tmp/{flow_id}/flow.
  • Required access: Network access to the Langflow instance; no authentication or valid user account is required.
  • Input control: Ability to send a crafted data parameter whose contents define nodes containing arbitrary Python code.
  • Trigger point: The server processes the incoming flow data and passes the embedded Python code directly to exec() during flow build for the given flow_id.
  • Why exploitation is possible: The endpoint:
  • Is intentionally unauthenticated for public flows (CWE-306: Missing Authentication for Critical Function),
  • Trusts attacker-supplied data over stored, validated flow definitions,
  • Passes node-defined code directly into exec() without sandboxing or validation (CWE-94/CWE-95),
  • Executes this logic in the server environment, inheriting its privileges.

Why this happens

The root cause is the combination of missing authentication on a security-sensitive API and unsafe dynamic code execution.

The /api/v1/build_public_tmp/{flow_id}/flow endpoint is designed to allow building "public" flows, so it omits authentication checks (CWE-306).

However, it also accepts an optional data parameter that can replace the stored flow data with attacker-controlled content.

Flow node definitions within this data can include Python code that is passed directly into exec() without sandboxing, validation, or restriction.

This pattern maps to CWE-94: Improper Control of Generation of Code and CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code, where user input directly influences executable code.

Because the code runs with the server's Python interpreter, an attacker can execute arbitrary commands in the context of the Langflow process.

Potential impact

  • Unauthenticated execution of arbitrary Python code on the Langflow server.
  • Reading, modifying, or deleting application data accessible to the Langflow process.
  • Pivoting into the underlying host or container environment, including executing OS-level commands via Python libraries.
  • Exfiltration of sensitive configuration, environment variables, or credentials used by Langflow.
  • Disruption of AI workflows, manipulation of flows, or deployment of backdoored agents and components.
  • Use of the compromised Langflow instance as a foothold for lateral movement within the hosting infrastructure.

General mitigation guidance

Mitigation strategies focus on removing direct code execution from untrusted inputs and enforcing appropriate access control around flow-building operations:

  • Avoid passing any user-controllable data directly into exec(), eval(), or equivalent dynamic evaluation mechanisms; use explicit, declarative configuration formats instead of executable code in flow definitions.
  • Introduce strict authentication and authorization requirements for endpoints that can trigger code execution or flow building, even for "public" resources, or separate read-only public endpoints from code-executing ones.
  • If dynamic code is unavoidable, implement strong sandboxing and isolation for code execution:
  • Run untrusted code in constrained, separate processes or containers with minimal privileges and limited filesystem/network access.
  • Validate and normalize flow definitions before processing:
  • Reject nodes or fields that contain raw code where only configuration should be present.
  • Enforce schema-based validation and maintain a clear separation between data and executable logic.
  • Apply least-privilege principles for the Langflow runtime:
  • Limit filesystem, network, and credential access available to the process executing flows, so that any compromise has reduced blast radius.

How teams detect issues like this

Detection can leverage both code-level analysis and operational monitoring:

  • Static analysis and code review:
  • Search for uses of exec(), eval(), or dynamic import mechanisms that are reachable from HTTP handlers or other untrusted input sources.
  • Flag code paths where request parameters (such as data) are used to construct or influence executable Python code.
  • Review unauthenticated or "public" endpoints that trigger build, deploy, or validation actions for potential privilege mismatches.
  • Security testing and fuzzing:
  • Perform API-focused security tests that send crafted flow definitions with embedded code to endpoints that build or validate flows.
  • Verify that public endpoints cannot alter runtime behavior through arbitrary code.
  • Runtime and log monitoring:
  • Monitor process behavior for unexpected command execution, new subprocess creation, or abnormal file/network access initiated from flow builds.
  • Enable detailed logging for build-related endpoints to detect suspicious data payloads or anomalous flows being built.
  • Automated pipeline checks:
  • Integrate SAST/IAST tools into CI to detect dynamic code execution patterns tied to web or API inputs.
  • Enforce policy checks that forbid merging changes introducing unauthenticated code-execution paths.

Sources

SourceLink
github.comgithub.com/advisories/GHSA-rvqx-wpfh-mfx7
github.comgithub.com/langflow-ai/langflow/commit/73b6612e3ef25fdae0a752d75b0fabd47328d4f0
github.comgithub.com/langflow-ai/langflow/security/advisories/GHSA-vwmf-pq79-vjvx
github.comgithub.com/langflow-ai/langflow/releases/tag/1.8.2
medium.commedium.com/@aviral23/cve-2026-33017-how-i-found-an-unauthenticated-rce-in-langflow-by-reading-the-code-they-already-dc96cdce5896
cisa.govcisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-33017
sysdig.comsysdig.com/blog/cve-2026-33017-how-attackers-compromised-langflow-ai-pipelines-in-20-hours

Frequently asked

questions

The vulnerability is exploitable by any party that can send HTTP requests to the affected /api/v1/build_public_tmp/{flow_id}/flow endpoint, because it does not require authentication and directly executes attacker-supplied code. If the instance is internet-exposed, the exposure is effectively global.

No valid account is required, but the attacker needs a reachable Langflow instance and a target flow_id. In scenarios where flow_id values are predictable or discoverable, unauthenticated remote attackers can exploit the issue without any prior access.

The most robust fix pattern is to remove direct dynamic code execution from user-controllable inputs, apply authentication and authorization to any endpoint that can influence executable behavior or building of flows, and treat flow definitions as data rather than executable code. If code execution is a feature, it should be tightly scoped and isolated to sandboxed environments.

Future designs should:

  • Avoid exec()/eval() entirely for processing client-supplied data.
  • Enforce authentication on critical operations, even for "public" resources, or ensure public endpoints are strictly read-only.
  • Use schema-based validation and clear separation of configuration vs. code.
  • Perform security reviews of new endpoints to identify any path from user input to executable logic and ensure such paths are guarded or eliminated.
Find out what's already
exploitable in your codebase.