TokenManager.sol#withdraw function doesn't decrease userTokenBalanceMap state variable at all.
Exploiting this vulnerability, attacker can calls TokenManager.sol#withdraw function multiple times until the capital pool drains empty.
TokenManager.sol#withdraw function is the following.
As can be seen, the above function doesn't decrease userTokenBalanceMap state variable at all.
Therefore, attacker can calls TokenManager.sol#withdraw function multiple times until the capital pool drains empty.
Attacker can drain the capital pool empty.
Manual Review
Modify TokenManager.sol#withdraw function as follows.
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.