Reentrancy in ChoosingRam.sol::increaseValuesOfParticipants
means you only have to win once to become ram instead of 5 times.
You can create a contract that enters and calls ChoosingRam.sol::increaseValuesOfParticipants
and then checks whether it won. If it did win, it calls the same function again 4 times in the same transaction. If it didn't win, it waits for a different combination of block.timestamp and block.prevrandao and tries again.
Proof of Code:
Hack contract:
Test to run in Dussehra.t.sol:
Because of this, you only need to win one 50/50 battle vs a challenger, instead of 5. This means a user that uses this can greatly increase their odds of becoming ram. However, no funds are at risk as a user that attains ram through this method is unable to withdraw due to another bug. This merely makes the event less fair for users that don't use this.
Manual review
Use a reentrancy guard such as openzeppelins reentrancyGaurd. https://docs.openzeppelin.com/contracts/4.x/api/security#ReentrancyGuard. This will prevent users from calling the function multiple times in the same transaction.
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.