Cloudanix VulnDB

CVE-2024-28397

Medium · 5.3

CVSS

5.3

EPSS

4.5%

Published

Jun 20, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

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.

Weaponized
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

  1. Locate an application integrating a vulnerable js2py version
  2. Prepare a malicious JavaScript payload targeting the pyimport bypass
  3. Deliver the payload via a crafted API call to the js2py component
  4. 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