Skip to content
Business logic Audit finding Intermediate

Inactive validators accrue rewards for new tokens

When a new reward token is added while a validator is inactive, the contract creates a positive reward rate checkpoint for that validator, so stakers can later claim rewards for the inactive period. This lets users receive unearned tokens from the treasury.

KlosMitSoss Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

52889 sc high inactive validators accrue rewards for new tokens

Submitted on Aug 14th 2025 at 01:32:54 UTC by @KlosMitSoss for Attackathon | Plume Network

Description

Brief/Intro

When a validator is deactivated, the rates for all reward tokens are set to zero. This means that stakers of this validator should not and will not receive any rewards while the validator is inactive. However, when a new reward token is added while a validator is inactive, stakers of that validator will be able to receive rewards from the token addition timestamp once the validator becomes active again.

Vulnerability Details

The vulnerability stems from the RewardsFacet::addRewardToken() function creating positive-rate checkpoints for all validators, including inactive ones, without considering their active status.

When a validator is deactivated via ValidatorFacet::setValidatorStatus(), zero-rate checkpoints are correctly created:

Solidity
// Create a zero-rate checkpoint for all reward tokens to signal inactivity start
for (uint256 i = 0; i < rewardTokens.length; i++) {
    PlumeRewardLogic.createRewardRateCheckpoint($, rewardTokens[i], validatorId, 0);
}

However, when a new token is added through addRewardToken(), it blindly creates positive-rate checkpoints for all validators:

Solidity
// 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); // Sets rate > 0 for ALL validators
}

This creates a checkpoint with rate = initialRate > 0 for inactive validators, effectively overriding their inactive status for the new token.

The issue manifests during reward calculations in PlumeRewardLogic::_calculateRewardsCore(). When a user interacts with the system after validator reactivation, their reward calculation starts from their original stake time (userValidatorStakeStartTime), not from when the token was added. The function uses PlumeRewardLogic::getDistinctTimestamps() to identify all checkpoint periods and processes each segment:

Solidity
for (uint256 k = 0; k < distinctTimestamps.length - 1; ++k) {
    uint256 segmentStartTime = distinctTimestamps[k];
    uint256 segmentEndTime = distinctTimestamps[k + 1];
    
    // Rate at START of segment
    PlumeStakingStorage.RateCheckpoint memory rewardRateInfoForSegment =
        getEffectiveRewardRateAt($, token, validatorId, segmentStartTime);
    uint256 effectiveRewardRate = rewardRateInfoForSegment.rate;
    
    // Calculate rewards using this rate
    if (effectiveRewardRate > 0 && userStakedAmount > 0) {
        uint256 grossRewardForSegment = 
            (userStakedAmount * rewardPerTokenDeltaForUserInSegment) / PlumeStakingStorage.REWARD_PRECISION;
        // User receives rewards even though validator was inactive
    }
}

This enables the following scenario:

{% stepper %} {% step %}

Validator deactivation sets zero-rate checkpoints

T1: Validator is deactivated → zero-rate checkpoints created for existing tokens. {% endstep %}

{% step %}

New token added while validator inactive

T2: New token added while validator inactive → positive-rate checkpoint created (rate = initialRate) for all validators (including inactive ones). {% endstep %}

{% step %}

Validator reactivation

T3: Validator reactivated → new positive-rate checkpoint created. {% endstep %}

{% step %}

User interaction triggers reward calculation

T4: User interacts (stakes/claims) → reward calculation processes T2-T3 period using initialRate, granting rewards for time when validator was inactive. {% endstep %} {% endstepper %}

Impact Details

Due to this issue, users receive unearned rewards equal to userStakedAmount * initialRate * inactivePeriodDuration. The protocol loses these reward tokens that should remain in the treasury. Example: when the user has 1 PLUME staked, initialRate is 1 token per second and the validator remains inactive for 1 day, they will receive:

1e18 * 1 token per second * 86400

References

Code references are provided throughout the report.

Proof of Concept

{% stepper %} {% step %}

Alice stakes with a validator

  1. Alice stakes with validator Id = 1 by calling StakingFacet::stake().
    (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/facets/StakingFacet.sol#L257-L269). {% endstep %}

{% step %}

Validator is deactivated

  1. The validator is later deactivated via ValidatorFacet::setValidatorStatus().
    (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/facets/ValidatorFacet.sol#L271-L286).\\ This sets slashedAtTimestamp to block.timestamp to cap rewards and creates zero-rate checkpoints for all existing reward tokens. {% endstep %}

{% step %}

New reward token added while inactive

  1. While the validator remains inactive, RewardsFacet::addRewardToken() is called to add a new reward token. The function loops through all validatorIds, including inactive ones, and creates reward rate checkpoints with initialRate for every validator (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/facets/RewardsFacet.sol#L193-L196). This calls PlumeRewardLogic::updateRewardPerTokenForValidator(), which only updates validatorLastUpdateTimes[validatorId][token] for inactive validators (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/lib/PlumeRewardLogic.sol#L155-L160). {% endstep %}

{% step %}

Validator reactivated

  1. The validator is reactivated via ValidatorFacet::setValidatorStatus(), creating new reward rate checkpoints with the current global rate. (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/facets/ValidatorFacet.sol#L292-L304). {% endstep %}

{% step %}

Alice claims rewards — calculation includes inactive period

  1. Alice claims rewards by calling RewardsFacet::claim(address token, uint16 validatorId), which processes rewards through RewardsFacet::_processValidatorRewards() (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/facets/RewardsFacet.sol#L310-L331).
  2. This calls PlumeRewardLogic::updateRewardsForValidatorAndToken() (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/facets/RewardsFacet.sol#L468), which invokes calculateRewardsWithCheckpoints() (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/lib/PlumeRewardLogic.sol#L112-L113). This function calls and then _calculateRewardsCore().
  3. PlumeRewardLogic::updateRewardPerTokenForValidator() updates the validatorLastUpdateTimes[validatorId][token] and validatorRewardPerTokenCumulative[validatorId][token] (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/lib/PlumeRewardLogic.sol#L163-L196).
  4. PlumeRewardLogic::_calculateRewardsCore() calculates the rewards from the userValidatorRewardPerTokenPaidTimestamp[user][validatorId][token] up to the current block.timestamp if the userValidatorRewardPerTokenPaid[user][validatorId][token] differs from the validatorRewardPerTokenCumulative[validatorId][token] (which it does due to the updateRewardPerTokenForValidator() call). In this case, the userValidatorRewardPerTokenPaidTimestamp[user][validatorId][token] will be equal to the userValidatorStakeStartTime (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/lib/PlumeRewardLogic.sol#L225-L231).
  5. The function uses getDistinctTimestamps() to process reward segments. The segment before token addition has rate = 0 (correct), but the segment from token addition until validator reactivation uses initialRate (incorrect). (https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/lib/PlumeRewardLogic.sol#L294-L358). As a result, Alice will receive rewards while the validator was inactive. {% endstep %} {% endstepper %}

The original report as published on Immunefi, by KlosMitSoss. 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 positive-rate checkpoints for all validators without checking whether each validator is active.

Impact

Users could receive unearned rewards equal to their staked amount times the initial rate times the inactive period, causing the protocol to lose reward tokens that should remain in the treasury.

What the attacker needed

A validator is deactivated; a new reward token is added while inactive; the validator is reactivated; user claims rewards

How it was found

  1. Alice stakes with validator Id = 1 by calling StakingFacet::stake().
  2. The validator is later deactivated via ValidatorFacet::setValidatorStatus(), which creates zero-rate checkpoints for existing tokens.
  3. While the validator remains inactive, RewardsFacet::addRewardToken() is called to add a new reward token, creating positive-rate checkpoints for all validators.
  4. The validator is reactivated via ValidatorFacet::setValidatorStatus(), creating new reward rate checkpoints.
  5. Alice claims rewards by calling RewardsFacet::claim(address token, uint16 validatorId), which processes rewards through the reward calculation logic.
  6. The reward calculation includes the period from token addition to reactivation using the initialRate, so Alice receives rewards for the inactive period.

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 to people who lock tokens with a validator. When a validator is switched off, its reward rate is set to zero so no rewards accrue. The bug is that adding a new reward token later gives every validator, including switched-off ones, a positive rate again, so users can claim rewards for time when the validator was supposed to earn nothing.

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 KlosMitSoss

View all

25 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.