{"id":"CVE-2026-45306","aliases":["GHSA-w727-595x-pc3r","PYSEC-2026-2998"],"title":"pyLoad Has Incomplete Fix for CVE-2026-33509 -storage_folder Bypass via Session Directory in pyLoad","summary":"pyLoad Has Incomplete Fix for CVE-2026-33509 -storage_folder Bypass via Session Directory in pyLoad","severity":"medium","cvss":6.5,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N","vendor":"pyload-ng","product":"pyload-ng","ecosystem":"pip","affected":["pyload-ng <= 0.5.0b3.dev99"],"published":"2026-05-14","updated":"2026-07-13","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-w727-595x-pc3r","references":[{"url":"https://github.com/pyload/pyload/security/advisories/GHSA-w727-595x-pc3r"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45306"},{"url":"https://github.com/advisories/GHSA-r7mc-x6x7-cqxx"},{"url":"https://github.com/pyload/pyload"}],"tags":["osv","pip"],"epss":0.00234,"epssPercentile":0.14621,"ingestedAt":"2026-07-13T18:58:04.137Z","slug":"CVE-2026-45306","body":"## Overview\n\n## 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  ← 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 — `/tmp/pyLoad/flask` not inside `PKGDIR` or `userdir`\n3. Attacker requests `GET /files/get/<victim_session_filename>`\n4. `send_from_directory('/tmp/pyLoad/flask', session_file)` serves victim's session\n5. Attacker uses stolen session → **Account Takeover**\n\n## PoC\n\n<img width=\"592\" height=\"408\" alt=\"POC\" src=\"https://github.com/user-attachments/assets/936b9f56-325b-437d-9edd-e0d5bb995187\" />\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  ← BYPASS CONFIRMED\n```\n\n## Impact\nAuthenticated admin can steal sessions of other users → 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```\n\n## Affected packages\n\n- `pyload-ng <= 0.5.0b3.dev99`\n\n## Remediation\n\nRefer to the advisory for the patched release.","depth":"sunlit","depthScore":36,"depthScoreParts":{"impact":35.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}