Skip to content
Business logic Audit finding Intermediate

Retroactive reward accrual for newly added tokens when validator was inactive

When a new reward token is added while a validator is inactive, the contract creates checkpoints for that validator without accounting for its inactive status. After reactivation, users can claim rewards for the newly added token that include the period when the validator was inactive, receiving tokens they should not have accrued.

light279 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

52588 sc high retroactive reward accrual for newly added tokens when validator was inactive

Submitted on Aug 11th 2025 at 19:47:43 UTC by @light279 for Attackathon | Plume Network

Description

Brief / Intro

When a validator is turned inactive the system records a timestamp to cap rewards. If a new reward token is added while the validator is inactive, the contract creates reward checkpoints for all validators (including the inactive one). After the validator is reactivated, users who had already claimed rewards up to the inactive timestamp can later claim the newly added token’s rewards — and the reward calculation mistakenly includes the period when the validator was inactive and the user should not have earned rewards.

In short: users may receive retroactive rewards for a token that was added while the validator was inactive.

Vulnerability Details

The issue is best understood as a sequence of events:

{% stepper %} {% step %}

Validator made inactive and users settled

  • Validator is made inactive at time T — slashedAtTimestamp (used as an inactive cap) is set and users can claim rewards up to T.
  • User claims all existing-token rewards up to T (storage pointers for those tokens are advanced to T or otherwise settled). {% endstep %}

{% step %}

New reward token added while validator is inactive

  • A new reward token X is added while the validator is still inactive.
  • RewardsFacet::addRewardToken creates an initial checkpoint (with initialRate) for every validator, including this inactive validator at time T'. {% endstep %}

{% step %}

Validator reactivated

  • Validator is reactivated at time T1.
  • Reactivation resets/creates validator-level checkpoints and validatorLastUpdateTimes for tokens. {% endstep %}

{% step %}

User claims token X after reactivation

  • User claims token X after reactivation (time T2, T2 > T1).
  • Functional flow: RewardsFacet::claim(address token,uint16 validatorId) => RewardsFacet::_processValidatorRewards => PlumeRewardLogic.updateRewardsForValidatorAndToken => PlumeRewardLogic::calculateRewardsWithCheckpoints => PlumeRewardLogic::_calculateRewardsCore.
  • The code updates the validator cumulative RPT for token X (from reactivation → T2), then calls _calculateRewardsCore.
  • Because the user never had any per-token paid-pointer for X (token did not exist at time T), lastUserRewardUpdateTime is set to the stake start of the user — and the distinct timestamp logic includes the token-addition / inactive period window (T' → T1). {% endstep %}

{% step %}

Result

  • The calculation includes rewards for the interval when the validator was inactive and token X had been added (T' → T1).
  • As a result, the user may receive tokens they should not have accrued. {% endstep %} {% endstepper %}

Root causes

  • RewardsFacet::addRewardToken creates checkpoints for inactive validators without taking inactive status into account.

Relevant code excerpt:

JavaScript
function addRewardToken(
        address token,
        uint256 initialRate,
        uint256 maxRate
    ) external onlyRole(PlumeRoles.REWARD_MANAGER_ROLE) {
        PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
        if (token == address(0)) {
            revert ZeroAddress("token");
        }
        if ($.isRewardToken[token]) {
            revert TokenAlreadyExists();
        }
        if (initialRate > maxRate) {
            revert RewardRateExceedsMax();
        }

        // Prevent re-adding a token in the same block it was removed to avoid checkpoint overwrites.
        if ($.tokenRemovalTimestamps[token] == block.timestamp) {
            revert CannotReAddTokenInSameBlock(token);
        }

        // Add to historical record if it's the first time seeing this token.
        if (!$.isHistoricalRewardToken[token]) {
            $.isHistoricalRewardToken[token] = true;
            $.historicalRewardTokens.push(token);
        }

        uint256 additionTimestamp = block.timestamp;

        // Clear any previous removal timestamp to allow re-adding
        $.tokenRemovalTimestamps[token] = 0;

        $.rewardTokens.push(token);
        $.isRewardToken[token] = true;
        $.maxRewardRates[token] = maxRate;
        $.rewardRates[token] = initialRate; // Set initial global rate
        $.tokenAdditionTimestamps[token] = additionTimestamp;

        // Create a historical record that the rate starts at initialRate for all validators
        uint16[] memory validatorIds = $.validatorIds;
@>        for (uint256 i = 0; i < validatorIds.length; i++) {
@>            uint16 validatorId = validatorIds[i];
@>            PlumeRewardLogic.createRewardRateCheckpoint(
@>                $,
@>                token,
@>                validatorId,
@>                initialRate
@>            );
@>        }

        emit RewardTokenAdded(token);
        if (maxRate > 0) {
            emit MaxRewardRateUpdated(token, maxRate);
        }
    }

Impact Details

Unintended token distribution / inflation — users can receive rewards for periods where the validator was inactive.

Proof of Concept

The PoC is shown as a step sequence:

{% stepper %} {% step %}

T — validator inactive & users settled

  • Validator V is made inactive via setValidatorStatus(V, false) at time T.
  • validator.slashedAtTimestamp (used as cap) is set to T.
  • User U claims all existing token rewards up to T (storage pointers updated so U has no pending rewards for those tokens). {% endstep %}

{% step %}

T' — add new token while inactive

  • Admin calls addRewardToken(tokenX, initialRate, maxRate).
  • addRewardToken runs createRewardRateCheckpoint for all validators, including V. A checkpoint for tokenX exists with timestamp T' (> T) although V was inactive. {% endstep %}

{% step %}

T1 — validator reactivated

  • Admin calls setValidatorStatus(V, true). This resets validatorLastUpdateTimes and creates new checkpoints signalling activity resumes. {% endstep %}

{% step %}

T2 — user claims tokenX after reactivation

  • U calls claim(tokenX, V) (or a function that processes rewards for tokenX).
  • updateRewardsForValidatorAndToken → calculateRewardsWithCheckpoints → updateRewardPerTokenForValidator updates cumulative RPT from activation → T2.
  • _calculateRewardsCore computes lastUserRewardUpdateTime for tokenX: since U never had a per-token paid timestamp for tokenX (token was added after their earlier claim), the code uses the stake start time of the user and collects distinct timestamps including T' → T1.
  • The resulting totalUserRewardDelta includes reward segments covering T' → T1 (the period when validator was inactive) — rewards that should have been capped/zero. {% endstep %}

{% step %}

Result

  • U receives tokens for an interval they should not have been entitled to (the validator was inactive then). {% endstep %} {% endstepper %}

The original report as published on Immunefi, by light279. 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 addRewardToken function creates reward rate checkpoints for all validators, including inactive ones, without checking or adjusting for the validator's inactive status, so later reward calculations include the inactive period.

Impact

Users could receive unintended token rewards for periods when the validator was inactive, leading to inflation or theft of unclaimed yield and potentially protocol insolvency.

What the attacker needed

Validator is inactive; new reward token added during inactivity; user has staked before inactivity; user claims after reactivation

How it was found

  1. Validator V is made inactive at time T, setting slashedAtTimestamp to T, and user U claims all existing token rewards up to T.
  2. Admin calls addRewardToken for a new token X while V is still inactive, which creates a checkpoint for X for all validators including V at time T'.
  3. Admin reactivates V at time T1, resetting validatorLastUpdateTimes and creating new checkpoints.
  4. User U calls claim for token X after T1, which triggers reward calculation that includes the period from T' to T1.
  5. The calculation uses the user's stake start time because U had no per-token paid timestamp for X, and includes distinct timestamps covering T' to T1.
  6. U receives rewards for the interval when V was inactive, which should have been zero.

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 staking system pays rewards over time. When a validator is paused, the system records a timestamp so that rewards stop accruing. If a new reward token is added during the pause, the system still creates a starting point for that token for the paused validator. Later, when the validator is turned back on, a user can claim rewards for that new token, and the calculation wrongly includes the paused period, giving the user extra tokens.

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 light279

View all

8 more disclosed reports, best first.

More from Plume Network

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.