Incorrect reward calculation for slashed validators due to single segment time handling
The reward calculation for slashed validators uses a single time segment with a static reward rate, ignoring intermediate rate changes. This causes incorrect rewards, leading to underpayment of users or overpayment by the protocol.
- Disclosed after under an hour
52186 sc low incorrect reward calculation for slashed validators due to single segment time handling
Submitted on Aug 8th 2025 at 15:20:58 UTC by @DSbeX for Attackathon | Plume Network
- Report ID: #52186
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/lib/PlumeRewardLogic.sol
- Impacts:
- Theft of unclaimed yield
Description
Brief/Intro
The calculateRewardsWithCheckpoints function contains a vulnerability in its slashed validator reward calculation logic. By using a single time segment with a static reward rate between the last update and slash time, it ignores intermediate reward rate changes. This results in reward miscalculations that would cause financial losses to users (through underpayment) or protocol drains (through overpayment) if exploited in production.
Vulnerability Details
The vulnerability is in the slashed validator handling within calculateRewardsWithCheckpoints. When a validator is slashed, rewards should be calculated up to the slash timestamp, accounting for all reward rate changes during this period. However, the current implementation uses a single continuous segment with a static rate:
} else {
// Slashed validator case
uint256 currentCumulativeRewardPerToken = ...;
uint256 effectiveEndTime = validator.slashedAtTimestamp;
if (effectiveEndTime > validatorLastUpdateTime) {
uint256 timeSinceLastUpdate = effectiveEndTime - validatorLastUpdateTime;
uint256 effectiveRewardRate =
getEffectiveRewardRateAt($, token, validatorId, validatorLastUpdateTime).rate;
//Vulnerable single-segment calculation
uint256 rewardPerTokenIncrease = timeSinceLastUpdate * effectiveRewardRate;
currentCumulativeRewardPerToken += rewardPerTokenIncrease;
}
return _calculateRewardsCore(...);
}
- Uses one continuous time segment from
validatorLastUpdateTimetoeffectiveEndTime - Static rate application: Applies the initial reward rate at
validatorLastUpdateTimefor the entire duration - Checkpoint ignorance: Fails to account for intermediate reward rate changes captured in
validatorRewardRateCheckpoints
Impact Details
{% hint style="warning" %} Reward-rate changes during unprocessed periods can cause large underpayments to users or overpayments by the protocol. Because slashed-validator calculations are final, those errors are permanent and compound as delayed slashes or repeated rate changes amplify the discrepancy. Miscalculated base rewards also corrupt validator commission accounting, creating a stealth drain that looks like minor rounding but adds up. {% endhint %}
References
<details> <summary>Relevant code references</summary>- calculateRewardsWithCheckpoints - https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/lib/PlumeRewardLogic.sol#L374
- getEffectiveRewardRateAt returns static rate instead of segmented rates - https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/plume/src/lib/PlumeRewardLogic.sol#L544
Proof of Concept
{% stepper %} {% step %}
Setup
- Validator is active and earning rewards normally
- Last reward update occurred at time T0
- Reward rate at T0 is R1 (100 tokens/day) {% endstep %}
{% step %}
Reward rate update (T1)
- Protocol admin updates reward rate to R2 (200 tokens/day) at T1
- New checkpoint created at T1 with R2
- Validator continues operating but hasn't had its rewards updated since T0 {% endstep %}
{% step %}
Validator slashing (T2)
- Validator is slashed at time T2
validator.slashedflag set to truevalidator.slashedAtTimestampset to T2- Validator stops participating after T2 {% endstep %}
{% step %}
Reward calculation trigger
- User claims rewards after T2
- System calls
calculateRewardsWithCheckpoints() - Since validator is slashed, it enters the vulnerable code path {% endstep %}
{% step %}
Flawed calculation
- System calculates entire period (T0 to T2) at initial rate R1
effectiveRewardRate = getEffectiveRewardRateAt(validatorLastUpdateTime)→ returns R1 (rate at T0)- rewardPerTokenIncrease = (T2 - T0) * R1 {% endstep %}
{% step %}
Incorrect reward distribution
- User receives rewards for T0-T2 period calculated entirely at R1
Correct calculation should be:
- T0-T1 segment: (T1 - T0) × R1
- T1-T2 segment: (T2 - T1) × R2
Impact:
- Protocol underpaying user by (T2-T1) × (R2 - R1) tokens
- Validator commission also miscalculated based on wrong base rewards {% endstep %} {% endstepper %}
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
The code uses a single time segment with the reward rate at the last update time, instead of iterating over checkpoints to apply rate changes.
Impact
Reward-rate changes during unprocessed periods can cause large underpayments to users or overpayments by the protocol, and these errors are permanent and compound.
What the attacker needed
Validator is slashed; Reward rate changed between last update and slash; User claims rewards after slash
The fix
The calculation should account for intermediate reward rate changes by iterating over checkpoints between the last update and slash time.
How it was found
- Validator is active and earning rewards normally, with last update at T0 and rate R1.
- Protocol admin updates reward rate to R2 at T1, creating a new checkpoint.
- Validator is slashed at T2, setting slashed flag and timestamp.
- User claims rewards after T2, triggering calculateRewardsWithCheckpoints.
- System calculates entire period T0-T2 using rate R1, ignoring the rate change at T1.
- User receives incorrect rewards based on R1 for the whole 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.
When a validator is slashed, the system calculates rewards from the last update to the slash time. The bug is that it uses the reward rate from the start of that period for the whole time, even if the rate changed in between. This means users might get too little or the protocol might pay too much.
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.