Integer Underflow (Wrap or Wraparound) Affecting github.com/consensys/gnark package, versions <0.9.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.11% (46th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMCONSENSYSGNARK-5952338
  • published10 Oct 2023
  • disclosed9 Oct 2023
  • creditMarcin Kostrzewa

Introduced: 9 Oct 2023

CVE-2023-44378  (opens in a new tab)
CWE-191  (opens in a new tab)

How to fix?

Upgrade github.com/consensys/gnark to version 0.9.0 or higher.

Overview

github.com/consensys/gnark is a gnark is a fast zk-SNARK library that offers a high-level API to design circuits.

Affected versions of this package are vulnerable to Integer Underflow (Wrap or Wraparound) via the frontend.API.Cmp and frontend.API.IsLess methods in the variable comparison and binary decomposition process. An attacker can manipulate the unsoundness of the system by exploiting the non-unique binary decomposition. This can lead to unexpected behaviour and potential security risks.

Workaround

It is recommended to use std/math/cmp gadget, which allows to bound the number of bits being compared, making the comparisons more efficient if the bound on the absolute difference of the values is known.

CVSS Scores

version 3.1