Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2024-28397
Python vulnerability analysis and mitigation

Overview

CVE-2024-28397 affects js2py versions up to v0.74, a popular Python package used for evaluating JavaScript code inside Python interpreters. The vulnerability was discovered in February 2024 and publicly disclosed on June 20, 2024. The affected component is js2py.disable_pyimport(), which is commonly used in web scrapers and applications for parsing JavaScript code (GitHub PoC).

Technical details

The vulnerability exists in the implementation of a global variable inside js2py that allows attackers to obtain a reference to a Python object in the js2py environment. This enables attackers to escape the JavaScript environment despite the use of js2py.disable_pyimport(), which is intended to prevent such escapes. The vulnerability has been assigned a CVSS v3.1 base score of 5.3 (Medium) with the vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L (NVD).

Impact

The vulnerability allows attackers to execute arbitrary code on the host system by bypassing the JavaScript sandbox restrictions. This affects multiple popular projects including pyload, cloudscraper (which uses js2py as an optional JavaScript interpreter), and lightnovel-crawler. With over 1 million monthly downloads, the impact of this vulnerability is significant (Security Online).

Exploitability

An attacker can exploit this vulnerability by tricking a target into processing a malicious JavaScript file, either through a compromised website or a deceptive API call. The vulnerability affects all versions of js2py up to and including 0.74 running under Python versions below 3.12 (GitHub PoC).

Mitigation and workarounds

Currently, there is no official patch available from the js2py maintainers. However, users can apply the fix provided by security researcher Marven11 either dynamically using the fix.py script or by manually patching the source code with the instructions in patch.txt (GitHub PoC).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-61599HIGH8.8
  • Python logoPython
  • djust
NoYesSep 16, 2026
CVE-2026-61596HIGH7.1
  • Python logoPython
  • djust
NoYesSep 16, 2026
CVE-2026-61588MEDIUM6.5
  • Python logoPython
  • djust
NoYesSep 16, 2026
CVE-2026-61589MEDIUM6.3
  • Python logoPython
  • djust
NoYesSep 16, 2026
CVE-2026-61597MEDIUM5.1
  • Python logoPython
  • djust
NoYesSep 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management