Submitted by Kaysoft, also found by Afriauditor (1, 2), chaduke, 0xAlix2, boraichodrunkenmaster, ElCid, Spearmint, josephxander, Centaur, zhaojohnson, Bigsam, peanuts, yashar, Inspecktor, ak1, hash, pkqs90, zxriptor, JanuaryPersimmon2024, and ustas
https://github.com/code-423n4/2024-07-loopfi/blob/57871f64bdea450c1f04c9a53dc1a78223719164/src/CDPVault.sol#L223-L233
https://github.com/code-423n4/2024-07-loopfi/blob/main/src/CDPVault.sol#L239-L249
Users can still execute deposit and withdraw functions when the CDPVault.sol is paused as against the design expectation by just calling the modifyCollateralAndDebt(...) function with the necessary parameters.
By design it is expected that when the CDPVault.sol contract is paused by the Dao, the deposits and withdrawals cannot be made due to the whenNotPaused modifier on the deposit and withdraw functions. However, the pause mechanism can be bypassed by users to deposit or withdraw on the CDPVault contract by directly calling the modifyCollateralAndDebt(...) function since it is public since it is the same function that is called by the deposit and withdraw functions.
Both the deposit and withdraw functions of the CDPVault.sol only make simple calculations before calling the public modifyCollateralAndDebt(...) function. This allows any user to directly call the modifyCollateralAndDebt(...) function when the CDPVault.sol contract is paused.
Consider implementing either of the two solutions:
amarcu (LoopFi) confirmed
