51987 sc high validators will be able to steal more commission from users that isn t the commission to be charged
Description
Vulnerability Details
function findCommissionCheckpointIndexAtOrBefore(
PlumeStakingStorage.Layout storage $,
uint16 validatorId,
uint256 timestamp
) internal view returns (uint256) {
PlumeStakingStorage.RateCheckpoint[] storage checkpoints = $.validatorCommissionCheckpoints[validatorId];
uint256 len = checkpoints.length;
if (len == 0) {
return 0; // No checkpoints, caller uses current validator.commission
}
uint256 low = 0;
uint256 high = len - 1;
uint256 ans = 0;
bool foundSuitable = false;
while (low <= high) {
uint256 mid = low + (high - low) / 2;
if (checkpoints[mid].timestamp <= timestamp) {
ans = mid;
foundSuitable = true;
low = mid + 1;
} else {
if (mid == 0) {
break;
}
high = mid - 1;
}
}
return ans;
}1
2
3
4
Where the wrong commission is applied in reward calculation
Impact Details
Suggested Mitigation
References
Proof of Concept
Previous51369 sc high unbounded iteration gas dos in validatetokenforclaim Next52203 sc medium griefing attack on arctokenpurchase setpurchasetoken function via front running
Was this helpful?