Open sherlock-admin opened 8 months ago
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid
Since it was mentioned in the contest details as the following, I believe the exception highlighted in point 20. of sherlock rules applies here, so leaving as medium severity.
Chainlink and contracts of primary assets are TRUSTED, others are RESTRICTED
The protocol team fixed this issue in PR/commit https://github.com/arcadia-finance/lending-v2/pull/136.
Fix looks good. Bids made during sequencer downtime revert and all auctions automatically refresh auction starting time.
The Lead Senior Watson signed off on the fix.
PUSH0
medium
L2 sequencer down will push an auction's price down, causing unfair liquidation prices, and potentially guaranteeing bad debt
Summary
The protocol implements a L2 sequencer downtime check in the Registry. In the event of sequencer downtime (as well as a grace period following recovery), liquidations are disabled for the rightful reasons.
However, while the sequencer is down, any ongoing auctions' price decay is still ongoing. When the sequencer goes back online, it will be possible to liquidate for a much lower price, guaranteeing bad debt past a certain point.
Vulnerability Detail
While the price oracle has sequencer uptime checks, the liquidation auction's price curve calculation does not. The liquidation price is a function with respect to the user's total debt versus their total collateral.
Due to no sequencer check within the liquidator, the liquidation price continues to decay when the sequencer is down. It is possible for the liquidation price to drop below 100%, that is, it is then possible to liquidate all collateral without repaying all debt.
Any ongoing liquidations that are temporarily blocked by a sequencer outage will continue to experience price decay. When the sequencer goes back online, liquidation will have dropped significantly in price, causing liquidation to happen at an unfair price as well. Furthermore, longer downtime durations will make it possible to seize all collateral for less than $100\%$ debt, guaranteeing bad debt for the protocol.
Proof of concept
We use the default liquidator parameters defined in the constructor for our example:
Consider the following scenario:
The impact becomes more severe the longer the sequencer goes down. In addition, the grace period on top of it will decay the auction price even further, before the auction can be back online.
Furthermore, even if downtime is not enough to bring down the multiplier to less than $100\%$, Bob will still incur unfair loss due to his collateral being sold at a lower price anyway. Therefore any duration of sequencer downtime will cause an unfair loss.
Impact
Any ongoing liquidations during a sequencer outage event will execute at a lower debt-to-collateral ratio, potentially guaranteeing bad debt and/or user being liquidated for a lower price.
Code Snippet
https://github.com/sherlock-audit/2023-12-arcadia/blob/main/lending-v2/src/Liquidator.sol#L364-L395
Tool used
Manual Review
Recommendation
Auctions' price curve should either check and exclude sequencer downtime alongside its grace period, or said auctions should simply be voided.