Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. filippo.io/nistec
  4. ›
  5. GMS-2023-508

GMS-2023-508: nistec has Incorrect Calculation in Multiplication of unreduced P-256 scalars

March 1, 2023

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 does not 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

  • github.com/FiloSottile/nistec/commit/c58aa1223ccf3943513e1e661cebce95af137244
  • github.com/advisories/GHSA-f6hc-9g49-xmx7
  • go.dev/issue/58647
  • pkg.go.dev/vuln/GO-2023-1595

Code Behaviors & Features

Detect and mitigate GMS-2023-508 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.0.2

Fixed versions

  • 0.0.2

Solution

Upgrade to version 0.0.2 or above.

Source file

go/filippo.io/nistec/GMS-2023-508.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:34 +0000.