Missing checks and no re-entrancy prevention allow untrusted contracts to call claimRewards()
. This could be used by an attacker to drain the reward.
A staker can turn malicious by creating a custom contract that will call the claimRewards()
. The attacker is free to do as he pleases within this function as it is an external contract callable by anyone.
There are no reentrancy guards in the LiquidationPool
contract and thus a malicious custom contract could call back into the claimRewards
by taking advanatge of lower level call on L#172.
The malicious call can be used to drain a major or whole part of the reward.
If there been re-entrancy protection placed, the attacker contract would not be able to call back into the contract as it will severely limit his abilities to do so.
Manual Code Review
Add Openzeppelin’s ReentrancyGuardUpgradeable
re-entrancy guard modifier nonReentrant
to all external functions that are callable by anyone specifically, to the claimRewards
method.
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.