CVE-2023-44378

CVE-2023-44378 is a medium-severity security vulnerability in github.com/consensys/gnark (go), affecting versions < 0.9.0. It is fixed in 0.9.0.

Summary

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

Acknowledgement

The vulnerability was reported by Marcin Kostrzewa @ Reilabs.

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).

CVE-2023-44378 has a CVSS score of 5.5 (Medium). The vector is requires local access, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.9.0); upgrading removes the vulnerable code path.

Affected versions

github.com/consensys/gnark (< 0.9.0)

Security releases

github.com/consensys/gnark → 0.9.0 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

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.

Frequently Asked Questions

  1. What is CVE-2023-44378? CVE-2023-44378 is a medium-severity security vulnerability in github.com/consensys/gnark (go), affecting versions < 0.9.0. It is fixed in 0.9.0.
  2. How severe is CVE-2023-44378? CVE-2023-44378 has a CVSS score of 5.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/consensys/gnark are affected by CVE-2023-44378? github.com/consensys/gnark (go) versions < 0.9.0 is affected.
  4. Is there a fix for CVE-2023-44378? Yes. CVE-2023-44378 is fixed in 0.9.0. Upgrade to this version or later.
  5. Is CVE-2023-44378 exploitable, and should I be worried? Whether CVE-2023-44378 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2023-44378 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2023-44378? Upgrade github.com/consensys/gnark to 0.9.0 or later.

Other vulnerabilities in github.com/consensys/gnark

CVE-2025-57801CVE-2024-50354CVE-2024-45039CVE-2024-45040CVE-2023-44378

Stop the waste.
Protect your environment with Kodem.