CVE-2024-50354 Out-of-memory during deserialization with crafted inputs
Attackers can cause a denial of service by triggering out-of-memory errors during the deserialization of crafted Groth16 verification keys in the gnark library.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-50354?
CVE-2024-50354 is a medium-severity denial of service vulnerability in Consensys gnark, published on 31 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
gnark is a fast zk-SNARK library that offers a high-level API to design circuits. In gnark 0.11.0 and earlier, deserialization of Groth16 verification keys allocate excessive memory, consuming a lot of resources and triggering a crash with the error fatal error: runtime: out of memory.
Weakness: CWE-400
Which versions are affected by CVE-2024-50354?
3 open source packages ship an affected version, including github.com/consensys/gnark. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/consensys/gnark Go | All versions | 0.11.1 |
github.com/consensys/gnark Go | All versions | 0.11.1 |
github.com/consensys/gnark Go | All versions | 0.12.0 |
Products include Consensys Gnark.
How do I fix CVE-2024-50354?
Upgrade github.com/consensys/gnark to a fixed version for your release line: 0.11.1 or 0.12.0.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2024-50354 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-50354 exists.
Other vulnerabilities in Consensys gnark
- CVE-2025-57801 gnark is vulnerable to signature malleability in EdDSA and ECDSA due to missing scalar checks
- CVE-2025-58157 gnark affected by denial of service when computing scalar multiplication using fake-GLV algorithm
- CVE-2023-44378 gnark vulnerable to unsoundness in variable comparison/non-unique binary decomposition
Sources
Also known as GHSA-cph5-3pgr-c82g, GO-2024-3244.