The RankedChoice smart contract does not have a mechanism to validate or handle cases where a voter submits an empty ranking (an empty array of candidates). This lack of validation can lead to inconsistencies in the election process, allowing voters to bypass the ranking mechanism and potentially exploit the system. Implementing checks for empty ranks is necessary to ensure the integrity and fairness of the election.
In the current implementation, voters can submit their rankings of candidates using the rankCandidates or rankCandidatesBySig functions. However, the contract does not include any validation to ensure that the submitted rankings contain at least one candidate. If a voter submits an empty array, the contract does not prevent or handle this situation, which introduces vulnerabilities into the voting process.
Here, orderedCandidates can be an empty array, as no checks are performed to validate its contents.
Submitting empty ranks would lead to votes being registered without any actual candidate selection. This can skew election outcomes, as the system would count the voter's participation but without any meaningful vote contribution. Also allowing empty ranks may result in inconsistencies when tallying votes. The lack of ranked candidates could affect the overall distribution of votes, particularly in smaller elections where a few voters can have a significant impact on the results.
Malicious voters could submit empty ranks as a strategy to disrupt the election process or reduce the number of valid votes, creating an advantage for other candidates.
Manual Review
Introduce validation to ensure that the orderedCandidates array contains at least one candidate. If an empty array is submitted, the contract should revert the transaction with an error, such as RankedChoice__InvalidInput.
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.