This repository has been archived by the owner on May 26, 2023. It is now read-only.
0x52 - All collateral in Velodrome vault will be permantly locked if either asset in liquidity pair stays outside of min/max price #70
Labels
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:
The text was updated successfully, but these errors were encountered: