Revert Lend - kinda_very_good'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: 85/105

Findings: 2

Award: $20.67

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

17.3162 USDC - $17.32

Labels

bug
3 (High Risk)
satisfactory
sufficient quality report
:robot:_08_group
duplicate-54

External Links

Lines of code

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

Vulnerability details

Impact

The vault could end up in a loss

Proof of Concept

A malicious actor bob would call V3Vault::create to create a position with a recipient that is a contract, howvever this countract would not support the IERC721Receiver interface, this contract would be set as the owner of the position. Bob could then take a loan via this contract. If the position ever becomes undercollaterized and a liquidator attempts to liquidate,the call would revert because the V3Vault::cleanupLoan which is called by the liquidate functions uses safeTransferFrom which expects the reciver to implement IERC721Receiver if they are a contract. bob could also make profits from the funds in the nft by arbitraging them using the V3Vault::transfrom fuction

Tools Used

Manual analysis

An address check could be implemened in the V3Vault::onERC721Received function to ensure that the owner is not a function

Assessed type

ERC721

#0 - c4-pre-sort

2024-03-18T18:41:25Z

0xEVom marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-03-18T18:42:22Z

0xEVom marked the issue as duplicate of #54

#2 - c4-judge

2024-03-31T16:09:17Z

jhsagd76 marked the issue as satisfactory

Awards

3.3501 USDC - $3.35

Labels

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

External Links

Lines of code

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

Vulnerability details

Impact

A malicious user can stop themselves from being liquidated effecting more loses on the vault

Proof of Concept

The V3Vault.liquidate requires that the debt shares supplied by the laiquidator parms is the same and the nft id debts shares else it reverts. A malicious actor could take advantage of this by repaying very small amounts eg 1,2 unit amounts when ever they are about to be liquidated to make sure the debt shares decrease without actually making the position solvent

Tools Used

manual analysis

dust repays should not be allowed and the above code block should be removed

Assessed type

Other

#0 - c4-pre-sort

2024-03-18T18:14:01Z

0xEVom marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-03-18T18:15:02Z

0xEVom marked the issue as duplicate of #231

#2 - c4-pre-sort

2024-03-22T12:02:53Z

0xEVom marked the issue as duplicate of #222

#3 - c4-judge

2024-03-31T14:47:29Z

jhsagd76 changed the severity to 2 (Med Risk)

#4 - c4-judge

2024-03-31T16:06:32Z

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