Miggo Logo

CVE-2024-28397: js2py allows remote code execution

8.8

CVSS Score
3.1

Basic Information

EPSS Score
0.97887%
Published
6/20/2024
Updated
8/4/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
js2pypip<= 0.74

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* in t** *ompon*nt `js*py.*is**l*_pyimport()` o* js*py up to v*.** *llows *tt**k*rs to *x**ut* *r*itr*ry *o** vi* * *r**t** *PI **ll.

Reasoning

T** vuln*r**ility st*ms *rom in*ompl*t* s*n**oxin* in t** *is**l*_pyimport() impl*m*nt*tion. *n*lysis o* t** *it*u* PR #*** *ix s*ows t** __**t*ttr__ m*t*o* in JsO*j**tWr*pp*r w*s mo*i*i** to *** prop*r PyImport ****ss ****ks. T** ori*in*l impl*m*nt*