GitHub Advisoryadvisory · PyPI
GHSA-pgpj-v85q-h5fm Cross-Site Request Forgery on any API call in pyLoad may lead to admin privilege escalation
CRITICAL
Official page ↗
- Aliases
- CVE-2024-22416
- Ecosystem
- PyPI
- Packages
- pyload-ng
- Severity
- Critical
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
- Weaknesses
- CWE-352
- Reviewed
- 2024-01-19
Affected packages
• PyPI pyload-ng: < 0.5.0b3.dev78 → fixed in 0.5.0b3.dev78
Description
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
history.pushState('', '', '/');
document.forms[0].submit();
```
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.
Related
Alias · CVE (1)
- CVE-2024-22416 pyLoad is a free and open-source Download Manager written in pure Python. vulnerability
Weakness · CWE (1)
- CWE-352 Cross-Site Request Forgery weakness
References
- https://github.com/pyload/pyload/security/advisories/GHSA-pgpj-v85q-h5fm web
- https://nvd.nist.gov/vuln/detail/CVE-2024-22416 advisory
- https://github.com/pyload/pyload/commit/1374c824271cb7e927740664d06d2e577624ca3e web
- https://github.com/pyload/pyload/commit/c7cdc18ad9134a75222974b39e8b427c4af845fc web
- https://github.com/pyload/pyload package
- https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2024-17.yaml web