A voter is able to vote for the same candidate in multiple rounds, leading to a Denial of Service (DoS) attack when the selectPresident
function is called.
The vulnerability lies in L108-L22 of the contract.
Because users can input arbitrary addresses to be saved in s_rankings
(L172), duplicate addresses can be used. This results in inefficient computation that would raise the gas required to execute the selectPresident
function, resulting in a DoS attack.
This would raise the gas required to execute the selectPresident
function. In the worst case, it would cause a DoS due to inefficient computation.
Foundry, manual review
Check and eliminate duplicate addresses in the _rankCandidates
function before saving it to s_rankings
.
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.