Platform: Code4rena
Start Date: 03/05/2022
Pot Size: $75,000 USDC
Total HM: 6
Participants: 55
Period: 7 days
Judge: Albert Chon
Total Solo HM: 2
Id: 116
League: COSMOS
Rank: 25/55
Findings: 2
Award: $243.57
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1337, 0x1f8b, 0xDjango, 0xkatana, AmitN, CertoraInc, Dravee, Funen, GermanKuber, GimelSec, Hawkeye, JC, MaratCerby, WatchPug, Waze, broccolirob, cccz, ch13fd357r0y3r, cryptphi, danb, defsec, delfin454000, dipp, dirk_y, ellahi, gzeon, hake, hubble, ilan, jah, jayjonah8, kebabsec, kirk-baird, m9800, orion, oyc_109, robee, shenwilly, simon135, sorrynotsorry
113.7803 USDC - $113.78
https://github.com/code-423n4/2022-05-cudos/blob/de39cf3cd1f1e1cf211819b06d4acf6a043acda0/solidity/contracts/Gravity.sol#L185 https://github.com/code-423n4/2022-05-cudos/blob/de39cf3cd1f1e1cf211819b06d4acf6a043acda0/solidity/contracts/Gravity.sol#L238-L240
It's possible to bypass verifySig
and checkValidatorSignatures
methods using empty signers.
The method ecrecover
returns address(0)
when the signature is wrong, so if a user use address(0)
as a validator or _signer
the return will be true.
_signer == ecrecover(messageDigest, _v, _r, _s);
Also, the method checkValidatorSignatures never check that the validator is repeated inside the array, so if someone it's able to specify the validators, and it's able to sign with one valid key, if he repeat the same signature multiple times, it will be computed as a different one.
check that _signer
is not empty.
#0 - maptuhec
2022-05-11T12:50:34Z
Duplicate of #127
🌟 Selected for report: GermanKuber
Also found by: 0v3rf10w, 0x1f8b, 0xDjango, 0xNazgul, 0xf15ers, 0xkatana, AlleyCat, CertoraInc, Dravee, Funen, GimelSec, IllIllI, JC, MaratCerby, WatchPug, Waze, defsec, delfin454000, ellahi, gzeon, hake, hansfriese, ilan, jonatascm, nahnah, oyc_109, peritoflores, rfa, robee, simon135, slywaters, sorrynotsorry
129.7885 USDC - $129.79
MAX_UINT
and use constant
or inline.require
messages bigger than 32 bytes. More than 32 bytes for message will incur an extra gas costs.i++
to ++i
in order to save some opcodes: