CVE-2024-50354 Out-of-memory during deserialization with crafted inputs

Medium 5.5 Published Updated

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.

PackageAffectedFixed in
github.com/consensys/gnark GoAll versions0.11.1
github.com/consensys/gnark GoAll versions0.11.1
github.com/consensys/gnark GoAll versions0.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.

Sources

Also known as GHSA-cph5-3pgr-c82g, GO-2024-3244.

Is CVE-2024-50354 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free