Platform: Code4rena
Start Date: 04/03/2024
Pot Size: $88,500 USDC
Total HM: 31
Participants: 105
Period: 11 days
Judge: ronnyx2017
Total Solo HM: 7
Id: 342
League: ETH
Rank: 103/105
Findings: 1
Award: $3.35
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: kfx
Also found by: 0x175, 0xAlix2, 0xjuan, AMOW, Aymen0909, CaeraDenoir, Giorgio, JCN, JecikPo, JohnSmith, Norah, SpicyMeatball, alexander_orjustalex, atoko, erosjohn, falconhoof, givn, grearlake, jnforja, kinda_very_good, lanrebayode77, nmirchev8, shaka, web3Tycoon, zxriptor
3.3501 USDC - $3.35
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L696-L697
Users can avoid being liquidated.
When calling V3Vault.liquidate
liquidator manually inputs LiquidateParams
which is further checked against debtShares
of the liquitee and reverts DebtChanged
in case they don't match.
function liquidate(LiquidateParams calldata params) external override returns (uint256 amount0, uint256 amount1) { // liquidation is not allowed during transformer mode if (transformedTokenId > 0) { revert TransformNotAllowed(); } LiquidateState memory state; (state.newDebtExchangeRateX96, state.newLendExchangeRateX96) = _updateGlobalInterest(); uint256 debtShares = loans[params.tokenId].debtShares; if (debtShares != params.debtShares) { revert DebtChanged(); }
Unhealthy borrowers can anticipate and front-run liquidations by repaying 1 wei (or minAmount) worth of shares, thus avoid being liquidated.
Furthermore, liquidation profitability is directly proportional to the extent of unhealthiness of a position. Malicious users can call V3Vault.repay
(callable by anyone) on slightly unhealthy positions of honest users to avoid them being liquidated by other liquidators thus making the position more unhealthy and eligible for higher liquidation rewards (and lower return to honest user when _cleanupLoan
is called)
Manual review
change the check to:
if (debtShares > params.debtShares) { revert DebtChanged(); }
Context
#0 - c4-pre-sort
2024-03-18T18:13:55Z
0xEVom marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-03-18T18:14:43Z
0xEVom marked the issue as duplicate of #231
#2 - c4-pre-sort
2024-03-22T12:02:42Z
0xEVom marked the issue as duplicate of #222
#3 - c4-judge
2024-03-31T16:06:07Z
jhsagd76 marked the issue as satisfactory