50783 sc low validator percentage cap does not work properly
Description
Brief / Intro
Vulnerability Details
function _validateValidatorPercentage(
uint16 validatorId, uint256 stakeAmount
) internal view {
PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
uint256 previousTotalStaked = $.totalStaked - stakeAmount;
// Check if exceeding validator percentage limit
if (previousTotalStaked > 0 && $.maxValidatorPercentage > 0) {
uint256 newDelegatedAmount = $.validators[validatorId].delegatedAmount;
@> uint256 validatorPercentage = (newDelegatedAmount * 10_000) / $.totalStaked;
@> if (validatorPercentage > $.maxValidatorPercentage) {
revert ValidatorPercentageExceeded();
}
}
}Impact Details
Proof of Concept
References
Previous52961 sc high theft of yield from the distributor Next51320 sc low malicious teller parameter allow event data manipulation
Was this helpful?