github.com/consensys/gnark-crypto · Gnark crypto: gnark-crypto allows unchecked memory allocation during vector deserialization
Affects github.com/consensys/gnark-cryptoSource GCVE Database
CVSS 7.5 High : upgrade to 0.18.1 soon.
Data as of 4 Nov 2026, 18:24 UTC
- Patch
- Available – fixed in 0.18.1, 0.19.2
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HWhat to do
Upgrade github.com/consensys/gnark-crypto to 0.18.1; github.com/consensys/gnark-crypto to 0.19.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Gogithub.com/consensys/gnark-crypto | Affected
| Fixed in
|
| Gogithub.com/consensys/gnark-crypto | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available and has been applied in gnark-crypto versions 0.18.1 and 0.19.2. Users should upgrade to these or later versions to remediate the vulnerability. As a workaround, users can manually inspect the first 4 bytes of the serialized data to validate the length field before deserialization to prevent large memory allocations.
Description
A critical vulnerability in the gnark-crypto library's Vector.ReadFrom() function allows an attacker to cause unchecked memory allocation by providing a maliciously crafted input. This leads to an out-of-memory crash and denial of service due to allocation attempts of up to approximately 128 GB of memory. The root cause is the lack of validation on a 4-byte length field read from untrusted input during vector deserialization. The issue is patched in versions 0.18.1 and 0.19.2 of gnark-crypto.
References
- github.com/Consensys/gnark-crypto/security/advisories/GHSA-fj2x-735w-74vq (opens in a new tab)
- github.com/Consensys/gnark-crypto/pull/759 (opens in a new tab)
- github.com/Consensys/gnark-crypto/commit/2e7bf9190a0aac896eeec3876c87c77a35661be7 (opens in a new tab)
- github.com/Consensys/gnark-crypto (opens in a new tab)
- pkg.go.dev/vuln/GO-2025-4087 (opens in a new tab)