Revert Lend - web3Tycoon's results

A lending protocol specifically designed for liquidity providers on Uniswap v3.

General Information

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

Revert

Findings Distribution

Researcher Performance

Rank: 105/105

Findings: 1

Award: $3.35

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

3.3501 USDC - $3.35

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
sufficient quality report
edited-by-warden
:robot:_45_group
duplicate-222

External Links

Lines of code

https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L685

Vulnerability details

Impact

When a liquidator calls Liquidate with the params containing the tokenId. The owner of the tokenId will see the transaction in the mempool and frontrun by calling repay with a small digit lets say 1%, and since the minimum amount is 0, will cause the liquidator transaction to fail because debtShares should be equal to params.debtShares.

if (debtShares != params.debtShares) {
            revert DebtChanged();
        }

Proof of Concept

  1. Liquidator call liquidate , in params with tokenId
  2. owner sees the transaction pending in the mempool.
  3. Owner calls repay with a minimum amount above 0.
  4. The transaction of the Liquidator fails because an update of debtShares happened which will not be equal to the params.debtShares

Tools Used

manual Review

Refactor the code such as when liquidate is called on a tokenId, that should be liquidate. It locks the user to avoid to redeem his position.

Assessed type

MEV

#0 - c4-pre-sort

2024-03-18T18:14:03Z

0xEVom marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-03-18T18:15:07Z

0xEVom marked the issue as duplicate of #231

#2 - c4-pre-sort

2024-03-22T12:02:38Z

0xEVom marked the issue as duplicate of #222

#3 - c4-judge

2024-03-31T14:47:30Z

jhsagd76 changed the severity to 2 (Med Risk)

#4 - c4-judge

2024-03-31T14:47:45Z

jhsagd76 marked the issue as satisfactory

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter