Vulnerabilities in pkg:pypi/fastecdsa

PACKAGE
Advisory Identifier: GHSA-ph86-g9r3-5qw4
Advisory Summary

CVE-2024-21502 is a HIGH (CVSS 7.5) uninitialized variable vulnerability (CWE-457: Use of Uninitialized Variable) affecting Fastecdsa libraries in the PyPI ecosystem. The issue involves uninitialized variable in fastecdsa. Remediation is available by upgrading affected packages to version 2.3.2.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/fastecdsa

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/fastecdsa. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-ph86-g9r3-5qw4 CVE-2024-21502 HIGH Uninitialized Variable in fastecdsa
GHSA-56wv-2wr9-3h9r CVE-2020-12607 HIGH Improper Verification of Cryptographic Signature in fastecdsa

CVE-2024-21502 at a Glance

CVE Identifier CVE-2024-21502
GHSA Identifier GHSA-ph86-g9r3-5qw4
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-457: Use of Uninitialized Variable
Affected Product Fastecdsa
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:N/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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2024-21502

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

fastecdsa fixed: 2.3.2
pip install fastecdsa>=2.3.2
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 fastecdsa

How to Check if You Are Affected

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

pip show fastecdsa

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

Note: The pip show fastecdsa command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-457: Use of Uninitialized Variable, where the code uses a variable that has not been initialized, leading to unpredictable or unintended results. In Fastecdsa, 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

Versions of the package fastecdsa before 2.3.2 use an Uninitialized Variable on the stack, via the curvemath_mul function in src/curveMath.c, due to being used and interpreted as user-defined type. Depending on the variable's actual value it could be arbitrary free(), arbitrary realloc(), null pointer dereference and other. Since the stack can be controlled by the attacker, the vulnerability could be used to corrupt allocator structure, leading to possible heap exploitation. The attacker could cause denial of service by exploiting this vulnerability.

CVE-2024-21502 Affected Fastecdsa Versions

1 component(s)
Fixed Versions:
2.3.2
Product / Package Ecosystem Affected Versions Fixed Version
fastecdsa
PyPI
< 2.3.2
2.3.2

References

Frequently Asked Questions

What is CVE-2024-21502?
CVE-2024-21502 is a security vulnerability in Fastecdsa involving Uninitialized Variable in fastecdsa under CWE-457: Use of Uninitialized Variable.
Which Fastecdsa versions are affected?
Affected versions include releases prior to 2.3.2 across affected packages: fastecdsa.
What version fixes CVE-2024-21502?
Upgrading to 2.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fastecdsa affected?
Yes, fastecdsa is affected in releases prior to 2.3.2. Upgrade your dependency to 2.3.2 or later.
What is the CVSS score of CVE-2024-21502?
CVE-2024-21502 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-21502?
CVE-2024-21502 is classified under CWE-457: Use of Uninitialized Variable (The code uses a variable that has not been initialized, leading to unpredictable or unintended results.).
How can I check PyPI dependencies for CVE-2024-21502?
Run the dependency tree command: 'pip show fastecdsa'. 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-ph86-g9r3-5qw4",
  "modified" : "2025-02-12T21:59:29Z",
  "published" : "2024-02-24T06:30:17Z",
  "aliases" : [ "CVE-2024-21502" ],
  "summary" : "Uninitialized Variable in fastecdsa",
  "details" : "Versions of the package fastecdsa before 2.3.2 use an Uninitialized Variable on the stack, via the curvemath_mul function in src/curveMath.c, due to being used and interpreted as user-defined type. Depending on the variable's actual value it could be arbitrary free(), arbitrary realloc(), null pointer dereference and other. Since the stack can be controlled by the attacker, the vulnerability could be used to corrupt allocator structure, leading to possible heap exploitation. The attacker could cause denial of service by exploiting this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "fastecdsa"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21502"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/AntonKueltz/fastecdsa/commit/57fc5689c95d649dab7ef60cc99ac64589f01e36"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/keltecc/49da037072276f21b005a8337c15db26"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/AntonKueltz/fastecdsa"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/AntonKueltz/fastecdsa/blob/v2.3.1/src/curveMath.c%23L210"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-PYTHON-FASTECDSA-6262045"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-457", "CWE-908" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-12T21:59:29Z",
    "nvd_published_at" : "2024-02-24T05:15:44Z"
  }
}