CVE-2024-21502
Python vulnerability analysis and mitigation

Overview

CVE-2024-21502 affects versions of the fastecdsa package before 2.3.2. The vulnerability was discovered in February 2024 and involves a Use of Uninitialized Variable on the stack in the curvemath_mul function within src/curveMath.c. The vulnerability affects the fastecdsa Python package, which is designed for performing fast elliptic curve cryptography, specifically digital signatures (Snyk Advisory).

Technical details

The vulnerability stems from an uninitialized variable on the stack in the curvemathmul function. The variable is used and interpreted as a user-defined type, leading to undefined behavior. The issue occurs when the variable is passed to functions pointZZpMul and mpz_clears, where the latter calls free() internally. The vulnerability is triggered when a point multiplication operation is performed with specific parameters, particularly when using a curve with b=0 and point (0,0) (GitHub PoC).

Impact

Depending on the variable's actual value, the vulnerability could lead to arbitrary free(), arbitrary realloc(), null pointer dereference, and other memory-related issues. Since the stack can be controlled by the attacker, the vulnerability could be used to corrupt allocator structure, potentially leading to heap exploitation. The primary impact is denial of service, but there are also risks of sensitive information leakage and potential remote code execution (Snyk Advisory).

Mitigation and workarounds

The vulnerability has been fixed in version 2.3.2 of the fastecdsa package. The fix involves properly initializing the variable by adding 'mpz_inits(result.x, result.y, NULL)' to the affected code. Users are strongly recommended to upgrade to version 2.3.2 or later to address this security issue (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management