/

CVE-2026-48519

Severity:

CRITICAL RISK

(9.6)

Code Injection (CWE-94) in Langflow Public Flows

CVE-2026-48519

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.6)

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 Shareable Playground (Public Flows) feature contains a critical remote code execution vulnerability that allows unauthenticated users to inject and run arbitrary Python code via workflow nodes.

When a specially crafted public flow payload is sent to the build_public_tmp API route, attackers can execute arbitrary commands on the backend system wherever this feature is exposed.

Affected context

The vulnerability occurs in Langflow deployments that expose the "Shareable Playground" or "Public Flows" functionality and allow workflows to be executed through shared links.

In this context, the /api/v1/build_public_tmp endpoint will execute the supplied public flow definition, including node code embedded in the JSON payload, without sufficient validation or restriction.

The issue is present when arbitrary Python code can be provided via data.nodes[X].data.node.template.code.value and is treated as executable logic on the server side.

Exploit preconditions

  • Attack surface: HTTP API endpoint /api/v1/build_public_tmp used for executing public flows.
  • Required access: Ability to reach the Langflow instance over the network; no authentication needed if public flows are enabled and accessible.
  • Trigger point: Sending a crafted JSON payload for a public flow, with malicious code in data.nodes[X].data.node.template.code.value, which is then executed as part of the workflow.
  • Why exploitation is possible: The backend trusts and executes user-supplied Python code embedded in workflow nodes without enforcing strict sandboxing, validation, or code restrictions, allowing arbitrary code injection.

Why this happens

The underlying issue is that user-controlled input is directly interpreted as executable Python code on the server.

This matches CWE-94: Code Injection, where an application dynamically constructs or executes code from untrusted sources without adequate validation or confinement.

In Langflow's case, the workflow engine treats node template code values as trusted, executable logic, effectively exposing a remote programming interface to unauthenticated users through the public flow execution route.

Potential impact

  • Attackers may execute arbitrary Python code in the Langflow backend process.
  • Malicious users could read, modify, or delete data accessible to the Langflow server.
  • An attacker can potentially pivot to other internal services or resources reachable from the compromised host.
  • The system's integrity may be compromised, enabling backdoors, data exfiltration, or service disruption.
  • Hosted multi-tenant environments can be affected by cross-tenant data or resource abuse if isolation is weak.

General mitigation guidance

Effective mitigation centers around eliminating direct execution of user-supplied code and tightening the trust boundary around workflow definitions.

Common defensive patterns include:

  • Treating user-provided workflow configurations as data only, not as executable code, and disallowing arbitrary script fields.
  • Introducing strict allowlists for supported operations or components rather than interpreting free-form code snippets.
  • Applying robust sandboxing for any dynamic code evaluation, using isolation and resource limits to prevent escape into the host environment.
  • Ensuring public or unauthenticated features cannot invoke capabilities that execute server-side code without strong controls.
  • Designing workflow execution paths with least privilege, restricting filesystem, network, and sensitive resource access from the execution context.

How teams detect issues like this

Detection typically relies on identifying patterns where untrusted data flows into code execution mechanisms.

Useful approaches include:

  • Static analysis rules that flag dynamic execution constructs (e.g., eval, exec, dynamic import, template execution) when their inputs can originate from HTTP payloads or external JSON.
  • Code reviews focusing on workflow engines, plugin systems, and "script" fields, verifying that they do not execute user-controlled code without sandboxing.
  • Logging and monitoring of workflow execution endpoints, including auditing payloads and flagging unusual or complex code snippets being processed.
  • Security policies requiring architectural reviews for any feature that interprets configuration as code, supported by automated scanning tools to enforce these policies in CI/CD.

Sources

SourceLink
github.comgithub.com/langflow-ai/langflow/security/advisories/GHSA-v5ff-9q35-q26f

Frequently asked

questions

Yes, if the Langflow instance is exposed over the internet or reachable from untrusted networks and the Shareable Playground / Public Flows feature is enabled, an attacker can exploit it remotely by sending crafted requests to the public flow execution endpoint.

Only network access to the vulnerable Langflow API route is required. No prior authentication or valid user account is necessary when public flows are accessible to unauthenticated users.

The safest pattern is to disallow direct execution of user-supplied code in workflow definitions. Instead, restrict workflows to predefined, vetted components and operations, or execute any necessary custom logic inside a tightly controlled sandbox that cannot impact the host or broader environment.

Avoid exposing dynamic code execution in user-facing features, treat all external input as untrusted, and enforce strict validation and capability constraints on workflow engines. Incorporate secure design reviews, targeted static analysis, and strong runtime sandboxing for any feature that needs to interpret or run code derived from user-controlled data.

Find out what's already
exploitable in your codebase.