51651 sc insight redundant array access in removestakerfromvalidator
Description
Vulnerability Details
if (indexToRemove < listLength && stakersList[indexToRemove] == staker) {
address lastStaker = stakersList[listLength - 1]; // Redundant if no swap is needed
if (indexToRemove != listLength - 1) {
stakersList[indexToRemove] = lastStaker;
$.userIndexInValidatorStakers[lastStaker][validatorId] = indexToRemove;
}
stakersList.pop();
}Impact Details
Recommended Fix
References
Proof of Concept
Previous49626 sc insight modulo bias in winner selection in raffleNext52409 sc high asymmetric commission rounding creates systematic accounting drift
Was this helpful?