TokenManager::withdraw
function is meant for users to withdraw claimable tokens. But since user's claimable amount is never reset to 0, malicious user can endlessly withdraw funds from CapitalPool
TokenManager::withdraw
function is meant to withdraw the whole user's claimable amount and reset it to 0.
But inside the withdraw
function, claimableAmount
is never reset to 0, which opens up an opportunity for malicious user to drain the CapitalPool smart contract
Malicious user can drain the whole protocol.
Manual review
Reset the user's claimable amount to 0 after the transfer is done, this will prevent a malicious user to drain the CapitalPool.
Valid critical severity finding, the lack of clearance of the `userTokenBalanceMap` mapping allows complete draining of the CapitalPool contract. Note: This would require the approval issues highlighted in other issues to be fixed first (i.e. wrong approval address within `_transfer` and lack of approvals within `_safe_transfer_from` during ERC20 withdrawals)
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.