activateProposal()
need time delay
#273
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2022-08-olympus/blob/b5e139d732eb4c07102f149fb9426d356af617aa/src/policies/Governance.sol#L205-L262
Vulnerability details
activateProposal()
need time delayImpact
There is no time lock or delay when activating a proposal, the previous one could be replaced immediately. In
vote()
call, a user might want to vote for the previous proposal, but if thevote()
call and theactivateProposal()
is very close or even in the same block, it is quite possible that the user actually voted for another proposal without much knowledge of. A worse case is some malicious user watching the mempool, and front run a big vote favor/against theactiveProposal
, effectively influence the voting result.These situations are not what the governance intends to deliver, and might also affect the results of 2 proposals.
Proof of Concept
activateProposal()
can take effect right away, replacing theactiveProposal
. Andvote()
does not specify whichproposalId
to vote for, but theactiveProposal
could be different from last second.src/policies/Governance.sol
Tools Used
Manual analysis.
Recommended Mitigation Steps
Add time delay when activating a proposal, so that users can be aware of that and vote for the current one within the time window.
The text was updated successfully, but these errors were encountered: