52186 sc low incorrect reward calculation for slashed validators due to single segment time handling
Description
Brief/Intro
Vulnerability Details
} 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(...);
}Impact Details
References
Proof of Concept
Previous52964 sc high if a new reward token is added during a the period a validator is inactive the validator will still earn rewards commission for some of the duration in which they were inactive Next51970 sc low spin streak computation relies on oracle callback time any third party delay can reset the user s streak and block jackpot eligibility
Was this helpful?