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

CVE-2024-42835: langflow has vulnerability in PythonCodeTool component

highCVSS 4.0 8.2 · 3.1 9.8GHSA-56m6-4mhw-h3g5

Langflow 1.0.12 and earlier lets anyone who can edit and run a flow execute arbitrary Python on the server through the PythonCodeTool component. Its build method passes the Tool Code field to exec() unchecked. No patched version exists, and a maintainer said the component is not worth changing for security.

Published Oct 31, 2024 · Updated Jun 6, 2026 · Analysis Nov 1, 2026

What an attacker can do

The PythonCodeTool component takes a block of Python in its Tool Code field. Its build method hands that text to exec() without validation. Whatever the code does runs on the Langflow server, as the user running Langflow.

The reporter's proof of concept sets the Tool Code to a function that calls os.popen('cat /etc/passwd').read(), then runs the flow in the Playground. The server returns the contents of /etc/passwd. The test flow also needed a valid OpenAI API key and base URL.

The attacker therefore needs the ability to create or change a flow and run it. On an instance with no login, that is anyone with network access. The CVSS 3.1 vector (9.8) assumes no privileges. The result is full code execution: the attacker can read model-provider keys and other secrets in the environment, reach internal services, and run commands.

The maintainers' position in the issue is that flows are application code. Nicoloboschi argued sandboxing cannot reliably stop malicious users and that access control belongs in backend authorization or a proxy. Treat flow editing as a privileged action.

Who is affected

langflow on pip, version 1.0.12 and earlier. The issue was reproduced on 1.0.12. Check what you run:

pip show langflow

The PythonCodeTool component must be available in the instance. Any user who can edit and run flows can use it.

langflow

Ecosystem
PyPI
Affected
<= 1.0.12
Fixed in
No patched version yet
Check
pip show langflow

How to fix it

The package data lists no patched version, and the issue thread names no fix release. A maintainer said no update to this component was worth it for security. So upgrading alone is not a documented cure. Follow the maintainers' guidance: treat flows as application code, limit who can edit them, and handle access control in backend authorization or a proxy. Carlosrcoelho suggested running Langflow in backend-only mode and restricting API access. Run Langflow as an unprivileged user with no production secrets in its environment.

How to tell if you were hit

Review saved flows for PythonCodeTool nodes and read the code in each Tool Code field. Look for imports of os or subprocess, and for network calls. On the host, watch for shells or other unexpected child processes spawned by the Langflow Python process. Check logs for flow runs from the Playground or API by unknown users. Where an AI agent edits or runs flows, Beam records agent shell commands and MCP tool calls.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

langflow v1.0.12 was discovered to contain a remote code execution (RCE) vulnerability via the PythonCodeTool component.

Questions

Is there a fix for CVE-2024-42835?

No patched version is listed. In the linked issue a maintainer said no update to the component was worth it for security, and advised treating flows as application code.

Does the attacker need to be logged in?

They must be able to edit and run a flow. If your instance has no access control, any network user can. The CVSS 3.1 vector lists no privileges required.

Which Langflow version was tested?

1.0.12. The package data marks 1.0.12 and earlier as vulnerable.

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