GHSA-r44w-v6gf-x3p6: Pyload ng Authentication Bypass Vulnerability
HIGHGHSA-r44w-v6gf-x3p6 is a HIGH (CVSS 8.1) authentication bypass vulnerability (CWE-287: Improper Authentication) affecting Pyload ng libraries in the PyPI ecosystem. The issue involves pyload has an authentication bypass in api key validation (check_apikey cache). Remediation is available by upgrading affected packages to version 0.5.0b3.dev101.
GHSA-r44w-v6gf-x3p6 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix GHSA-r44w-v6gf-x3p6
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.
pip install pyload-ng>=0.5.0b3.dev101
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 GHSA-r44w-v6gf-x3p6, 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.dev101), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. 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
GHSA-r44w-v6gf-x3p6 Affected Pyload ng Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pyload-ng
|
PyPI |
< 0.5.0b3.dev101
|
0.5.0b3.dev101
|
References
Frequently Asked Questions
What is GHSA-r44w-v6gf-x3p6?
Which Pyload ng versions are affected?
What version fixes GHSA-r44w-v6gf-x3p6?
Is pyload-ng affected?
What is the CVSS score of GHSA-r44w-v6gf-x3p6?
What CWE is associated with GHSA-r44w-v6gf-x3p6?
How can I check PyPI dependencies for GHSA-r44w-v6gf-x3p6?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r44w-v6gf-x3p6",
"modified" : "2026-10-09T16:43:55Z",
"published" : "2026-10-09T16:43:55Z",
"aliases" : [ ],
"summary" : "pyLoad has an authentication bypass in API key validation (check_apikey cache)",
"details" : "## Summary\n\nThe API-key cache in `check_apikey()` allows an attacker to authenticate with a **forged API key** as long as the legitimate key for the same `key_id` has been used recently.\n\nOn a cache hit, the API key **secret is never verified**, resulting in a complete authentication bypass during the cache lifetime.\n\n---\n\n# Affected Components\n\n- `src/pyload/core/api/init.py`\n - `Api.check_apikey()`\n\n- `src/pyload/core/database/apikey_database.py`\n - `check_apikey()`\n - `_check_key()`\n\nThe cache is used by normal API requests through:\n\n- `src/pyload/webui/app/helpers.py`\n\nwhich calls:\n\n```python\napi.check_apikey(api_key)\n```\n\nwithout providing a `ttl`, meaning the default **300-second cache** is always enabled.\n\n---\n\n# Root Cause\n\nSuccessful API key validations are cached in:\n\n```python\nself._apikey_cache\n```\n\nusing the following structure:\n\n```python\n{\n key_id: (timestamp, cached_data)\n}\n```\n\nThe cache key is based **only on `key_id`**, and that value is parsed directly from the user-supplied API key rather than being obtained from a trusted lookup.\n\nWhen a cache hit occurs within the TTL, `check_apikey()` returns:\n\n```python\n{\n \"success\": True,\n \"data\": cached_data\n}\n```\n\nafter checking only:\n\n- `expires_at`\n\nAt no point on this execution path is the supplied secret:\n\n```text\napikey[-43:]\n```\n\ncompared against the stored key hash.\n\n---\n\nThe actual secret verification exists only in:\n\n```python\n_check_key()\n```\n\nwhich correctly uses:\n\n```python\nhmac.compare_digest()\n```\n\nHowever, this function is only reached on a **cache miss** through the database layer's `check_apikey()` implementation.\n\nFurthermore, the cached object cannot be used for verification because it intentionally does **not** include the stored key hash.\n\nThe cached record contains only:\n\n- `id`\n- `user_id`\n- `name`\n- `created_at`\n- `expires_at`\n- `last_used`\n\nSince `key_hash` is absent, the cache lacks the information required to validate the presented secret.\n\nAs a result, once a legitimate request populates the cache, every subsequent request using the same `key_id` within the 300-second cache window is accepted **without validating the secret**.\n\n---\n\n# Impact\n\n`key_id` values are small sequential integers assigned when API keys are created (1, 2, 3, ...), making them trivial to enumerate.\n\nThe API key format is also publicly reconstructable from the source code.\n\nAn attacker therefore does **not** need to know any valid API key secret.\n\nThey only need a `key_id` whose legitimate key has been used within the previous five minutes, which is likely on an actively used deployment.\n\nDuring that cache window, a forged API key follows exactly the same authentication path as a legitimate key and inherits the associated user's permissions.\n\nThis results in a **complete remote authentication bypass**.\n\nI would classify the issue as **Critical** severity.\n\n---\n\n# Estimated CVSS v3.1\n\n```\nAV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H\n```\n\n(`AC:H` only because successful exploitation depends on the cache already containing an entry.)\n\n---\n\n# Reproduction\n\n### 1. Create an administrator account.\n\n---\n\n### 2. Generate an API key.\n\nExample:\n\n```text\npl_11<43-character-secret>\n```\n\nwhere:\n\n```\nkey_id = 1\n```\n\n---\n\n### 3. Send a legitimate authenticated request.\n\n```bash\ncurl \\\n -H \"X-API-Key: pl_11<real-43-char-secret>\" \\\n http://127.0.0.1:8000/api/status\n```\n\nExpected response:\n\n```text\nHTTP/1.1 200 OK\n```\n\n---\n\n### 4. Within 300 seconds, send the same request using a forged API key.\n\n```bash\ncurl \\\n -H \"X-API-Key: pl_11xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\" \\\n http://127.0.0.1:8000/api/status\n```\n\nObserved response:\n\n```text\nHTTP/1.1 200 OK\n```\n\nThe request succeeds even though the API key secret is entirely incorrect.\n\n---\n\n# Control Test\n\nIf the forged API key is sent **before** any legitimate request has populated the cache, the server correctly returns:\n\n```text\nHTTP/1.1 401 Unauthorized\n```\n\nThe only difference between the failing and succeeding forged request is whether the cache already contains an entry for that `key_id`.\n\nThis isolates the vulnerability specifically to the cache-hit path.\n\n---\n\n# Suggested Fix\n\nCache hits should **never replace secret verification**.\n\nPossible approaches include:\n\n- Store a value derived from the complete API key (or its hash) in the cache and verify it using `hmac.compare_digest()` on every cache hit before returning success.\n\n- Alternatively, key the cache using a value derived from the **entire API key secret** (for example, a cryptographic hash of the complete API key) rather than using only `key_id`.\n\nRegardless of implementation, the security invariant should remain:\n\n> **The API key secret must be validated on every authenticated request, regardless of whether the cache is hit or missed.**",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pyload-ng"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.0b3.dev101"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/security/advisories/GHSA-r44w-v6gf-x3p6"
}, {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/commit/00d1372510f915f843b1574a3f1b28fbb724a42e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pyload/pyload"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-09T16:43:55Z",
"nvd_published_at" : null
}
}