51510 sc low bypass of maxvalidatorpercentage allows a validator to exceed the decentralisation cap
Description
Brief/Intro
Vulnerability Details
uint256 previousTotalStaked = $.totalStaked - stakeAmount; // correct pre-stake total (unused)
if (previousTotalStaked > 0 && $.maxValidatorPercentage > 0) {
uint256 newDelegatedAmount = $.validators[validatorId].delegatedAmount; // already includes stake
uint256 validatorPercentage = (newDelegatedAmount * 10_000) / $.totalStaked; // **post-stake** total
if (validatorPercentage > $.maxValidatorPercentage) {
revert ValidatorPercentageExceeded();
}
}Impact Details
Fix
References
Proof of Concept
Previous50713 sc high deployer s default admin role enables self grant of upgrader role bypassing implementation whitelistNext51941 sc high token creator can revoke factory s upgrade capability permanently blocking upgrades
Was this helpful?