The claim()
function of Staking.sol
can be reentered. The claimable[msg.sender]
is set to 0, after claimable[msg.sender]
is transferred to msg.sender
which clearly violets the CEI pattern as the state change happens after an external call. Basically an malicious user can have a fallback()
through which he can reenter in the claim()
function until all the WETH
token amount is drained from the contract.
Anyone having certain claimable[msg.sender]
amount can reenter into claim()
and drain Staking
contract to lose all of it's WETH
token amount.
Manual Analysis
Make the state changes before external call. Change:
To:
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.