CVE-2024-28397
Medium · 5.3CVSS
5.3
EPSS
4.5%
Published
Jun 20, 2024
CISA due date
—
Cloudanix analysis
A flaw in a tool that runs JavaScript inside Python lets attackers execute their own programs on your computer when they send specially crafted input.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Library
- Class
- RCE
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Bypasses the disable_pyimport() restriction in js2py up to v0.74, enabling arbitrary Python code execution from within a JavaScript execution context.
Why it matters to the business
Attackers can run unauthorized commands on systems using this library, risking data exposure, system takeover, or further compromise in applications that process untrusted JavaScript.
How an attack unfolds
An attacker supplies a crafted JavaScript payload through an API call that circumvents the disabled pyimport mechanism in js2py, resulting in arbitrary code execution on the host. The issue has been weaponized, lowering the barrier for exploitation in affected environments.
How to fix it
Upgrade js2py to the latest version beyond 0.74. Audit all code paths that invoke js2py, restrict its use with untrusted input, and consider alternative libraries where possible.
How to confirm the fix worked
Confirm the deployed js2py version exceeds 0.74, retest disable_pyimport() behavior with sample payloads, and review dependency manifests for the vulnerable component.
Typical attack path
- Locate an application integrating a vulnerable js2py version
- Prepare a malicious JavaScript payload targeting the pyimport bypass
- Deliver the payload via a crafted API call to the js2py component
- Trigger execution to achieve code execution on the underlying system
How to detect it
Review application logs for unexpected Python module imports or subprocess activity originating from js2py execution contexts; correlate with inbound JavaScript payloads.
What your security team should do
- Prioritize upgrading js2py in all environments given weaponized exploit availability
- Inventory applications and dependencies using js2py
- Add runtime restrictions and input sanitization around JavaScript processing
- Monitor for post-exploitation activity following any suspected exposure
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | js2py | 0 | No fix |
| Chainguard | kubeflow-pipelines-visualization-server | 0 | 2.4.0-r0 |
| Mageia:9 | python-js2py | 0 | 0.70-3.1.mga9 |
| Ubuntu:24.04:LTS | python-cloudscraper | 0 | No fix |
| Ubuntu:24.10 | python-cloudscraper | 0 | No fix |
| Ubuntu:25.04 | python-cloudscraper | 0 | No fix |
| Ubuntu:25.10 | python-cloudscraper | 0 | No fix |
| Wolfi | kubeflow-pipelines-visualization-server | 0 | 2.4.0-r0 |
| openSUSE:Leap 15.6 | python-Js2Py | 0 | 0.74-150400.9.6.1 |
| openSUSE:Tumbleweed | python-Js2Py | 0 | 0.74-3.1 |
Related vulnerabilities
- CVE-2026-33230 NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and… Also affects kubeflow-pipelines-visualization-server
- CVE-2026-33231 NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and… Also affects kubeflow-pipelines-visualization-server
- CVE-2026-30922 pyasn1 is a generic ASN.1 library for Python. Also affects kubeflow-pipelines-visualization-server
- CVE-2026-31958 Tornado is a Python web framework and asynchronous networking library. Also affects kubeflow-pipelines-visualization-server
- CVE-2026-27199 Werkzeug is a comprehensive WSGI web application library. Also affects kubeflow-pipelines-visualization-server
- CVE-2025-14009 A critical vulnerability exists in the NLTK downloader component of nltk/nltk, affecting… Also affects kubeflow-pipelines-visualization-server
- CVE-2026-25990 Pillow is a Python imaging library. Also affects kubeflow-pipelines-visualization-server
- CVE-2026-26007 cryptography is a package designed to expose cryptographic primitives and recipes to… Also affects kubeflow-pipelines-visualization-server