In the s_rankings[voter][s_voteNumber] = orderedCandidates; logic, the contract allows a user to call the rankCandidates or rankCandidatesBySig functions multiple times within the same election (same s_voteNumber), thus the voter can overwrite their previous vote.
Overwriting the vote could lead to users initially vote honestly and then change their vote once they gain more information about how others are voting or continuously vote and modify their vote based on the progression of the election, gaining an unfair advantage. Combined with the possibility for passing same candidate address multiple times in their ranked list, part of another vulnerability would give disproportionate weight to their chosen candidate.
Paste the following in the existing test suite:
Manual review, Foundry
Enforce a strict one-vote-per-voter policy by adding a check before allowing any rankings to be recorded. For off-chain signatures (rankCandidatesBySig), ensure the vote includes a nonce tied to the current election. This prevents the signature from being reused across different elections.
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.