CVE-2022-41340: secp256k1-js implements ECDSA without required r and s validation, leading to signature forgery
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.13378%
CWE
Published
9/25/2022
Updated
1/28/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| @lionello/secp256k1-js | npm | < 1.1.0 | 1.1.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The core vulnerability stems from missing cryptographic parameter validation in ECDSA operations. The patch added critical checks in three key functions: 1) ecverify() now explicitly checks for r/s=0 (CVE's primary focus), 2) ecrecover() added r/s=0 validation and recId range checking, and 3) ecsign() added d/z=0 validation. The high confidence for ecverify/ecrecover comes from direct correlation with CWE-347 and the attack vector described - signature forgery through invalid zero-value signatures. The medium confidence for ecsign reflects that while missing d/z validation could enable other attacks, it wasn't the primary signature forgery path described in the advisory.