Skip to content
DoS Audit finding Intermediate

VE3DRewardPool claim in loop depend on pausable token

The reward pool bundles all reward tokens into a single claim loop, so if any one reward token has pausable transfers and is paused, the entire claim or withdrawal reverts. An attacker cannot directly exploit this, but a paused token (e.g., Ribbon) would block users from claiming any rewards.

VAD37 Follow

Originally disclosed on Code4rena

Submitted by VAD37

https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VE3DRewardPool.sol#L296-L299

https://github.com/code-423n4/2022-05-vetoken/blob/1be2f03670e407908f175c08cf8cc0ce96c55baf/contracts/VeAssetDepositor.sol#L134-L152

Vulnerability Details

Project veToken is supposed to be a generalized version of Convex for non-Curve token. There is only one contract for all rewards token in the platform.

All ve3Token rewards are bundled together inside ve3DLocker and ve3DRewardPool in a loop. Instead of having its own unique contract like VeAssetDepositer or VoterProxy for each token.

Impact

If one token has pausable transfer, user cannot claim rewards or withdraw if they have multiple rewards include that pause token.

Right now the project intends to support only 6 tokens, including Ribbon token which has pausable transfer controlled by Ribbon DAO.

Normally, this would not be an issue in Convex where only a few pools would be affected by single coin. Since, veAsset are bundled together into single reward pool, it becomes a major problem.

Proof of Concept

  • Token like Ribbon pause token transfer by DAO due to an unfortunate event.
  • VE3DRewardPool try call getReward(), VeAssetDepositor try deposit token from earned rewards does not work anymore because IERC20.transfer is blocked. This effectively reverts current function if user have this token reward > 0.

Recommended Mitigation Steps

It would be a better practice if we had a second getReward() function that accepts an array of token that we would like to interact with.

It saves gas and only requires some extra work on frontend website. Instead of current implementation, withdraw all token bundles together.

solvetony (veToken Finance) confirmed and commented:

It might happen rarely, but we might fix that.

Alex the Entreprenerd (judge) commented:

The warden has shown how, in certain cases, because a reward token could be pausable, this can cause the entire claim process to break as getReward doesn’t allow the caller to specify which tokens to receive.

I have to agree that the odds are low, however the finding is valid and because it’s reliant on external conditions I believe Medium Severity to be appropriate.


The original report as published on Code4rena, by VAD37. 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

Impact

Users could be unable to claim any rewards or withdraw if one of their reward tokens is paused, but this depends on an external token being paused and the user holding that token.

What the attacker needed

A reward token with pausable transfers; that token is paused by its DAO; user has a balance of that token

The fix

The reward pool should provide a second getReward() function that accepts an array of tokens to claim, so users can skip paused tokens.

How it was found

  1. A reward token with pausable transfers is paused by its DAO.
  2. A user with a balance of that token calls getReward().
  3. The reward pool attempts to transfer all reward tokens in a loop.
  4. The transfer of the paused token reverts, causing the entire claim to fail.

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 lets users claim several reward tokens at once. If one of those tokens can be paused by its own team, and it is paused, the whole claim fails, so users get nothing even for the other tokens.

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 by VAD37

View all

3 more disclosed reports, best first.

More from veToken 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.