CVE-2025-68478 is a high-severity security vulnerability in langflow (pip), affecting versions < 1.7.1. It is fixed in 1.7.1.
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 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: 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)] 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.""" 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() 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-UEJOtSTaJq4eniMT9JKgZ7_q8PNkoxc" \ -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.
CVE-2025-68478 has a CVSS score of 7.1 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.
A fixed version is available (1.7.1). Upgrading removes the vulnerable code path.
pip
langflow (< 1.7.1)langflow → 1.7.1 (pip)Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.
Kodem's runtime-powered SCA identifies whether CVE-2025-68478 is reachable in your applications. Explore open-source security for your team.
See if CVE-2025-68478 is reachable in your applications. Get a demo
Upgrade langflow to 1.7.1 or later to resolve this vulnerability.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
CVE-2025-68478 is a high-severity security vulnerability in langflow (pip), affecting versions < 1.7.1. It is fixed in 1.7.1.
CVE-2025-68478 has a CVSS score of 7.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
langflow (pip) versions < 1.7.1 is affected.
Yes. CVE-2025-68478 is fixed in 1.7.1. Upgrade to this version or later.
Whether CVE-2025-68478 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
Upgrade langflow to 1.7.1 or later.