If a token's oracle goes down or price falls to zero, liquidations will be frozen
If a token's oracle goes down or its price falls to zero, all liquidation calls for positions holding that token will revert, freezing liquidations. This could prevent timely liquidations, potentially leading to protocol insolvency.
8olidity Follow with 0xChinedu, rvierdiiev and 3 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2023-02-blueberry-judging/issues/161
Found by
8olidity, 0xChinedu, rvierdiiev, obront, sakshamguruji, Saeedalipoor01988
Summary
In some extreme cases, oracles can be taken offline or token prices can fall to zero. In these cases, liquidations will be frozen (all calls will revert) for any debt holders holding this token, even though they may be some of the most important times to allow liquidations to retain the solvency of the protocol.
Vulnerability Detail
Chainlink has taken oracles offline in extreme cases. For example, during the UST collapse, Chainlink paused the UST/ETH price oracle, to ensure that it wasn't providing inaccurate data to protocols.
In such a situation (or one in which the token's value falls to zero), all liquidations for users holding the frozen asset would revert. This is because any call to liquidate() calls isLiquidatable(), which calls getPositionRisk(), which calls the oracle to get the values of all the position's tokens (underlying, debt, and collateral).
Depending on the specifics, one of the following checks would cause the revert:
- the call to Chainlink's
registry.latestRoundDatawould fail if (updatedAt < block.timestamp - maxDelayTime) revert PRICE_OUTDATED(_token);if (px == 0) revert PRICE_FAILED(token);
If the oracle price lookup reverts, liquidations will be frozen, and the user will be immune to liquidations. Although there are ways this could be manually fixed with fake oracles, by definition this happening would represent a cataclysmic time where liquidations need to be happening promptly to avoid the protocol falling into insolvency.
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-02-blueberry/blob/main/contracts/BlueBerryBank.sol#L511-L517
https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/BlueBerryBank.sol#L497-L505
https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/BlueBerryBank.sol#L477-L488
Tool used
Manual Review
Recommendation
Ensure there is a safeguard in place to protect against this possibility.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the liquidation logic does not handle oracle failures or zero prices gracefully, causing reverts that block liquidations.
Impact
Liquidations may be impossible when most needed, potentially causing protocol insolvency.
What the attacker needed
Oracle goes down or price falls to zero
The fix
A safeguard should be implemented to protect against this possibility.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a lending protocol, if a borrower's collateral loses value, anyone can liquidate their position to keep the protocol solvent. This report says that if the price feed for a token stops working or reports zero, the liquidation function will always fail, so no one can liquidate. That could leave bad debt and make the protocol insolvent.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.