Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/consensys/gnark
  4. ›
  5. CVE-2025-58157

CVE-2025-58157: gnark affected by denial of service when computing scalar multiplication using fake-GLV algorithm

August 29, 2025

For optimizing the scalar multiplication algorithm in circuit for some curves, gnark uses fake-GLV algorithm in case the curve doesn’t support true-GLV. For this to work, we need to compute the scalar decomposition using the Half GCD method in gnark-crypto. However, for some of the inputs the algorithm didn’t converge quickly enough.

In case the prover accepts untrusted witness, it could lead to denial of service as the prover gets stuck in a very slowly converging loop.

Thanks to @feltroidprime for reporting the issue and proposing a fix.

References

  • github.com/Consensys/gnark
  • github.com/Consensys/gnark-crypto/commit/56600883e0e9f9b159e9c7000b94e76185ec3d0d
  • github.com/Consensys/gnark/commit/68be6cede36e387ab760725beabd3c96cc94e6dc
  • github.com/Consensys/gnark/issues/1483
  • github.com/Consensys/gnark/security/advisories/GHSA-9fvj-xqr2-xwg8
  • github.com/advisories/GHSA-9fvj-xqr2-xwg8
  • nvd.nist.gov/vuln/detail/CVE-2025-58157

Code Behaviors & Features

Detect and mitigate CVE-2025-58157 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 starting from 0.12.0 before 0.13.0, version 0.12.0

Fixed versions

  • 0.13.0

Solution

Upgrade to version 0.13.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-400: Uncontrolled Resource Consumption

Source file

go/github.com/consensys/gnark/CVE-2025-58157.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 30 Aug 2025 00:19:17 +0000.