50691 sc insight no validator limit can lead to dos
Description
Brief/Intro
Vulnerability Details
function claimAll() external nonReentrant returns (uint256[] memory) {
PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
address[] memory tokens = $.rewardTokens;
uint256[] memory claims = new uint256[](tokens.length);
// Process each token
for (uint256 i = 0; i < tokens.length; i++) { // @audit-issue exponential looping
address token = tokens[i];
// Process rewards from all active validators for this token
uint256 totalReward = _processAllValidatorRewards(msg.sender, token);
// Finalize claim if there are rewards
if (totalReward > 0) {
_finalizeRewardClaim(token, totalReward, msg.sender);
claims[i] = totalReward;
emit RewardClaimed(msg.sender, token, totalReward);
}
}
// Clear pending flags for all validators after claiming all tokens
uint16[] memory validatorIds = $.userValidators[msg.sender];
_clearPendingRewardFlags(msg.sender, validatorIds);
// Clean up validator relationships for validators with no remaining involvement
PlumeValidatorLogic.removeStakerFromAllValidators($, msg.sender);
return claims;
}Impact Details
References
Proof of Concept
Previous52937 sc insight redundant raffle ticket balance checkNext49726 sc insight there is a redundant zero address check in the validatorfacet sol that is obsolete and could never be true
Was this helpful?