withdraw doesn't reduce our user's balance
withdraw doesn't reduce userTokenBalanceMap map, which means that once a user deposits some amount he would be able to withdraw it multiple times.
Example:
Alice's account is added 100 tokens using addTokenBalance
Alice withdraws these 100 tokens
Alice calls withdraw again and again withdraws 100 tokens
Users can drain the system
Manual review
Decrease userTokenBalanceMap map by the withdrawn amount.
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.