Skip to content

nistec has Incorrect Calculation in Multiplication of unreduced P-256 scalars

High severity GitHub Reviewed Published Mar 1, 2023 to the GitHub Advisory Database • Updated May 20, 2024

Package

gomod filippo.io/nistec (Go)

Affected versions

< 0.0.2

Patched versions

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.

References

Published to the GitHub Advisory Database Mar 1, 2023
Reviewed Mar 1, 2023
Published by the National Vulnerability Database Mar 8, 2023
Last updated May 20, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

EPSS score

0.091%
(40th percentile)

Weaknesses

CVE ID

CVE-2023-24533

GHSA ID

GHSA-f6hc-9g49-xmx7

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.