51988 sc medium plumerewardlogic calculaterewardswithcheckpointsview lacking of checking if the validator is inactive but not slashed
Description
Vulnerability Details
1
2
3
4
// calculate effectiveEndTime when the validator is slashed
if (validator.slashedAtTimestamp > 0 && validator.slashedAtTimestamp < effectiveEndTime) {
effectiveEndTime = validator.slashedAtTimestamp;
}
// 2. Start with the last known, stored cumulative value and its timestamp.
uint256 simulatedCumulativeRPT = $.validatorRewardPerTokenCumulative[validatorId][token];
uint256 lastUpdateTime = $.validatorLastUpdateTimes[validatorId][token];
// 3. If time has passed since the last update, simulate the RPT increase segment by segment.
if (effectiveEndTime > lastUpdateTime) {
...
}
// 4. Now that we have the correctly simulated final cumulative RPT, call the core logic.
return _calculateRewardsCore($, user, validatorId, token, userStakedAmount, simulatedCumulativeRPT);Impact
Proof of Concept
1
2
3
References
Previous51746 sc low depositandbridge function of tellerwithmultiassetsupportpredicateproxy sol can not be pausedNext52519 sc low missing eligibility check before fund transfer in distributeyield leads to permanent loss of yield tokens
Was this helpful?