GHSA-pffg-92cg-xf5c
gnark-crypto's exponentiation in the pairing target group GT using GLV can give incorrect results
Impact
When the exponent is bigger than r, the group order of the pairing target group GT, the exponentiation à la GLV (ExpGLV) can sometimes give incorrect results compared to normal exponentiation (Exp).
The issue impacts all users using ExpGLV for exponentiations in GT. This does not impact Exp and ExpCyclotomic which are sound. Also note that GLV methods in G1 and G2 are sound and not impacted.
Patches
Fix has been implemented in pull request https://github.com/Consensys/gnark-crypto/pull/451 and merged in commit https://github.com/Consensys/gnark-crypto/commit/ec6be1a037f7c496d595c541a8a8d31c47bcfa3d to master branch.
The fix increased the bounds of the sub-scalars by 1. In fact, since https://github.com/Consensys/gnark-crypto/pull/213, we use a fast scalar decomposition that tradeoffs divisions (needed in the Babai rounding) by right-shifts. We precompute b=2^m*v/d (m > log2(d)) and then at runtime compute scalar*b/2^m (v is a lattice vector and d the lattice determinant). This increases the bounds on sub-scalars by 1 which we check at runtime before increasing the loop size (we don't target constant-timeness). m is chosen to be a machine word twice big than log2(d) so that we rarely need to increase the loop size. Hence why the issue happens only sometimes if we omit to increase the bounds. This bounds increase was implemented in G1 and G2 but forgot in GT.
Workarounds
Updating to v0.12.1+. Alternatively, use Exp or ExpCyclotomic instead. We are not aware of any users using ExpGLV anyway.
References
- Fix PR: https://github.com/Consensys/gnark-crypto/pull/451
- Fast scalar decomposition PR: https://github.com/Consensys/gnark-crypto/pull/213
- https://eprint.iacr.org/2015/565 Sec.4.2
Acknowledgement
The vulnerability was reported by Antonio Sanso @ EF.
What each source reports
GitHub AdvisoriesNo score
gnark-crypto's exponentiation in the pairing target group GT using GLV can give incorrect results
Impact
When the exponent is bigger than r, the group order of the pairing target group GT, the exponentiation à la GLV (ExpGLV) can sometimes give incorrect results compared to normal exponentiation (Exp).
The issue impacts all users using ExpGLV for exponentiations in GT. This does not impact Exp and ExpCyclotomic which are sound. Also note that GLV methods in G1 and G2 are sound and not impacted.
Patches
Fix has been implemented in pull request https://github.com/Consensys/gnark-crypto/pull/451 and merged in commit https://github.com/Consensys/gnark-crypto/commit/ec6be1a037f7c496d595c541a8a8d31c47bcfa3d to master branch.
The fix increased the bounds of the sub-scalars by 1. In fact, since https://github.com/Consensys/gnark-crypto/pull/213, we use a fast scalar decomposition that tradeoffs divisions (needed in the Babai rounding) by right-shifts. We precompute b=2^m*v/d (m > log2(d)) and then at runtime compute scalar*b/2^m (v is a lattice vector and d the lattice determinant). This increases the bounds on sub-scalars by 1 which we check at runtime before increasing the loop size (we don't target constant-timeness). m is chosen to be a machine word twice big than log2(d) so that we rarely need to increase the loop size. Hence why the issue happens only sometimes if we omit to increase the bounds. This bounds increase was implemented in G1 and G2 but forgot in GT.
Workarounds
Updating to v0.12.1+. Alternatively, use Exp or ExpCyclotomic instead. We are not aware of any users using ExpGLV anyway.
References
- Fix PR: https://github.com/Consensys/gnark-crypto/pull/451
- Fast scalar decomposition PR: https://github.com/Consensys/gnark-crypto/pull/213
- https://eprint.iacr.org/2015/565 Sec.4.2
Acknowledgement
The vulnerability was reported by Antonio Sanso @ EF.
- Record
GHSA-pffg-92cg-xf5c- Updated
- 2026-11-02
OSVNo score
gnark-crypto's exponentiation in the pairing target group GT using GLV can give incorrect results
Impact
When the exponent is bigger than r, the group order of the pairing target group GT, the exponentiation à la GLV (ExpGLV) can sometimes give incorrect results compared to normal exponentiation (Exp).
The issue impacts all users using ExpGLV for exponentiations in GT. This does not impact Exp and ExpCyclotomic which are sound. Also note that GLV methods in G1 and G2 are sound and not impacted.
Patches
Fix has been implemented in pull request https://github.com/Consensys/gnark-crypto/pull/451 and merged in commit https://github.com/Consensys/gnark-crypto/commit/ec6be1a037f7c496d595c541a8a8d31c47bcfa3d to master branch.
The fix increased the bounds of the sub-scalars by 1. In fact, since https://github.com/Consensys/gnark-crypto/pull/213, we use a fast scalar decomposition that tradeoffs divisions (needed in the Babai rounding) by right-shifts. We precompute b=2^m*v/d (m > log2(d)) and then at runtime compute scalar*b/2^m (v is a lattice vector and d the lattice determinant). This increases the bounds on sub-scalars by 1 which we check at runtime before increasing the loop size (we don't target constant-timeness). m is chosen to be a machine word twice big than log2(d) so that we rarely need to increase the loop size. Hence why the issue happens only sometimes if we omit to increase the bounds. This bounds increase was implemented in G1 and G2 but forgot in GT.
Workarounds
Updating to v0.12.1+. Alternatively, use Exp or ExpCyclotomic instead. We are not aware of any users using ExpGLV anyway.
References
- Fix PR: https://github.com/Consensys/gnark-crypto/pull/451
- Fast scalar decomposition PR: https://github.com/Consensys/gnark-crypto/pull/213
- https://eprint.iacr.org/2015/565 Sec.4.2
Acknowledgement
The vulnerability was reported by Antonio Sanso @ EF.
- Record
GHSA-pffg-92cg-xf5c- Updated
- 2026-11-02
OSVGO-2023-2101No score
Incorrect exponentiation results in github.com/consensys/gnark-crypto
Incorrect exponentiation results in github.com/consensys/gnark-crypto
- Record
GO-2023-2101- Updated
- 2026-11-02
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/consensys/gnark-cryptoGo | through 0.12.0 | 0.12.1 |
github.com/consensys/gnark-cryptoGo | before 0.12.1 | 0.12.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | GitHub Advisories, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
GHSA-pffg-92cg-xf5c is a vulnerability with no CVSS score yet in github.com/consensys/gnark-crypto, published October 5, 2023. No source lists public exploit code. Fixed in github.com/consensys/gnark-crypto 0.12.1.
References
github.com/Consensys/gnark-crypto/security/advisories/GHSA-pffg-92cg-xf5c
github.com/Consensys/gnark-crypto/pull/213
github.com/Consensys/gnark-crypto/pull/451
github.com/Consensys/gnark-crypto/commit/ec6be1a037f7c496d595c541a8a8d31c47bcfa3d
eprint.iacr.org/2015/565
github.com/advisories/GHSA-pffg-92cg-xf5c
github.com/Consensys/gnark-crypto