Closed c4-bot-6 closed 8 months ago
Picodes marked the issue as duplicate of #100
Picodes marked the issue as selected for report
Picodes marked the issue as satisfactory
Picodes changed the severity to QA (Quality Assurance)
Downgrading to Low as it may be a design choice: the ballot has passed the completion timestamp so can be finalized but has not been finalized yet so voting is still open
othernet-global (sponsor) disputed
Voting reverts after the ballot has been finalized.
The authorizeWallet call in vote requires that claiming is not allowed (which it is on ballot finalization): require( ! claimingAllowed, "Cannot authorize after claiming is allowed" );
Picodes marked the issue as not selected for report
Picodes marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/main/src/launch/BootstrapBallot.sol#L48-L65
Vulnerability details
Impact
Users can vote and get airdrop qualification even after the completion of the ballot, as long as the ballot has not been finalized.
Proof of Concept
An eligible user can vote on whether or not to start up the exchange by calling
BootstrapBallot#vote()
, then the voter will be authorized to receive the airdrop.Once the ballot completed, any one can call
BootstrapBallot#finalizeBallot()
to finalize the ballot. The exchange will be actived if YES votes is greater than NO votes.However, a voter can still cast their vote even after the completion of the ballot, as long as the ballot has not been finalized. Besides the voter is authorized to receive the airdrop, the voting result might be altered due to the inclusion of new votes.
Copy below codes to BootstrapBallot.t.sol and run
COVERAGE="yes" NETWORK="sep" forge test -vv --rpc-url RPC_URL --match-test test_voteAfterCompletion
Tools Used
Manual review
Recommended Mitigation Steps
Make sure no one can cast vote after
completionTimestamp
:Assessed type
Error