Capital pool can be drained entirely by a malicious user
The tokenManager's withdraw function allows a user to withdraw their accumulated tokenBalance of a token from the capital pool. This function however fails to update the user's token amount mapping after withdrawal, therefore allowing a user to repeatedly withdraw from the pool till the pool's entire balance is drained
The above POC shows how a malicious user can completely drain the capital Pool of any/all tokens by looping the withdrawal.
Manual Review
Update user token balances in the **userTokenBalanceMap **after each withdrawal
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.