By not updating the userTokenBalanceMap in the TokenManager.sol#withdraw() function, a malicious user can steal funds from the protocol.
The TokenManager.sol#withdraw() function allows the caller to withdraw his or her balance.
However, there is no process to update userTokenBalanceMap within the withdraw() function.
As a result, userTokenBalanceMap retains its original value even after the caller withdraws his or her balance.
In other words, a malicious user can steal funds from the protocol by calling the withdraw() function multiple times.
A malicious user can steal funds from the protocol.
Manual Review
It is recommended to add the following code to the TokenManager.sol#withdraw() function.
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.