CVE-2024-28397: js2py allows remote code execution
8.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.97887%
CWE
Published
6/20/2024
Updated
8/4/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| js2py | pip | <= 0.74 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from incomplete sandboxing in the disable_pyimport() implementation. Analysis of the GitHub PR #323 fix shows the getattr method in JsObjectWrapper was modified to add proper PyImport access checks. The original implementation allowed attribute access to bypass pyimport restrictions, enabling code injection via JavaScript's built-in object prototypes. The PoC demonstrates this by accessing PyImport through JavaScript's Object.getattr chain even after disable_pyimport() was called.