Venus Protocol Isolated Pools - ast3ros's results

Earn, Borrow & Lend on the #1 Decentralized Money Market on the BNB Chain

General Information

Platform: Code4rena

Start Date: 08/05/2023

Pot Size: $90,500 USDC

Total HM: 17

Participants: 102

Period: 7 days

Judge: 0xean

Total Solo HM: 4

Id: 236

League: ETH

Venus Protocol

Findings Distribution

Researcher Performance

Rank: 62/102

Findings: 1

Award: $66.59

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

66.5871 USDC - $66.59

Labels

bug
3 (High Risk)
satisfactory
upgraded by judge
duplicate-320

External Links

Lines of code

https://github.com/code-423n4/2023-05-venus/blob/b375407d58f71c18f398709d90409e53e94234e5/contracts/WhitePaperInterestRateModel.sol#L17

Vulnerability details

Impact

The baseRatePerBlock and multiplierPerBlock are significantly overestimated (by a factor of 5) and this results in wrong borrow and supply rates. This can mislead borrowers into paying much higher interest rates and facing higher risk of default.

Proof of Concept

The interest rate model assumes the following approximate number of blocks per year:

uint256 public constant blocksPerYear = 2102400;

https://github.com/code-423n4/2023-05-venus/blob/b375407d58f71c18f398709d90409e53e94234e5/contracts/WhitePaperInterestRateModel.sol#L17

However, this number is based on the Ethereum average block time of 15 seconds. The Venus protocol is deployed on BSC and the block time is only 3 seconds, so the actual number of blocks per year should be much higher at 10512000.

Because the blocksPerYear is underestimated, it leads to 5 times higher baseRatePerBlock and multiplierPerBlock.

baseRatePerBlock = baseRatePerYear / blocksPerYear; multiplierPerBlock = multiplierPerYear / blocksPerYear;

The borrow rate and supply rate are also significantly overestimated: Borrow rate:

(ur * multiplierPerBlock) / BASE) + baseRatePerBlock

Supply rate:

(utilizationRate(cash, borrows, reserves) * rateToPool) / BASE

Tools Used

Manual

Change the blocksPerYear from 2102400 to 10512000.


-    uint256 public constant blocksPerYear = 2102400;
+    uint256 public constant blocksPerYear = 10512000;

Assessed type

Other

#0 - c4-judge

2023-05-16T09:22:08Z

0xean marked the issue as duplicate of #559

#1 - c4-judge

2023-06-05T14:02:55Z

0xean marked the issue as satisfactory

#2 - c4-judge

2023-06-05T14:38:31Z

0xean changed the severity to 3 (High Risk)

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