Revert Lend - pynschon'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: 56/105

Findings: 1

Award: $92.11

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Aymen0909

Also found by: KupiaSec, Topmark, befree3x, kennedy1030, linmiaomiao, pynschon

Labels

bug
2 (Med Risk)
satisfactory
sufficient quality report
:robot:_87_group
duplicate-324

Awards

92.1136 USDC - $92.11

External Links

Lines of code

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

Vulnerability details

When depositing, the vault checks if the GlobalLendLimit has been reached. It does this by comparing totalSupply() against globalLendLimit, but the totalSupply() refers to the vault shares that have been minted and not the liquidity held in the vault.

Impact

The protocol will revert even when the GlobalLendLimit hasn't been reached, since the exchange rate starts at 1:1 and keeps growing with time, the totalSupply() will be less than assets.

Tools Used

None

Instead of (totalSupply() > globalLendLimit) it should be _convertToAssets(totalSupply(), lendExchangeRateX96, Math.Rounding.Up), that way the globalLendLimit would be compared against the liquidity.

Assessed type

Math

#0 - c4-pre-sort

2024-03-18T19:02:43Z

0xEVom marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-03-18T19:03:53Z

0xEVom marked the issue as duplicate of #324

#2 - c4-judge

2024-03-31T14:51:29Z

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