GitHub Advisoryadvisory · Go

GHSA-f6hc-9g49-xmx7 nistec has Incorrect Calculation in Multiplication of unreduced P-256 scalars

HIGH Published 2023-03-01 Modified 2024-05-20 Official page ↗
Aliases
CVE-2023-24533
Ecosystem
Go
Packages
filippo.io/nistec
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weaknesses
CWE-682
Reviewed
2023-03-01

Affected packages

• Go filippo.io/nistec: < 0.0.2 → fixed in 0.0.2

Description

Multiplication of certain unreduced P-256 scalars produce incorrect results. There are no protocols known at this time that can be attacked due to this. From the fix commit notes: > Unlike the rest of nistec, the P-256 assembly doesn't use complete addition formulas, meaning that p256PointAdd[Affine]Asm won't return the correct value if the two inputs are equal. > > This was (undocumentedly) ignored in the scalar multiplication loops because as long as the input point is not the identity and the scalar is lower than the order of the group, the addition inputs can't be the same. > > As part of the math/big rewrite, we went however from always reducing the scalar to only checking its length, under the incorrect assumption that the scalar multiplication loop didn't require reduction.

Related

Alias · CVE (1)

  • CVE-2023-24533 Multiplication of certain unreduced P-256 scalars produce incorrect results. vulnerability

Weakness · CWE (1)

  • CWE-682 Incorrect Calculation weakness

References