Users can drain the protocol balance via the TokenManager.withdraw
function since their claimAbleAmount
is not decreased.
The TokenManager.withdraw
function lets withdraw tokens from users virtual balances when claimAbleAmount
is not zero. The problem is the userTokenBalanceMap[_msgSender()][_tokenAddress][_tokenBalanceType]
variable is not decreased and users can withdraw the same amount many times.
Assets losses without special conditions.
Manual Review
Consider decreasing the userTokenBalanceMap[_msgSender()][_tokenAddress][_tokenBalanceType]
variable before transferring assets.
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.