In SecurityCouncilMemberElectionGovernorCountingUpgradeable.sol we have _countVote() function. This function registers a vote by some account for a nominee. It is more important to see the following code from this function:
If blockNumber is equal to startBlock, the function will return 0, which implies that the votes have zero weight at the exact moment when the voting starts. But this is also the block in which voting begins.
Because of this, it is impossible to vote right after voting starts.
Proof of Concept
Check this POC which proves that if someone votes right after voting starts will return zero because the function will think voting has not started.
Lines of code
https://github.com/arbitrumfoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/governors/modules/SecurityCouncilMemberElectionGovernorCountingUpgradeable.sol#L115-L118 https://github.com/arbitrumfoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/governors/modules/SecurityCouncilMemberElectionGovernorCountingUpgradeable.sol#L231-L234
Vulnerability details
Impact
In
SecurityCouncilMemberElectionGovernorCountingUpgradeable.sol
we have_countVote
() function. This function registers a vote by some account for a nominee. It is more important to see the following code from this function:We call the function
votesToWeight()
and ifweight
is zero the function revert.votesToWeight
returns the weight of a vote for a given proposal. Check the following code block:If
blockNumber
is equal tostartBlock
, the function will return 0, which implies that the votes have zero weight at the exact moment when the voting starts. But this is also the block in which voting begins. Because of this, it is impossible to vote right after voting starts.Proof of Concept
Check this POC which proves that if someone votes right after voting starts will return zero because the function will think voting has not started.
Tools Used
Visual Studio Code
Recommended Mitigation Steps
Change:
To:
Assessed type
Timing