Skip to content
DoS Audit finding Intermediate

Malicious user can populate rewards array with tokens of their interest reaching limits of MAX_REWARD_TOKENS

A malicious user could fill the rewards array with many different tokens by sending tiny amounts, reaching the MAX_REWARD_TOKENS limit. This would prevent any other tokens from being added as rewards.

0xf15ers Follow

Originally disclosed on Code4rena

Submitted by 0xf15ers, also found by 0x52, berndartmueller, cccz, horsefacts, hyh, minhquanym, pauliax, Ruhum, and WatchPug

Malicious user can populate rewards array with different tokens early reaching limit of MAX_REWARD_TOKENS sending very small amount of different tokens. It will restrict any other tokens to be used as rewards in Bribe.sol#notifyRewardAmount()

Proof of Concept

A custom malicious contract can be created that can make multiple calls to notifyRewardAmount() sending very small amounts of different tokens to populate the array rewards and fulfill the total of MAX_REWARD_TOKENS . This will restrict any other person from adding to rewards array.

pooltypes (Velodrome) confirmed and commented:

Fixed. We added a whitelist check for reward tokens for our mainnet deployment.

Alex the Entreprenerd (judge) decreased severity to Medium and commented:

Given that the deployer can re-deploy contracts at any time, and they also can multi-call, I don’t believe a realistic DOS can happen.

I do, however, agree that any additional reward beside the first token (which can be automatically added via a deploy + initialize + distribute), may end up being denied.

Additionally the team can use swapOutBribeRewardToken to change to a real reward token.

Because of this, I believe the finding to be valid and of Medium Severity.


The original report as published on Code4rena, by 0xf15ers. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the contract allows anyone to add reward tokens without restriction, and the maximum limit can be reached by adding many tokens with minimal amounts.

Impact

Other users could be denied the ability to add their tokens as rewards, but the deployer can re-deploy contracts or use swapOutBribeRewardToken to change reward tokens, so a realistic denial of service may not occur.

What the attacker needed

Ability to deploy a malicious contract; ability to call notifyRewardAmount()

The fix

A whitelist check for reward tokens was added for the mainnet deployment.

How it was found

  1. Create a custom malicious contract that can make multiple calls to notifyRewardAmount().
  2. Send very small amounts of different tokens to populate the rewards array.
  3. Reach the MAX_REWARD_TOKENS limit, preventing others from adding reward tokens.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract has a list of reward tokens, and there is a maximum number of tokens that can be in that list. An attacker can add many different tokens with very small amounts, filling up the list so that no one else can add their token. This is like filling a limited number of slots with junk so real items cannot be placed.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Velodrome Finance contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.