CVE-2023-44273
Go vulnerability
### 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](https://github.com/advisories/GHSA-9xfq-8j3r-xp5g) for signature malleability. * Fix https://github.com/Consensys/gnark-crypto/pull/449 * [Go blog post "Defer, Panic, and Recover"](https://go.dev/blog/defer-panic-and-recover) * [gnark v0.12.0](https://github.com/Consensys/gnark-crypto/releases/tag/v0.12.0) ### Acknowledgement Lack of range checks leading to signature malleability was reported by [Verichains](https://www.verichains.io/).
Affected products
Go. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Go runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Set the orderSystems that can be reached from the internet come first, then the rest.
References
- github.com/Consensys/gnark-crypto/security/advisories/GHSA-fr8m-434r-g3xp
- github.com/Consensys/gnark-crypto/pull/449
- github.com/Consensys/gnark-crypto/releases/tag/v0.12.0
- go.dev/blog/defer-panic-and-recover
- nvd.nist.gov/vuln/detail/CVE-2023-44273
- github.com/advisories/GHSA-fr8m-434r-g3xp
- github.com/Consensys/gnark-crypto/releases
- verichains.io
- nvd.nist.gov/vuln/detail/CVE-2023-44273
- cve.org/CVERecord?id=CVE-2023-44273
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.