Vulnerability · Published Oct 9, 2023 · Assigned by GitHub_M
CVE-2023-44378gnark vulnerable to unsoundness in variable comparison/non-unique binary decomposition
High 7.1
In plain English
A high-severity security flaw in gnark from Consensys. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 14% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
gnark is a zk-SNARK library that offers a high-level API to design circuits. Prior to version 0.9.0, for some in-circuit values, it is possible to construct two valid decomposition to bits. In addition to the canonical decomposition of `a`, for small values there exists a second decomposition for `a+r` (where `r` is the modulus the values are being reduced by). The second decomposition was possible due to overflowing the field where the values are defined. Upgrading to version 0.9.0 should fix the issue without needing to change the calls to value comparison methods.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Go | github.com/consensys/gnark | 0.9.0 | GO-2023-2098 |
| Go | github.com/consensys/gnark | 0.9.0 | GHSA-498w-5j49-vqjg |
Affected products (as reported)
Weakness: CWE-191, CWE-697 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
References
- https://github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg x_refsource_CONFIRM
- https://github.com/zkopru-network/zkopru/issues/116 x_refsource_MISC
- https://github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f x_refsource_MISC