CVE-2020-25489: Py mini racer Heap Overflow Vulnerability

HIGH
Advisory Identifier: GHSA-vwcg-7xqw-qcxw
CVSS 9.8
CWE-119
Published
Advisory Summary

CVE-2020-25489 is a HIGH (CVSS 9.8) heap overflow vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Py mini racer libraries in the PyPI ecosystem. The issue involves heap overflow in pyminiracer. Remediation is available by upgrading affected packages to version 0.3.0.

CVE-2020-25489 at a Glance

CVE Identifier CVE-2020-25489
GHSA Identifier GHSA-vwcg-7xqw-qcxw
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected Product Py mini racer
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.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:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-25489

To remediate this vulnerability, upgrade all affected Py mini racer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

py-mini-racer fixed: 0.3.0
pip install py-mini-racer>=0.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show py-mini-racer

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2020-25489, inspect your installed packages using pip:

pip show py-mini-racer

Analyze the terminal output to locate any version of Py mini racer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.0), your application is affected.

Note: The pip show py-mini-racer command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Py mini racer, 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

A heap overflow in Sqreen PyMiniRacer (aka Python Mini Racer) before 0.3.0 allows remote attackers to potentially exploit heap corruption. More details on https://blog.sqreen.com/vulnerability-disclosure-finding-a-vulnerability-in-sqreens-php-agent-and-how-we-fixed-it/.

CVE-2020-25489 Affected Py mini racer Versions

1 component(s)
Fixed Versions:
0.3.0
Product / Package Ecosystem Affected Versions Fixed Version
py-mini-racer
PyPI
< 0.3.0
0.3.0

References

Frequently Asked Questions

What is CVE-2020-25489?
CVE-2020-25489 is a security vulnerability in Py mini racer involving Heap Overflow in PyMiniRacer under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer.
Which Py mini racer versions are affected?
Affected versions include releases prior to 0.3.0 across affected packages: py-mini-racer.
What version fixes CVE-2020-25489?
Upgrading to 0.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is py-mini-racer affected?
Yes, py-mini-racer is affected in releases prior to 0.3.0. Upgrade your dependency to 0.3.0 or later.
What is the CVSS score of CVE-2020-25489?
CVE-2020-25489 has a CVSS v3.1 base score of 9.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-25489?
CVE-2020-25489 is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer (The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.).
How can I check PyPI dependencies for CVE-2020-25489?
Run the dependency tree command: 'pip show py-mini-racer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vwcg-7xqw-qcxw",
  "modified" : "2024-10-21T20:25:05Z",
  "published" : "2020-09-18T18:03:59Z",
  "aliases" : [ "CVE-2020-25489" ],
  "summary" : "Heap Overflow in PyMiniRacer",
  "details" : "A heap overflow in Sqreen PyMiniRacer (aka Python Mini Racer) before 0.3.0 allows remote attackers to potentially exploit heap corruption.\n\nMore details on https://blog.sqreen.com/vulnerability-disclosure-finding-a-vulnerability-in-sqreens-php-agent-and-how-we-fixed-it/.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "py-mini-racer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sqreen/PyMiniRacer/security/advisories/GHSA-vwcg-7xqw-qcxw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-25489"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sqreen/PyMiniRacer/commit/627b54768293ec277f1adb997c888ec524f4174d"
  }, {
    "type" : "WEB",
    "url" : "https://blog.sqreen.com/vulnerability-disclosure-finding-a-vulnerability-in-sqreens-php-agent-and-how-we-fixed-it"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/py-mini-racer/PYSEC-2020-93.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sqreen/PyMiniRacer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sqreen/PyMiniRacer/compare/v0.2.0...v0.3.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-119" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-09-18T14:06:03Z",
    "nvd_published_at" : null
  }
}