The userTokenBalanceMap for users does not change after a user calls the withdraw function in TokenManager.sol. This may lead to a loss of tokens on the CapitalPool contract.
The withdraw function in TokenManager.sol allows a user to withdraw their token balance which is given by the userTokenBalanceMap for the specific user, token and TokenBalanceType. After tokens are withdrawn the userTokenBalanceMap remains unchanged. If the user immediately calls withdraw again with the same arguments then they will be able to withdraw the same amount again.
Users could repeatedly call withdraw to get any and all tokens from the capital pool contract.
Set userTokenBalanceMap to 0 when a user calls withdraw.
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.