useLoan doesn't allow liqudator to specifiy maximum price
The useLoan function does not let a liquidator set a maximum price they are willing to pay for collateral. A chain reorganisation could move their transaction earlier, causing them to pay more than intended.
Source: https://github.com/sherlock-audit/2023-02-kairos-judging/issues/25
Found by
0x52
Summary
useLoan doesn't allow the liquidator to specify a max price they are will to pay for the collateral they are liquidating. On the surface this doesn't seem like an issue because the price is always decreasing due to the dutch auction. However this can be problematic if the chain the contracts are deployed suffers a reorg attack. This can place the transaction earlier than anticipated and therefore charge the user more than they meant to pay. On Ethereum this is unlikely but this is meant to be deployed on any compatible EVM chain many of which are frequently reorganized.
Vulnerability Detail
See summary.
Impact
Liquidator can be charged more than intended
Code Snippet
Tool used
Manual Review
Recommendation
Allow liquidator to specify a max acceptable price to pay
Discussion
npasquie
fixed here https://github.com/kairos-loan/kairos-contracts/pull/50
IAm0x52
Fix looks good. Liquidation will now revert if auction price is greater than max price specified
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 function lacks a parameter for the liquidator to set a maximum acceptable price, so the transaction executes at whatever the current auction price is.
Impact
A liquidator could be charged more than intended if a chain reorganisation places their transaction earlier in the auction.
What the attacker needed
Chain reorganisation occurs
The fix
The issue was fixed by allowing the liquidator to specify a maximum price, and liquidation now reverts if the auction price exceeds it.
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.
When someone liquidates a loan, they buy collateral at a price that drops over time. This report says the buyer cannot say 'I will not pay more than X'. If the blockchain reorders transactions (a reorg), the buyer's transaction might happen earlier when the price is higher, so they pay more than they wanted.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.