CVE-2024-28397 js2py allows remote code execution

Medium 5.3 Published Updated

Attackers can execute arbitrary code via crafted API calls in the js2py library due to improper neutralization of special elements used in code generation.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-28397?

CVE-2024-28397 is a medium-severity code injection vulnerability in n/a, published on 20 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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.

Weakness: CWE-94

Which versions are affected by CVE-2024-28397?

3 open source packages ship an affected version, including js2py.

PackageAffectedFixed in
js2py PyPIAll versions to 0.74None
js2py PyPIAll versions to 0.74None
js2py PyPIAll versions to 0.74None
Linux distribution packages (3)
python-Js2Py openSUSE:Leap 15.6All versions0.74-150400.9.6.1
python-Js2Py openSUSE:TumbleweedAll versions0.74-3.1
python-Js2Py openSUSE:TumbleweedAll versions0.74-6.1

How do I fix CVE-2024-28397?

Upgrade to a fixed version.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2024-28397 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-28397 exists.

Public exploit code: 1 Metasploit module, 1 Exploit-DB entry, 1 Nuclei template and 16 proofs of concept on GitHub.

Sources

Also known as ECHO-af95-1da0-5a17, GHSA-h95x-26f3-88hr, MGASA-2024-0256, PYSEC-2026-1476, SUSE-SU-2024:2272-1, UBUNTU-CVE-2024-28397 and 2 more.

Is CVE-2024-28397 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free