60023 sc insight unchecked address 0 validator in unstake
Description
Brief / Intro
Vulnerability Details
Current Implementation (excerpt)
// Line 260-263: Called unconditionally
(, , , , uint8 currentValidatorStatus, ) = $.protocolStakerContract.getValidation(
delegation.validator // Can be address(0) for never-delegated tokens
);
// Line 266-269: Condition checks for EXITED or PENDING
if (
currentValidatorStatus == VALIDATOR_STATUS_EXITED ||
delegation.status == DelegationStatus.PENDING
) {
// Line 271-273: Another unconditional external call with address(0)
(, , , uint32 oldCompletedPeriods) = $
.protocolStakerContract
.getValidationPeriodDetails(delegation.validator);
// Line 276-282: Updates effective stake
_updatePeriodEffectiveStake(...);
}What's Currently Validated
What's NOT Validated
Why This Matters
Proof Tests
Impact Details
Security Best Practices
Code Optimizations and Enhancements
References
Code Locations
Test Coverage
Proof of Concept / When This Insight is Valuable
Suggested Fix (conceptual)
Previous60019 sc high off by one in stargate sol claimabledelegationperiods lets exited nfts siphon validator rewards leading to protocol insolvencyNext60027 sc high stuck funds for the later delegators due to an edge case led to double decreasing effective stakes
Was this helpful?