Venus Prime - kutugu's results

Earn, borrow & lend on the #1 Decentralized Money Market on the BNB chain.

General Information

Platform: Code4rena

Start Date: 28/09/2023

Pot Size: $36,500 USDC

Total HM: 5

Participants: 115

Period: 6 days

Judge: 0xDjango

Total Solo HM: 1

Id: 290

League: ETH

Venus Protocol

Findings Distribution

Researcher Performance

Rank: 81/115

Findings: 1

Award: $4.37

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-09-venus/blob/b11d9ef9db8237678567e66759003138f2368d23/contracts/Tokens/Prime/PrimeLiquidityProvider.sol#L274-L278

Vulnerability details

Impact

There are two issues regarding the release rate of tokens in PrimeLiquidityProvider:

  1. Arbitrum use the L1 block number not L2 block number. Not sure if this is intentional, as Arbitrum's block production rate is variable so the protocol may want to adopt the L1 block to release tokens smoothly.
  2. But for polygon zkevm, one tx represents one block, which means malicious users can send large amounts of spam emails to promote block generation and token release. This is beneficial to early staking users, who can collude to collect all rewards at a much faster release rate than expected.

There is also a BLOCKS_PER_YEAR variable in Prime, I don't think this will work properly on polygon zkevm.

Proof of Concept

I cannot provide a POC simulation to control the generation rate of blocks. You can view it from https://zkevm.polygonscan.com/. The general process is as follows:

  1. Based on the recent actual polygon zkevm block production rate of 1 block/s, the protocol sets the token release rate to 1e18, the total number of tokens to 1e24, and is expected to be released in 12 days
  2. The early users will immediately send a large amount of spam emails, with a production speed of 10 blocks/s and expected to be released in about 1 day, avoiding additional user participation and obtaining large rewards.

Tools Used

Foundry

Use timestamp instead of block number to calculate rate

Assessed type

Context

#0 - c4-pre-sort

2023-10-06T21:19:58Z

0xRobocop marked the issue as duplicate of #76

#1 - c4-pre-sort

2023-10-07T00:00:29Z

0xRobocop marked the issue as duplicate of #39

#2 - c4-judge

2023-11-01T15:57:54Z

fatherGoose1 marked the issue as duplicate of #76

#3 - c4-judge

2023-11-01T15:58:10Z

fatherGoose1 changed the severity to QA (Quality Assurance)

#4 - c4-judge

2023-11-03T01:42:12Z

fatherGoose1 marked the issue as grade-b

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