Use of Insufficiently Random Values Affecting github.com/consensys/gnark package, versions <0.9.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Use of Insufficiently Random Values vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMCONSENSYSGNARK-6003640
  • published18 Oct 2023
  • disclosed17 Oct 2023
  • credit0xmp, InaOana, Anton Livaja

Introduced: 17 Oct 2023

CVE NOT AVAILABLE CWE-330  (opens in a new tab)

How to fix?

Upgrade github.com/consensys/gnark to version 0.9.1 or higher.

Overview

github.com/consensys/gnark is a gnark is a fast zk-SNARK library that offers a high-level API to design circuits.

Affected versions of this package are vulnerable to Use of Insufficiently Random Values via the PlonkVerifier smart contract. An attacker can derive a valid proof from a valid initial tuple {proof, public_inputs}, corresponding to the same public inputs as the initial proof by exploiting the randomness generated using a small part of the scratch memory describing the state.

Workaround

This vulnerability can be mitigated by ensuring the variable random in the function batch_verify_multi_points depends on state_folded_digests_x, state_folded_digests_y, proof_grand_product_commitment_x, proof_grand_product_commitment_y and state_zeta (by hashing those values for instance).

References

CVSS Scores

version 3.1