Closed c4-bot-10 closed 8 months ago
Picodes marked the issue as primary issue
othernet-global (sponsor) disputed
Executing approved ballots in arbitrary order is acceptable.
Picodes changed the severity to QA (Quality Assurance)
Downgrading to Low as although this could be a pain in practice and increase delays to execute complex operations this is of Low severity to me
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L385-L400 https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/DAO.sol#L278-L291
Vulnerability details
Impact
While DAO.finalizeBallot is called to finalized a ballot, it just check if the ballot meet some criterion, it doesn't contain any information about predecessor or dependency. In such case, two ballots might be finalized in reversed order to achieve different goals.
Proof of Concept
In Proposals.canFinalizeBallot, the funciton only checks if
ballot.ballotIsLive
, theminimum duration
, andrequired quorum has been reached
Supposed in a case for configuration
cfg_X
updating, the range forcfg_X
is 0<=cfg_X<=5, and current cfg_X is 5, ballot_m is proposed to decrease cfg_X to 4, and after sometime, there is another ballot_n to increase cfg_X to 5 again. Both of the proposal have met the requirement in functioncanFinalizeBallot
, but haven't been finalized yet:Tools Used
VS
Recommended Mitigation Steps
Assessed type
Other