Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-fr8m-434r-g3xp
No affected components available
Impact
During deserialization of ECDSA and EdDSA signatures gnark-crypto did not check that the values are in the range [1, n-1] with n being the corresponding modulus (either base field modulus in case of R in EdDSA, and scalar field modulus in case of s,r in ECDSA and s in EdDSA). As this also allowed zero inputs, then it was possible to craft a signature which lead to null pointer dereference, leading to denial-of-service of an application. This also enabled weak signature malleability when the users assumed uniqueness of the serialized signatures (but not the underlying modulo reduced values).
We are not aware of any users impacted by the bug. The implemented signature schemes in gnark-crypto complement the in-circuit versions in gnark, allowing to have end-to-end tests.
Patches
The issue was patched in PR #449. The fix returns an error during deserialization if the values do not belong to the ranges [1, n-1].
The fix is included in release v0.12.0 and upwards.
Workarounds
Users can manually validate the inputs to be in corresponding ranges when using serialized signatures (or digests of them) as unique keys.
To address the denial-of-service, the users can install hook to recover panics and recover
Resources
- Verichains advisory for signature malleability.
- Fix https://github.com/Consensys/gnark-crypto/pull/449
- Go blog post "Defer, Panic, and Recover"
- gnark v0.12.0
Acknowledgement
Lack of range checks leading to signature malleability was reported by Verichains.
The vulnerability requires local access to the device to be exploited. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability. The impact is confined to the system where the vulnerability exists. There is a low impact on the integrity of the data. There is a low impact on the availability of the system.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard