Submitted by obront, also found by joestakey, Trust, wait, Madalad, hansfriese, deliriusz, rvierdiiev, HE1M, 8olidity, zaskoh, hihen, cccz, and csanuragjain
When a manager withdraws funds from Collateral.sol, there is a check in the managerWithdrawHook to confirm that they arent pushing the contract below the minimum reserve balance.
However, a similar check doesnt happen in the withdraw() function.
The manager can use this flaw to get around the reserve balance by making a large deposit, taking a manager withdrawal, and then withdrawing their deposit.
Imagine a situation where the token has a balance of 100, deposits of 1000, and a reserve percentage of 10%. In this situation, the manager should not be able to make any withdrawal.
But, with the following series of events, they can:
The result is that they are able to drain the balance of the contract all the way to zero, avoiding the intended restrictions.
Include a check on the reserves in the withdraw() function as well as managerWithdraw().
Picodes (judge) commented:
Picodes (judge) commented:
ramenforbreakfast (prePO) confirmed
Picodes (judge) decreased severity to Medium and commented:
