GHSA-W727-595X-PC3R
Vulnerability from github – Published: 2026-05-14 20:17 – Updated: 2026-05-14 20:17
VLAI
Summary
pyLoad Has Incomplete Fix for CVE-2026-33509 -storage_folder Bypass via Session Directory in pyLoad
Details
Summary
The fix for CVE-2026-33509 prevents setting storage_folder inside PKGDIR or userdir, but does NOT protect the Flask session directory (/tmp/pyLoad/flask). An authenticated attacker can set storage_folder to the session directory and download session files of other users via /files/get/, leading to account takeover.
Details
The fix in src/pyload/core/api/__init__.py:
directories = [PKGDIR, userdir]
if any(directories[0].startswith(d) for d in directories[1:]):
return # blocked
But the Flask session directory is:
session_storage_path = os.path.join(api.get_cachedir(), "flask")
# = /tmp/pyLoad/flask ← NOT blocked by fix
Attack Chain
- Attacker (admin) sets
storage_folder = /tmp/pyLoad/flask - Fix does NOT block this —
/tmp/pyLoad/flasknot insidePKGDIRoruserdir - Attacker requests
GET /files/get/<victim_session_filename> send_from_directory('/tmp/pyLoad/flask', session_file)serves victim's session- Attacker uses stolen session → Account Takeover
PoC
import os
PKGDIR = "/usr/lib/python3/dist-packages/pyload"
userdir = os.path.expanduser("~/.pyload")
session_dir = "/tmp/pyLoad/flask"
correct_case = lambda x: x
directories = [
correct_case(os.path.join(os.path.realpath(d), ""))
for d in [session_dir, PKGDIR, userdir]
]
blocked = any(directories[0].startswith(d) for d in directories[1:])
print(f"Fix blocks session_dir: {blocked}")
# Output: Fix blocks session_dir: False ← BYPASS CONFIRMED
Impact
Authenticated admin can steal sessions of other users → Account Takeover.
Suggested Fix
blocked_dirs = [PKGDIR, userdir, api.get_cachedir()]
directories = [
os.path.join(os.path.realpath(d), "")
for d in [value] + blocked_dirs
]
if any(directories[0].startswith(d) for d in directories[1:]):
return
Severity
6.5 (Medium)
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "pyload-ng"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.5.0b3.dev99"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-45306"
],
"database_specific": {
"cwe_ids": [
"CWE-706"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-14T20:17:27Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\nThe fix for CVE-2026-33509 prevents setting `storage_folder` inside `PKGDIR` or `userdir`, but does NOT protect the Flask session directory (`/tmp/pyLoad/flask`). An authenticated attacker can set `storage_folder` to the session directory and download session files of other users via `/files/get/`, leading to account takeover.\n\n## Details\n\nThe fix in `src/pyload/core/api/__init__.py`:\n\n```python\ndirectories = [PKGDIR, userdir]\nif any(directories[0].startswith(d) for d in directories[1:]):\n return # blocked\n```\n\nBut the Flask session directory is:\n```python\nsession_storage_path = os.path.join(api.get_cachedir(), \"flask\")\n# = /tmp/pyLoad/flask \u2190 NOT blocked by fix\n```\n\n## Attack Chain\n\n1. Attacker (admin) sets `storage_folder = /tmp/pyLoad/flask`\n2. Fix does NOT block this \u2014 `/tmp/pyLoad/flask` not inside `PKGDIR` or `userdir`\n3. Attacker requests `GET /files/get/\u003cvictim_session_filename\u003e`\n4. `send_from_directory(\u0027/tmp/pyLoad/flask\u0027, session_file)` serves victim\u0027s session\n5. Attacker uses stolen session \u2192 **Account Takeover**\n\n## PoC\n\n\u003cimg width=\"592\" height=\"408\" alt=\"POC\" src=\"https://github.com/user-attachments/assets/936b9f56-325b-437d-9edd-e0d5bb995187\" /\u003e\n\n```python\nimport os\n\nPKGDIR = \"/usr/lib/python3/dist-packages/pyload\"\nuserdir = os.path.expanduser(\"~/.pyload\")\nsession_dir = \"/tmp/pyLoad/flask\"\n\ncorrect_case = lambda x: x\ndirectories = [\n correct_case(os.path.join(os.path.realpath(d), \"\"))\n for d in [session_dir, PKGDIR, userdir]\n]\nblocked = any(directories[0].startswith(d) for d in directories[1:])\n\nprint(f\"Fix blocks session_dir: {blocked}\")\n# Output: Fix blocks session_dir: False \u2190 BYPASS CONFIRMED\n```\n\n## Impact\nAuthenticated admin can steal sessions of other users \u2192 Account Takeover.\n\n## Suggested Fix\n```python\nblocked_dirs = [PKGDIR, userdir, api.get_cachedir()]\ndirectories = [\n os.path.join(os.path.realpath(d), \"\")\n for d in [value] + blocked_dirs\n]\nif any(directories[0].startswith(d) for d in directories[1:]):\n return\n```",
"id": "GHSA-w727-595x-pc3r",
"modified": "2026-05-14T20:17:28Z",
"published": "2026-05-14T20:17:27Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/pyload/pyload/security/advisories/GHSA-w727-595x-pc3r"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-r7mc-x6x7-cqxx"
},
{
"type": "PACKAGE",
"url": "https://github.com/pyload/pyload"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "pyLoad Has Incomplete Fix for CVE-2026-33509 -storage_folder Bypass via Session Directory in pyLoad"
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…