Submitted by 0xAlix2
When an Oracle update is required, validators cast votes for the change. An UpdateOracle message is then sent from one of the bridge executors. This message invokes the ApplyOracleUpdate function, which calls UpdateOracle. In this function, the incoming votes are validated, and if deemed valid, the Oracle prices are updated.
The main vote validation occurs in the ValidateVoteExtensions function, which performs three critical steps:
https://github.com/initia-labs/OPinit/blob/7da22a78f367cb25960ed9c536500c2754bd5d06/x/opchild/l2connect/utils.go#L20-L124
As shown above, it just loops over the votes and adds the voting power of each entry, without validating if that validator is a duplicate entry.
This allows a malicious validator to solely change the oracle prices without the need of other validators votes.
Refactor ValidateVoteExtensions to throw an error if a duplicate validator is encountered.
beer-1 (Initia) confirmed and commented:
a_kalout (warden) commented:
LSDan (judge) commented:
