Skip to main content
VulnerabilityPublished Updated

github.com/consensys/gnark-crypto · Gnark crypto: gnark-crypto allows unchecked memory allocation during vector deserialization

Affects github.com/consensys/gnark-cryptoSource GCVE Database

0

CVSS 7.5 High : upgrade to 0.18.1 soon.

Data as of 4 Nov 2026, 18:24 UTC

CVSS 3.1 base score
7.5High
How severe the flaw is on the 0–10 CVSS scale.
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:H

What to do

Upgrade github.com/consensys/gnark-crypto to 0.18.1; github.com/consensys/gnark-crypto to 0.19.2.

Affected software

ProductAffectedFixed in
Gogithub.com/consensys/gnark-cryptoAffected
  • >=0.9.1 <0.18.1
Fixed in
  • 0.18.1
Gogithub.com/consensys/gnark-cryptoAffected
  • >=0.19.0 <0.19.2
  • =0.19.0
Fixed in
  • 0.19.2

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

Community reviews

Loading reviews…