Open github-actions[bot] opened 1 year ago
Proposed solution no longer works as the solution to issue #161 changed line 553 in Vault_Velo.sol
to if((outstandingisoUSD > 0) && (colInUSD > 0)){
meaning that the calculation of colInUSD must occur before entering the if clause.
However with issue #145 fixed this problem is less terminal as now we update the minPrice and maxPrice with each call. We then have two situations in which the minPrice or maxPrice protection is triggered:
Therefore this has become a "won't fix" issue
The risk of this issue has been greatly reduced by the fixes made for #145. The risk of a flash crash has been acknowledged by sponsor and they have accepted this risk, without a fix.
0x52
medium
All collateral in Velodrome vault will be permantly locked if either asset in liquidity pair stays outside of min/max price
Summary
The oracles used have a built in safeguard to revert the transaction if the queried asset is outside of a defined price range. The issue with this is that every vault interaction requires the underlying collateral to be valued. If one of the assets in the pair goes outside it's immutable range then the entire vault will be frozen and all collateral will be permanently stuck.
Vulnerability Detail
The lines above are called each time and asset is priced. If the oracle returns outside of the predefined range then the transaction will revert.
When closing a loan the vault attempts to price the users collateral. Since this is the only way for a user to remove collateral is to call closeLoan, if the price of either asset in the LP goes outside of its bounds then all user deposits will be lost.
Impact
Entire vault will be frozen and all collateral will be permanently stuck
Code Snippet
https://github.com/sherlock-audit/2022-11-isomorph/blob/main/contracts/Isomorph/contracts/Vault_Velo.sol#L527-L587
Tool used
Manual Review
Recommendation
If a user is closing their entire loan then there is no need to check the value of the withdraw collateral because there is no longer any debt to collateralize. Move the check inside the inequality to allow the closeLoan to always function: