Read the docs
TI-2023-30842 Aliases GHSA-rjjm-x32p-m3f7

gnark's range checker gadget allows wider inputs up to word alignment

Priority LOW 38Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

### Impact gnark provides a gadget in the standard library to allow optimized checking of the bitwidth of the inputs. The gadget works by constructing a fixed lookup table containing all valid entries, partitioning the input and checking that all parts are inside the lookup table. The range checker gadget did not take into account that the highest partition may be less than the width limit, allowing the inputs to be up to 16 bits wider than checked. Range checking gadget is extensively used in field emulation. Users using any dependant gadget (ECDSA verification, proof recursion etc.) is impacted. We consider the impact of the vulnerability being low as the number of attacker-modifiable bits is significantly smaller compared to the bit-width of scalar field modulus and it won't be possible to construct inputs which would allow to overflow the scalar field. ### Patches The issue has been patched in the stable branch of gnark. Due to low severity of the issue no emergency release will be issued and we follow the existing release plan. Versions v0.9.2 and higher are patched. ### Workarounds We consider the issue very hard to exploit and do not recommend manual remediation. However, it is possible to perform manual bit decomposition using `std/math/bits` gadget. ### References Initial issue https://github.com/Consensys/gnark/issues/897 ### Acknowledgement The issue was reported by [@ultrainstinct30](https://github.com/ultrainstinct30).

Why it matters now

Fix Fixed github.com/consensys/gnark (Go): 0.9.2

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—github.com/consensys/gnark (Go)before 0.9.20.9.2Patch availableGHSA-rjjm-x32p-m3f7
  • github.com/consensys/gnark (Go) Vendor— Affected before 0.9.2 Fixed in 0.9.2 Patch available GHSA-rjjm-x32p-m3f7

Remediation

  • Fix · GHSA-rjjm-x32p-m3f7 github.com/consensys/gnark (Go) Fixed in 0.9.2 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-rjjm-x32p-m3f7

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences