ECDSA nonce bias caused by truncation (wolfSSL wolfSSL)
At a glance
- Source
- NVD
- EPSS
- EPSS 0.35 % Β· percentile 29 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- wolfSSL
- NVD status
- Modified
Description
Generating the ECDSA nonce k samples a random number r and then truncates this randomness with a modular reduction mod n where n is the order of the elliptic curve. Meaning k = r mod n. The division used during the reduction estimates a factor q_e by dividing the upper two digits (a digit having e.g. a size of 8 byte) of r by the upper digit of n and then decrements q_e in a loop until it has the correct size. Observing the number of times q_e is decremented through a control-flow revealing side-channel reveals a bias in the most significant bits of k. Depending on the curve this is either a negligible bias or a significant bias large enough to reconstruct k with lattice reduction methods. For SECP160R1, e.g., we find a bias of 15 bits.
Weaknesses (CWE)
- CWE-203 β Observable Discrepancy
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | MEDIUM 4.1 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N | wolfSSL |
| CVSS 3.1 | MEDIUM 4.1 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N | NVD Β· facts@wolfssl.com (Secondary) |
| CVSS 3.1 | MEDIUM 4.9 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N | NVD Β· nvd@nist.gov (Primary) |
European references
- ENISA EUVD Β· EUVD-2024-17291
- GCVE Β· GCVE-0-2024-1544
Affected configurations (NVD CPE)
cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:*< 5.7.2
Affected products
| Product | Versions |
|---|---|
| wolfSSL Β· wolfSSL | affected 0 β€ 5.6.4 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST β attribution requested |
| ENISA EUVD | ENISA β reproduction authorised, source acknowledged |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain β this product uses data from the NVD API but is not endorsed or certified by the NVD |