code-423n4 / 2021-08-gravitybridge-findings

1 stars 0 forks source link

powers in a decreasing order #27

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

Function makeCheckpoint expects that powers in ValsetArgs are in decreasing order: However, it seems that this is not enforced anywhere in the code and is left for the caller's responsibility. // The validator powers must be decreasing or equal. This is important for checking the signatures on the // next valset, since it allows the caller to stop verifying signatures once a quorum of signatures have been verified. function makeCheckpoint(

Recommended Mitigation Steps

This can be enforced in the smart contract when setting or updating valset by checking that the current power is less or equal than the previous one.

jkilpatr commented 2 years ago

I would classify this as an optimization. Decreasing order is a nice optimization but it's totally optional to actually use, enforcing it is another error case that's not really needed.

loudoguno commented 2 years ago

reopening as per judges assessment as "primary issue" on findings sheet