{"answers":{"affected":"3 open source packages ship an affected version, including js2py.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-28397 exists.","fix":"Upgrade to a fixed version.","what":"CVE-2024-28397 is a medium-severity code injection vulnerability in n/a, published on 20 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-28397 and fix it if it is affected.\n\nWhat it is: CVE-2024-28397 is a medium-severity code injection vulnerability in n/a, published on 20 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-28397 exists.\n\nAffected packages and fixed versions:\n- js2py (PyPI): affected all versions up to 0.74; no fix listed\n- js2py (PyPI): affected all versions up to 0.74; no fix listed\n- js2py (PyPI): affected all versions up to 0.74; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-28397/ (Markdown: https://insights.sbomify.com/CVE-2024-28397/index.md)","id":"CVE-2024-28397","markdown":"https://insights.sbomify.com/CVE-2024-28397/index.md","name":"CVE-2024-28397","record":{"aliases":["ECHO-af95-1da0-5a17","GHSA-h95x-26f3-88hr","MGASA-2024-0256","PYSEC-2026-1476","SUSE-SU-2024:2272-1","UBUNTU-CVE-2024-28397","openSUSE-SU-2024:14086-1","openSUSE-SU-2026:11322-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python JavaScript engine","requires_auth":"low_privilege","summary":"Attackers can execute arbitrary code via crafted API calls in the js2py library due to improper neutralization of special elements used in code generation.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[],"cvss":{"score":5.3,"severity":"medium","source":"cisa-adp","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","version":"3.1"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"description":"An issue in the component js2py.disable_pyimport() of js2py up to v0.74 allows attackers to execute arbitrary code via a crafted API call.","ecosystems":["PyPI","openSUSE:Leap 15.6","openSUSE:Tumbleweed"],"exploits":{"exploitdb":1,"first_seen":"2024-06-19","github_poc":16,"max_poc_stars":73,"metasploit":1,"nuclei":1,"refs":[{"date":"2024-06-19T01:46:33Z","kind":"github_poc","ref":"https://github.com/Marven11/CVE-2024-28397-js2py-Sandbox-Escape","stars":73,"title":"CVE-2024-28397: js2py sandbox escape, bypass pyimport restriction."},{"date":"2025-09-09T09:57:26Z","kind":"github_poc","ref":"https://github.com/naclapor/CVE-2024-28397","stars":12,"title":"This repository contains a python exploit code for CVE-2024-28397 intended for use on the \"CodePartTwo\" machine on Hack The Box (HTB)."},{"date":"2025-08-17T04:00:59Z","kind":"github_poc","ref":"https://github.com/GhostOverflow/CVE-2024-28397-command-execution-poc","stars":5,"title":"This vulnerability arises from incomplete sandboxing in js2py, where crafted JavaScript can traverse Python’s internal object model and access dangerous classes like subprocess.Popen, leading to arbitrary command execution."},{"date":"2025-12-06T16:48:49Z","kind":"github_poc","ref":"https://github.com/L1337Xi/CVE-2024-28397-Exploit-Automation","stars":2,"title":"A Python automation script for exploiting the **js2py Sandbox Escape** vulnerability (CVE-2024-28397). This tool automates the payload generation and delivery process to achieve Remote Code Execution (RCE) on vulnerable instances."},{"date":"2026-02-03T08:44:36Z","kind":"github_poc","ref":"https://github.com/xeloxa/CVE-2024-28397-Js2Py-RCE-Exploit","stars":2,"title":"Professional exploit for CVE-2024-28397: Js2Py Sandbox Escape leading to Remote Code Execution (RCE). Includes modular payload generation."},{"date":"2025-08-18T01:09:33Z","kind":"github_poc","ref":"https://github.com/RianJuniorSf/exploit-js2py","stars":1,"title":"The CVE-2024-28397 vulnerability affects versions of js2py up to v0.74, a Python library that allows JavaScript code to be executed within the Python interpreter. "},{"date":"2025-08-18T15:40:19Z","kind":"github_poc","ref":"https://github.com/harutomo-jp/CVE-2024-28397-RCE","stars":1,"title":null},{"date":"2025-08-28T07:39:30Z","kind":"github_poc","ref":"https://github.com/Naved124/CVE-2024-28397-js2py-Sandbox-Escape","stars":1,"title":null}],"tier":"weaponised"},"has_fix":true,"headline":"js2py allows remote code execution","id":"CVE-2024-28397","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2024"},"n_packages":6,"n_references":2,"next":{"headline":"Cross-site scripting in n/a","id":"CVE-2024-28401"},"packages":[{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["0.74"],"package":"js2py","purl":null,"source":"GHSA-h95x-26f3-88hr"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["0.74"],"package":"js2py","purl":"pkg:pypi/js2py","source":"GHSA-h95x-26f3-88hr"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["0.74"],"package":"js2py","purl":"pkg:pypi/js2py","source":"PYSEC-2026-1476"},{"ecosystem":"openSUSE:Leap 15.6","fixed":["0.74-150400.9.6.1"],"introduced":["0"],"last_affected":[],"package":"python-Js2Py","purl":"pkg:rpm/opensuse/python-Js2Py\u0026distro=openSUSE%20Leap%2015.6","source":"SUSE-SU-2024:2272-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["0.74-3.1"],"introduced":["0"],"last_affected":[],"package":"python-Js2Py","purl":"pkg:rpm/opensuse/python-Js2Py\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:14086-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["0.74-6.1"],"introduced":["0"],"last_affected":[],"package":"python-Js2Py","purl":"pkg:rpm/opensuse/python-Js2Py\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2026:11322-1"}],"prev":{"headline":"Code injection in n/a","id":"CVE-2024-28396"},"products":["n/a"],"published":"2024-06-20","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-02","vendors":["n/a"]},"summary":"Attackers can execute arbitrary code via crafted API calls in the js2py library due to improper neutralization of special elements used in code generation.","url":"https://insights.sbomify.com/CVE-2024-28397/"}