Skip to content
Business logic Audit finding Intermediate

Unclaimed staker rewards lost when admin clears validator records without checking pending rewards

The admin function that clears validator records does not check for or process pending rewards, so users lose rewards they earned before a slashing event. An attacker cannot exploit this directly, but the admin action permanently freezes user rewards.

farman1094 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

51842 sc high unclaimed staker rewards lost when admin clears validator records without checking pending rewards

Submitted on Aug 6th 2025 at 07:43:59 UTC by @farman1094 for Attackathon | Plume Network

Description

Brief / Intro

The function ManagementFacet::adminBatchClearValidatorRecords allows an administrator to delete user records for a validator without checking for or processing any pending rewards. This results in users permanently losing access to rewards they legitimately earned before a slashing event or before the record was cleared.

Vulnerability Details

When a validator is slashed, a staker may lose some or all of their staked amount, but can still claim any rewards accrued up to the slashAtTimestamp. However, the ManagementFacet::adminBatchClearValidatorRecords function is used to remove user records for a validator without verifying whether those users have unclaimed rewards. As a result, important user state is updated:

function adminBatchClearValidatorRecords(address[] calldata users, address validator) external onlyAdmin {
...
   $.userValidatorStakes[user][slashedValidatorId].staked = 0;
                    // Decrement user's global stake
                    if ($.stakeInfo[user].staked >= userActiveStakeToClear) {
                        $.stakeInfo[user].staked -= userActiveStakeToClear;
...
}

This breaks the protocol’s intended safety for stakers: even if their stake is slashed, their pending rewards up to slashedAtTimestamp should remain claimable. Clearing state without checking pending rewards directly causes permanent loss of those rewards.

The reward update function returns early when the user's stake is zero:

// PlumeRewardLogic::updateRewardsForValidatorAndToken
     if (userStakedAmount == 0) {
            // If user has no stake, there's nothing to calculate. We still need to update the user's "paid" pointers
            // to the latest global state to prevent incorrect future calculations.
            // First, ensure the validator's state is up-to-date.
            if (!$.validators[validatorId].slashed) {
                updateRewardPerTokenForValidator($, token, validatorId);
            }
            $.userValidatorRewardPerTokenPaid[user][validatorId][token] =
                $.validatorRewardPerTokenCumulative[validatorId][token];
            $.userValidatorRewardPerTokenPaidTimestamp[user][validatorId][token] = block.timestamp;
            return;

Because of this early return, rewards accrued between the user's last update and slashedAtTimestamp are effectively lost.

Impact Details

This vulnerability results in direct, irreversible loss of user rewards. Even if the user loses their staked funds due to slashing, they are still entitled to rewards legitimately earned from lastUpdatedTime to slashedAtTimestamp. The admin clearing logic does not check for pending rewards before wiping state, causing permanent loss of those reward funds.

Proof of Concept

{% stepper %} {% step %}

Step 1 — Setup

Assume Alice is a staker who has deposited funds with a validator. The validator is actively generating rewards, and Alice accrues unclaimed rewards over time; her per-validator state hasn't been updated to reflect the most recent accruals. {% endstep %}

{% step %}

Step 2 — Validator is slashed

The validator is slashed. According to protocol rules, Alice should still be able to claim her rewards up to slashedAtTimestamp. The reward calculator confirms this by capping the effective end time at slashedAtTimestamp:

// calculateRewardsWithCheckpoints
  uint256 currentCumulativeRewardPerToken = $.validatorRewardPerTokenCumulative[validatorId][token];
  uint256 effectiveEndTime = validator.slashedAtTimestamp;
  ...
  return _calculateRewardsCore($, user, validatorId, token, userStakedAmount, currentCumulativeRewardPerToken);

{% endstep %}

{% step %}

Step 3 — Admin clears validator records

An admin calls ManagementFacet::adminBatchClearValidatorRecords to clear the slashed validator's records. The function:

  • Removes Alice’s stake record for the slashed validator.
  • Sets Alice’s stake to zero for that validator.
  • Decrements Alice’s global stake by the cleared amount.

Relevant excerpt:

if (userActiveStakeToClear > 0) {
    $.userValidatorStakes[user][slashedValidatorId].staked = 0;
    // Decrement user's global stake
    if ($.stakeInfo[user].staked >= userActiveStakeToClear) {
        $.stakeInfo[user].staked -= userActiveStakeToClear;
    } else {
        $.stakeInfo[user].staked = 0;
    }

{% endstep %}

{% step %}

Step 4 — Attempt to claim later

When Alice later tries to claim rewards (e.g., via RewardsFacet::claim), the claim flow calls _processValidatorRewards -> PlumeRewardLogic::updateRewardsForValidatorAndToken. Since Alice's per-validator stake is now zero, the update function returns early and does not calculate rewards:

// updateRewardsForValidatorAndToken
if (userStakedAmount == 0) {
    // ...
    if (!$.validators[validatorId].slashed) {
        updateRewardPerTokenForValidator($, token, validatorId);
    }
    $.userValidatorRewardPerTokenPaid[user][validatorId][token] =
        $.validatorRewardPerTokenCumulative[validatorId][token];
    $.userValidatorRewardPerTokenPaidTimestamp[user][validatorId][token] = block.timestamp;
    return;
}

All unclaimed rewards accrued between Alice's last reward update and slashedAtTimestamp are therefore not computed nor credited. {% endstep %}

{% step %}

Step 5 — Result

Alice loses any unclaimed rewards from the period up to slashedAtTimestamp permanently. There is no mechanism in the admin clear function to preserve or process pending rewards before wiping user state. {% endstep %} {% endstepper %}

References / Affected Files

(End of report)

The original report as published on Immunefi, by farman1094. 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 admin clear function sets user stake to zero without first updating and crediting accrued rewards, and the reward update logic returns early when stake is zero.

Impact

Users permanently lose unclaimed rewards that they earned before a slashing event, because the admin clear function wipes their state without processing those rewards.

What the attacker needed

Admin calls clear function; user has unclaimed rewards; validator was slashed

The fix

The admin clear function should process and credit any pending rewards before clearing user records, or the reward logic should not return early when stake is zero if rewards are owed.

How it was found

  1. Alice stakes funds with a validator and accrues unclaimed rewards.
  2. The validator is slashed, but rewards up to the slash timestamp should remain claimable.
  3. An admin calls adminBatchClearValidatorRecords, which sets Alice's stake for that validator to zero and decrements her global stake.
  4. When Alice later tries to claim, the reward update function returns early because her stake is zero, so no rewards are calculated.
  5. Alice permanently loses the unclaimed rewards.

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.

When people stake cryptocurrency with a validator, they earn rewards over time. If the validator misbehaves and is 'slashed' (penalised), users can still claim rewards earned up to that moment. Here, an admin function wipes out user records without first paying those pending rewards, so the rewards are lost forever.

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 farman1094

View all

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