The contract is susceptible to a gas exhaustion vulnerability due to the potential for a large loop iteration in the _distributeRewards
function, where rewards are distributed to voters. This could be exploited by an attacker deploying multiple contracts with an extensive list of voters, leading to increased gas consumption during the reward distribution process.
An attacker could intentionally create a large number of voters, causing the loop in the _distributeRewards
function to iterate a significant number of times. As a result, the contract may run out of gas, leading to a failed transaction or a denial of service (DoS) attack.
Manual
Consider using a withdrawal pattern to mitigate the gas exhaustion vulnerability. Instead of distributing rewards in a single large loop, allow voters to claim their rewards individually. Like here, modification to the _distributeRewards
function:
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.