The _rankCandidates
function does not validate whether the voter has already cast their vote, allowing voters to overwrite their previous votes and potentially manipulate the outcome of the election.
The vulnerability lies in the lack of a validation check to prevent voters from submitting multiple votes in the same voting round. The current implementation overwrites the voter's previous vote every time the rankCandidates
or rankCandidatesBySig
function is called. This allows any voter to change their vote as many times as they want, potentially skewing the election results.
Test:
Test result:
Election Manipulation
: Voters can strategically alter their votes after observing other votes, gaining an unfair advantage in influencing the outcome.
Inconsistent Election Results
: Voters may change their votes close to the end of the voting period, leading to confusion and inconsistent election results.
Manual Review
Foundry (for testing)
Implement a check in the _rankCandidates
function to ensure that voters can only vote once per voting round.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.