← All advisories
CVE-2026-51886highCode execution2026-10-01

CVE-2026-51886: any Langflow user can run code on the server through a decorator sent to /api/v1/validate/code (1.7.2 to 1.10.0, fixed 1.10.1)

Langflow's /api/v1/validate/code endpoint exec()'d each submitted function definition to check it. Python evaluates decorators (and default arguments) at definition time, so any authenticated user, or anyone when AUTO_LOGIN is on, could run arbitrary commands as the Langflow process by sending a function with a malicious decorator. Affected: 1.7.2 through 1.10.0 (earlier versions exposed the same sink without login). Fixed in 1.10.1, which only compiles the code.

01.

What it is

validate_code() in src/lfx/src/lfx/custom/validate.py parsed the code with ast and, for each FunctionDef, compiled and exec()'d it with normal builtins available.

A payload like @lambda x: (__import__('os').system('...'), x)[1] above def f(): pass runs during validation, giving code execution with the server's privileges and access to its environment variables (API keys, database credentials).

Before v1.7.2 the endpoint had no authentication at all; from 1.7.2 to 1.10.0 it needed a session or API key. The duplicate report GHSA-xjq8-cqrm-7m4x used default-argument evaluation for the same result.

Fixed in 1.10.1 by PR #13696 (tracked as GHSA-2wcq-pvw2-xh7v): FunctionDef nodes are only compiled, never executed. Credited to ESPanda666, l3tchupkt and andifilhohub.

02.

How to check

  1. Run pip show langflow (or check your image tag); versions below 1.10.1 are affected.
  2. Check whether AUTO_LOGIN is enabled and who has accounts or API keys on the instance.
03.

How to fix

  1. Upgrade Langflow to 1.10.1 or later (current releases include many later fixes too).
  2. Turn off AUTO_LOGIN on any reachable instance and rotate secrets in the Langflow environment if untrusted users had access.
pip show langflow | grep -i ^version
docker exec <langflow-container> printenv LANGFLOW_AUTO_LOGIN
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.