CVE-2023-44378
gnark vulnerable to unsoundness in variable comparison/non-unique binary decomposition
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.1
gnark vulnerable to unsoundness in variable comparison/non-unique binary decomposition
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.
- Record
CVE-2023-44378- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N - Weakness
- CWE-191, CWE-697
- Updated
- 2026-11-02
EUVDEUVD-2023-2641
7.1
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.
- Record
EUVD-2023-2641- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-498w-5j49-vqjg
5.5
gnark unsoundness in variable comparison / non-unique binary decomposition
Impact
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.
Internally, the comparison methods frontend.API.Cmp and frontend.API.IsLess used binary decomposition and checked the bitwise differences. This allows a malicious prover to construct a valid proof for a statement a < b even if a > b.
The issue impacts all users using API.Cmp or API.IsLess methods. Additionally, it impacts the users using bits.ToBinary or API.ToBinary methods if full-width decomposition is requested (the default behaviour if no options are given).
The issues does not impact comparison methods in field emulation (package std/math/emulated) and dedicated comparison package (std/math/cmp).
Patches
Fix has been implemented in pull request #835 and merged in commit 59a4087261a6c73f13e80d695c17b398c3d0934f to master branch. The release v0.9.0 and onwards include the fix.
The fix added additional comparison of the decomposed bit-vector to the modulus of the in-circuit values.
Workarounds
Upgrading to version v0.9.0 should fix the issue without needing to change the calls to value comparison methods.
Alternatively, users can use the std/math/cmp gadget, which additionally 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.
References
- https://github.com/Consensys/gnark/pull/835
- https://github.com/zkopru-network/zkopru/issues/116
- https://github.com/iden3/circomlib/pull/48
Acknowledgement
The vulnerability was reported by Marcin Kostrzewa @ Reilabs.
- Record
GHSA-498w-5j49-vqjg- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-191, CWE-697
- Updated
- 2026-11-02
NVD
7.1
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.
- Record
CVE-2023-44378- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N - CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-191, CWE-697
- Updated
- 2026-11-02
OSV
7.1
gnark vulnerable to unsoundness in variable comparison/non-unique binary decomposition
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.
- Record
CVE-2023-44378- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N - Weakness
- CWE-191, CWE-697
- Updated
- 2026-11-02
OSVGHSA-498w-5j49-vqjg
5.5
gnark unsoundness in variable comparison / non-unique binary decomposition
Impact
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.
Internally, the comparison methods frontend.API.Cmp and frontend.API.IsLess used binary decomposition and checked the bitwise differences. This allows a malicious prover to construct a valid proof for a statement a < b even if a > b.
The issue impacts all users using API.Cmp or API.IsLess methods. Additionally, it impacts the users using bits.ToBinary or API.ToBinary methods if full-width decomposition is requested (the default behaviour if no options are given).
The issues does not impact comparison methods in field emulation (package std/math/emulated) and dedicated comparison package (std/math/cmp).
Patches
Fix has been implemented in pull request #835 and merged in commit 59a4087261a6c73f13e80d695c17b398c3d0934f to master branch. The release v0.9.0 and onwards include the fix.
The fix added additional comparison of the decomposed bit-vector to the modulus of the in-circuit values.
Workarounds
Upgrading to version v0.9.0 should fix the issue without needing to change the calls to value comparison methods.
Alternatively, users can use the std/math/cmp gadget, which additionally 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.
References
- https://github.com/Consensys/gnark/pull/835
- https://github.com/zkopru-network/zkopru/issues/116
- https://github.com/iden3/circomlib/pull/48
Acknowledgement
The vulnerability was reported by Marcin Kostrzewa @ Reilabs.
- Record
GHSA-498w-5j49-vqjg- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-191, CWE-697
- Updated
- 2026-11-02
OSVGO-2023-2098 No score
Unsoundness in variable comparison / non-unique binary decomposition in github.com/consensys/gnark
Unsoundness in variable comparison / non-unique binary decomposition in github.com/consensys/gnark
- Record
GO-2023-2098- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/consensys/gnarkGo |
before 0.9.0 | 0.9.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-44378 is a high vulnerability (CVSS 7.1) in Consensys Gnark, published October 4, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.23%, the 14th percentile. Fixed in github.com/consensys/gnark 0.9.0.
References
github.com/Consensys/gnark/security/advisories/GHSA-498w-5j49-vqjg
github.com/zkopru-network/zkopru/issues/116
github.com/Consensys/gnark/commit/59a4087261a6c73f13e80d695c17b398c3d0934f
github.com/Consensys/gnark/pull/835
nvd.nist.gov/vuln/detail/CVE-2023-44378
github.com/advisories/GHSA-498w-5j49-vqjg
github.com/CVEProject/cvelistV5/tree/main/cves/2023/44xxx/CVE-2023-44378.json
github.com/Consensys/gnark