CVE-2024-28397
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
js2py up to v0.74 allows sandbox escape via disable_pyimport() bypass, enabling arbitrary Python code execution.
Vulnerability
Overview
CVE-2024-28397 is a sandbox escape vulnerability in js2py, a JavaScript-to-Python translator and interpreter written in pure Python. The issue resides in the js2py.disable_pyimport() function, which is meant to restrict access to Python imports from JavaScript code. However, due to insufficient enforcement, an attacker can craft a JavaScript API call that circumvents this restriction, allowing the execution of arbitrary Python code within the Python runtime [1][2].
Exploitation
Mechanism
The attack requires the ability to supply or influence JavaScript code that is evaluated by js2py. No authentication is needed if the vulnerable component is exposed to untrusted input. By bypassing disable_pyimport(), an attacker can call Python functions (e.g., __import__, exec, or eval) directly from JavaScript, effectively escaping the sandbox and gaining access to the underlying Python environment [2][4].
Impact
Successful exploitation enables an attacker to execute arbitrary Python code on the host system. This can lead to full compromise of the application using js2py, including data exfiltration, privilege escalation, or further lateral movement within the network [1][2]. The CVSS v3 base score of 5.3 (Medium) reflects the moderate attack complexity and the need for some user interaction or specific conditions [2].
Mitigation
Status
As of the latest advisories, there is no patched release of js2py. A pull request (#323) has been submitted to address the issue, but it has not yet been merged into the main branch [3][4]. Users are advised to either migrate away from js2py or apply the proposed fix manually until an official update is released [3].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
js2pyPyPI | <= 0.74 | — |
Affected products
5- osv-coords5 versionspkg:apk/chainguard/kubeflow-pipelines-visualization-serverpkg:apk/wolfi/kubeflow-pipelines-visualization-serverpkg:pypi/js2pypkg:rpm/opensuse/python-Js2Py&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/python-Js2Py&distro=openSUSE%20Tumbleweed
< 2.4.0-r0+ 4 more
- (no CPE)range: < 2.4.0-r0
- (no CPE)range: < 2.4.0-r0
- (no CPE)range: <= 0.74
- (no CPE)range: < 0.74-150400.9.6.1
- (no CPE)range: < 0.74-3.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
3- github.com/advisories/GHSA-h95x-26f3-88hrghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-28397ghsaADVISORY
- github.com/PiotrDabkowski/Js2Py/pull/323ghsaWEB
News mentions
0No linked articles in our index yet.