GHSA-9fvj-xqr2-xwg8

Suggest an improvement
Source
https://github.com/advisories/GHSA-9fvj-xqr2-xwg8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/08/GHSA-9fvj-xqr2-xwg8/GHSA-9fvj-xqr2-xwg8.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-9fvj-xqr2-xwg8
Aliases
  • CVE-2025-58157
Published
2025-08-29T20:20:13Z
Modified
2025-08-29T21:12:22.906496Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
gnark affected by denial of service when computing scalar multiplication using fake-GLV algorithm
Details

Impact

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.

Patches

The issue has been patched in gnark-crypto commit https://github.com/Consensys/gnark-crypto/commit/56600883e0e9f9b159e9c7000b94e76185ec3d0d. The dependency update is implemented in gnark commit https://github.com/Consensys/gnark/commit/68be6cede36e387ab760725beabd3c96cc94e6dc.

Workarounds

This update doesn't require recompiling the circuits as the issue is in the hint function. The users can update the gnark-crypto dependency to the fixed version.

References

  • See bug report https://github.com/Consensys/gnark/issues/1483
  • Fake GLV description https://ethresear.ch/t/fake-glv-you-dont-need-an-efficient-endomorphism-to-implement-glv-like-scalar-multiplication-in-snark-circuits/20394
Database specific
{
    "severity": "HIGH",
    "github_reviewed_at": "2025-08-29T20:20:13Z",
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-400"
    ],
    "github_reviewed": true
}
References

Affected packages

Go / github.com/consensys/gnark

Package

Name
github.com/consensys/gnark
View open source insights on deps.dev
Purl
pkg:golang/github.com/consensys/gnark

Affected ranges

Type
SEMVER
Events
Introduced
0.12.0
Fixed
0.13.0

Affected versions

0.*

0.12.0