CVE-2026-33497: langflow /profile_pictures/{folder_name}/{file_name} Endpoint File Reading Vulnerability

HIGH
Advisory Identifier: GHSA-ph9w-r52h-28p7
CWE-22
Published
Advisory Summary

CVE-2026-33497 is a HIGH /profile_pictures/{folder_name}/{file_name} endpoint file reading vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting langflow libraries in the PyPI ecosystem. The issue involves /profile_pictures/{folder_name}/{file_name} endpoint file reading. Remediation is available by upgrading affected packages to version 1.7.1.

CVE-2026-33497 at a Glance

CVE Identifier CVE-2026-33497
GHSA Identifier GHSA-ph9w-r52h-28p7
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product langflow
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-33497

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.7.1
pip install langflow>=1.7.1
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-33497, 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.7.1), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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

## Vulnerability ### Path Traversal in `GET /api/v1/files/profile_pictures/{folder_name}/{file_name}` The `download_profile_picture` function in `src/backend/base/langflow/api/v1/files.py` constructed file paths by directly concatenating the user-supplied `folder_name` and `file_name` path parameters without sanitization or boundary validation. The resulting path was passed to the filesystem without verifying it remained within the intended directory. An unauthenticated attacker could supply traversal sequences (e.g. `../secret_key`) to navigate outside the profile pictures directory and read arbitrary files on the server filesystem. This exposed the server to: - **Sensitive file disclosure** — any file readable by the application process could be retrieved - **Secret key exfiltration** — the application's `secret_key` file, used as JWT signing material, could be read directly via `../secret_key` - **Authentication bypass** — with the `secret_key` in hand, an attacker can forge valid JWT tokens and authenticate as any user, including administrators --- ## Proof of Concept ```bash curl --path-as-is 'http://<host>:7860/api/v1/files/profile_pictures/../secret_key' ``` A successful response returns the raw secret key value used to sign all JWT authentication tokens in the instance. --- ## Fix The fix was applied in `src/backend/base/langflow/api/v1/files.py` (PR #12263). Two layers of defense were introduced: **1. Typed path validation** — the `folder_name` and `file_name` parameters were changed from plain `str` to `ValidatedFolderName` and `ValidatedFileName` annotated types that reject traversal characters at the FastAPI input layer. **2. Path containment check** — `Path.name` is used to strip any directory component from the inputs before path construction, and `Path.is_relative_to()` verifies the resolved path remains within the allowed base directory. This replaces the previous `startswith()` check, which was susceptible to prefix-ambiguity bugs. ```diff @router.get("/profile_pictures/{folder_name}/{file_name}") async def download_profile_picture( - folder_name: str, - file_name: str, + folder_name: ValidatedFolderName, + file_name: ValidatedFileName, settings_service: Annotated[SettingsService, Depends(get_settings_service)], ): ``` ```diff - file_path = (config_path / "profile_pictures" / folder_name / file_name).resolve() + safe_folder = Path(folder_name).name + safe_file = Path(file_name).name + file_path = (config_path / "profile_pictures" / safe_folder / safe_file).resolve() allowed_base = (config_path / "profile_pictures").resolve() - if not str(file_path).startswith(str(allowed_base)): - raise HTTPException(status_code=404, detail="Profile picture not found") + if not file_path.is_relative_to(allowed_base): + raise HTTPException(status_code=404, detail="Profile picture not found") ``` --- ## Workarounds If you cannot upgrade immediately, restrict network access to the `/api/v1/files/profile_pictures/` endpoint at the reverse-proxy or firewall level. Rotating the `secret_key` is strongly recommended if exposure cannot be ruled out. --- ## Acknowledgements We thank the security researcher who responsibly disclosed this vulnerability. - [r00tuser111](https://github.com/r00tuser111)

CVE-2026-33497 Affected langflow Versions

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

References

Frequently Asked Questions

What is CVE-2026-33497?
CVE-2026-33497 is a security vulnerability in langflow involving /profile_pictures/{folder_name}/{file_name} endpoint file reading under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which langflow versions are affected?
Affected versions include releases prior to 1.7.1 across affected packages: langflow.
What version fixes CVE-2026-33497?
Upgrading to 1.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is langflow affected?
Yes, langflow is affected in releases prior to 1.7.1. Upgrade your dependency to 1.7.1 or later.
What CWE is associated with CVE-2026-33497?
CVE-2026-33497 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2026-33497?
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-ph9w-r52h-28p7",
  "modified" : "2026-06-06T00:56:31Z",
  "published" : "2026-03-20T20:56:14Z",
  "aliases" : [ "CVE-2026-33497" ],
  "summary" : "langflow: /profile_pictures/{folder_name}/{file_name} endpoint file reading",
  "details" : "## Vulnerability\n\n### Path Traversal in `GET /api/v1/files/profile_pictures/{folder_name}/{file_name}`\n\nThe `download_profile_picture` function in `src/backend/base/langflow/api/v1/files.py` constructed file paths by directly concatenating the user-supplied `folder_name` and `file_name` path parameters without sanitization or boundary validation. The resulting path was passed to the filesystem without verifying it remained within the intended directory.\n\nAn unauthenticated attacker could supply traversal sequences (e.g. `../secret_key`) to navigate outside the profile pictures directory and read arbitrary files on the server filesystem.\n\nThis exposed the server to:\n\n- **Sensitive file disclosure** — any file readable by the application process could be retrieved\n- **Secret key exfiltration** — the application's `secret_key` file, used as JWT signing material, could be read directly via `../secret_key`\n- **Authentication bypass** — with the `secret_key` in hand, an attacker can forge valid JWT tokens and authenticate as any user, including administrators\n\n---\n\n## Proof of Concept\n\n```bash\ncurl --path-as-is 'http://<host>:7860/api/v1/files/profile_pictures/../secret_key'\n```\n\nA successful response returns the raw secret key value used to sign all JWT authentication tokens in the instance.\n\n---\n\n## Fix\n\nThe fix was applied in `src/backend/base/langflow/api/v1/files.py` (PR #12263).\n\nTwo layers of defense were introduced:\n\n**1. Typed path validation** — the `folder_name` and `file_name` parameters were changed from plain `str` to `ValidatedFolderName` and `ValidatedFileName` annotated types that reject traversal characters at the FastAPI input layer.\n\n**2. Path containment check** — `Path.name` is used to strip any directory component from the inputs before path construction, and `Path.is_relative_to()` verifies the resolved path remains within the allowed base directory. This replaces the previous `startswith()` check, which was susceptible to prefix-ambiguity bugs.\n\n```diff\n @router.get(\"/profile_pictures/{folder_name}/{file_name}\")\n async def download_profile_picture(\n-    folder_name: str,\n-    file_name: str,\n+    folder_name: ValidatedFolderName,\n+    file_name: ValidatedFileName,\n     settings_service: Annotated[SettingsService, Depends(get_settings_service)],\n ):\n```\n\n```diff\n-        file_path = (config_path / \"profile_pictures\" / folder_name / file_name).resolve()\n+        safe_folder = Path(folder_name).name\n+        safe_file = Path(file_name).name\n+        file_path = (config_path / \"profile_pictures\" / safe_folder / safe_file).resolve()\n\n         allowed_base = (config_path / \"profile_pictures\").resolve()\n-        if not str(file_path).startswith(str(allowed_base)):\n-            raise HTTPException(status_code=404, detail=\"Profile picture not found\")\n+        if not file_path.is_relative_to(allowed_base):\n+            raise HTTPException(status_code=404, detail=\"Profile picture not found\")\n```\n\n---\n\n## Workarounds\n\nIf you cannot upgrade immediately, restrict network access to the `/api/v1/files/profile_pictures/` endpoint at the reverse-proxy or firewall level. Rotating the `secret_key` is strongly recommended if exposure cannot be ruled out.\n\n---\n\n## Acknowledgements\n\nWe thank the security researcher who responsibly disclosed this vulnerability.\n\n- [r00tuser111](https://github.com/r00tuser111)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "langflow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.7.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/langflow-ai/langflow/security/advisories/GHSA-ph9w-r52h-28p7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33497"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/langflow-ai/langflow"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/langflow/PYSEC-2026-81.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-20T20:56:14Z",
    "nvd_published_at" : "2026-03-24T14:16:30Z"
  }
}