This repository has been archived by the owner on Dec 17, 2023. It is now read-only.
Ocean_Sky - If Price falls to zero, liquidations will be frozen #402
Labels
Non-Reward
This issue will not receive a payout
Ocean_Sky
medium
If Price falls to zero, liquidations will be frozen
Summary
Liquidation function won't work if the price falls to zero.
Vulnerability Detail
Zero is unacceptable value when retrieving price from chainlink oracle. So if the price falls to zero, the liquidation process won't be triggered or simply "frozen" (all calls will revert). If this happens, collateral assets won't be liquidated and the protocol will be insolvent.
Similar case issues:
sherlock-audit/2023-02-blueberry-judging#161
sherlock-audit/2023-02-gmx-judging#156
Impact
Liquidations may not be possible at a time when the protocol needs them most. As a result, the value of user's asset may fall below their debts, turning off any liquidation incentive and pushing the protocol into insolvency.
Code Snippet
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/oracle/PriceOracle.sol#L60-#L72
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/pool/IronBank.sol#L1065-#L1092
Tool used
Manual Review
Recommendation
Provide safeguard mechanism to avoid this from happening.
Duplicate of #433
The text was updated successfully, but these errors were encountered: