deposit is missing any access control checks allowing anyone to call the function with any token and thus allowing to brick the deposit function completely.
This is how depositis defined:
It is missing access control checks allowing anyone to allow this function with any ERC20 token. A token could be made such that it only allows transfers from an attacker's account. So, the attacker can mint uint256.max value to his account and call deposit and transfer it all to this contract. This would increase the _totalValue variable to uint256.max allow no further deposits.
The pseudo-code of the transfer function of such a malicious token could look like this:
This would only allow the attacker to transfer tokens. Due to this, even if the withdrawer tried to call the withdraw function they would not be able to do so, as the transfer functions would not allow transfers from any other address other than the attacker because of the transfer function definition.
These tokens cannot be sent from this address. Hence _totalValuenever gets decremented. depositfunction cannot be called again as _totalValue is equal touint256.max.
deposit function is completely bricked. It cannot be called with other useful tokens.
Manual review
Add onlyRole(MANAGER_ROLE)modifier to deposit function.
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.