59752 sc high off by one bug in claimabledelegationperiods allows claiming yield for periods after exit
Description
Brief / Intro
Vulnerability Details
// check first for delegations that ended
// endPeriod is not max if the delegation is exited or requested to exit
// if the endPeriod is before the current validator period, it means the delegation ended
// because if its equal it means they requested to exit but the current period is not over yet
if (
endPeriod != type(uint32).max &&
endPeriod < currentValidatorPeriod &&
endPeriod > nextClaimablePeriod
) {
return (nextClaimablePeriod, endPeriod);
}
// check that the start period is before the current validator period
// and if it is, return the start period and the current validator period.
// we use "less than" because if we use "less than or equal", even
// if the delegation started, the current period rewards are not claimable
if (nextClaimablePeriod < currentValidatorPeriod) {
return (nextClaimablePeriod, completedPeriods);
}Impact Details
Recommended Fix
Proof of Concept
Previous59742 sc high user funds get stucked in the contract when validators exits Next59756 sc high exiting delegators stakes can be bricked permanently by the validator signaling an exit after them in the same period
Was this helpful?