Description: The rankCandidatesBySig function allows users to submit an array of candidate addresses without any explicit limitation on the size of this input. This could potentially lead to excessively large inputs, which can result in high gas consumption and even denial of service if the transaction runs out of gas.
Impact:
Excessive Gas Costs: Large inputs can lead to high gas costs, making transactions expensive for users.
Denial of Service (DoS): If the input size is too large, it could cause the transaction to run out of gas, preventing the function from executing successfully and potentially disrupting the voting process.
Proof of Concept: The function currently does not impose a size limit on orderedCandidates:
Recommended Mitigation:
Implement Input Size Checks: Enforce a maximum size for the orderedCandidates array to prevent excessively large inputs.
Validate Input Length: Ensure that the length of the input array is within reasonable bounds before processing it.
Optimize Gas Usage: Consider optimizing the function to handle inputs more efficiently, reducing the risk of running out of gas.
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.