CVE-2026-33497: langflow /profile_pictures/{folder_name}/{file_name} Endpoint File Reading Vulnerability
HIGHCVE-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
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.
pip install langflow>=1.7.1
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
CVE-2026-33497 Affected langflow Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
langflow
|
PyPI |
< 1.7.1
|
1.7.1
|
References
Frequently Asked Questions
What is CVE-2026-33497?
Which langflow versions are affected?
What version fixes CVE-2026-33497?
Is langflow affected?
What CWE is associated with CVE-2026-33497?
How can I check PyPI dependencies for CVE-2026-33497?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}