Vulnerabilities in pkg:pypi/js2py
PACKAGECVE-2024-28397 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Js2py libraries in the PyPI ecosystem. The issue involves js2py allows remote code execution. Remediation is available in the latest vendor maintenance releases.
pkg:pypi/js2py
Vulnerability advisories affecting package pkg:pypi/js2py. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-h95x-26f3-88hr | CVE-2024-28397 | HIGH | js2py allows remote code execution |
CVE-2024-28397 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-28397
To remediate this vulnerability, upgrade all affected Js2py dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install js2py>=Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show js2py
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-28397, inspect your installed packages using pip:
pip show js2py
Analyze the terminal output to locate any version of Js2py in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The pip show js2py command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Js2py, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-28397 Affected Js2py Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
js2py
|
PyPI |
≤ 0.74
|
|
References
Frequently Asked Questions
What is CVE-2024-28397?
Which Js2py versions are affected?
What version fixes CVE-2024-28397?
Is js2py affected?
What is the CVSS score of CVE-2024-28397?
What CWE is associated with CVE-2024-28397?
How can I check PyPI dependencies for CVE-2024-28397?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h95x-26f3-88hr",
"modified" : "2024-07-05T17:36:08Z",
"published" : "2024-06-20T18:34:08Z",
"aliases" : [ "CVE-2024-28397" ],
"summary" : "js2py allows remote code execution",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "js2py"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.74"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-28397"
}, {
"type" : "WEB",
"url" : "https://github.com/PiotrDabkowski/Js2Py/pull/323"
}, {
"type" : "WEB",
"url" : "https://github.com/Marven11"
}, {
"type" : "WEB",
"url" : "https://github.com/Marven11/CVE-2024-28397-js2py-Sandbox-Escape"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/PiotrDabkowski/Js2Py"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-20T19:19:56Z",
"nvd_published_at" : "2024-06-20T17:15:50Z"
}
}