Skip to content
Business logic Audit finding Beginner

RewardPoolManager can only add RewardPoolToken

The RewardPoolManager contract can add reward tokens but has no way to remove them and caps the list at ten, so a token that becomes worthless or malicious cannot be dropped. Separately, the admin's setClaimFee function in VotingEscrow has no upper bound, allowing an arbitrarily high early-claim fee.

sunny Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

31594 - [SC - Insight] RewardPoolManager can only add RewardPoolToken ...

Submitted on May 21st 2024 at 15:49:14 UTC by @hulkvision for Boost | Alchemix

Report ID: #31594

Report type: Smart Contract

Report severity: Insight

Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/RewardPoolManager.sol

Impacts:

  • Contract fails to deliver promised returns, but doesn't lose value

Description

Brief/Intro

I have mentioned two issues that would be nice to fix in this report.

  1. RewardPoolManager can only add RewardPoolToken and has a limit of maximum limit of 10 reward tokens and does not have way to remove it.
  2. In VotingEscrow.sol setClaimFee does not have any upper limit check on fee amount set by the admin.

Vulnerability Details #1

RewardPoolManager can only add RewardPoolToken and has a limit of maximum limit of 10 reward tokens and does not have way to remove it, so if a reward token becomes insolvent or its value decreased to zero, the contract will have no way to remove these tokens.

In RewardPoolManager.sol

function _addRewardPoolToken(address token) internal { //@audit-ok
        if (!isRewardPoolToken[token] && token != address(0)) {
            require(rewardPoolTokens.length < MAX_REWARD_POOL_TOKENS, "too many reward pool tokens");

            isRewardPoolToken[token] = true;
            rewardPoolTokens.push(token);
        }
    }

Impact Details #1

  • Contract will not be to remove tokens that have become malicious or their value has decreased to zero.

Vulnerability Detail #2

In VotingEscrow.sol

function setClaimFee(uint256 _claimFeeBps) external { //@audit no upper limit check present
        require(msg.sender == admin, "not admin");
        claimFeeBps = _claimFeeBps;
        emit ClaimFeeUpdated(_claimFeeBps);
    }

setClaimFee function is used by admin to set the claim fee for claiming ALCX rewards early, it is used by RewardsDistributor.sol contract to claim fees. This function does not have a upper limit check present on how much fee can be claimed.

Impact Details #2

  • Allowing arbitrary fee without upper limit could reduce user trust in the protocol.

Proof of Concept

Add this test to src/test/VotingEscrow.t.sol and run test with forge test --mt testPocArbitraryClaimFees --rpc-url $RPC_URL

function testPocArbitraryClaimFees() public {
    veALCX.setClaimFee(1000000000);
        assertEq(veALCX.claimFeeBps(), 1000000000, "incorrect claim fee");
}

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

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 design lacks a removal function for reward tokens and an upper-bound check on the claim fee.

Impact

The contract could be stuck with worthless or malicious reward tokens, and an admin could set an arbitrarily high claim fee, which may reduce user trust.

What the attacker needed

Admin privileges for setClaimFee; none for the token list issue

The fix

The report suggests adding a way to remove reward tokens and an upper limit check on the claim fee, but does not state that either was fixed.

How it was found

  1. Add the provided test to the VotingEscrow test file.
  2. Run the test with the forge test command and the named test.
  3. Observe that the claim fee is set to an arbitrarily large value.

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 is a program on a blockchain that runs automatically. This report says one contract can only ever add reward tokens to a list, never remove them, so a bad or worthless token stays forever. It also says an admin can set a claim fee to any number with no maximum, which could make claiming rewards very expensive.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by sunny

View all

8 more disclosed reports, best first.

More from Alchemix

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.