59665 sc high delegators can claim rewards beyond delegation end
Submitted on Nov 14th 2025 at 16:01:20 UTC by @danvinci_20 for Audit Comp | Vechain | Stargate Hayabusa
Report ID: #59665
Report Type: Smart Contract
Report severity: High
Target: https://github.com/immunefi-team/audit-comp-vechain-stargate-hayabusa/tree/main/packages/contracts/contracts/Stargate.sol
Impacts: Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Summary
The system incorrectly determines the claimable reward periods for a delegated NFT after the delegator has requested to exit.
This occurs because the ended-delegation branch uses a strict comparison:
endPeriod > nextClaimablePeriodinstead of the correct:
endPeriod >= nextClaimablePeriodWhen endPeriod == nextClaimablePeriod, the code fails to recognize that the delegation has already ended and instead treats it as still active. As a result, once new validator periods are completed, the delegator can call claimRewards() to claim rewards for periods after their delegation has already ended, even though their stake is no longer contributing and the validator is no longer using their VET.
This allows delegators to drain rewards for periods they did not stake for, extracting unearned VTHO and destabilizing the reward pool.
Vulnerability Details
Relevant code paths:
Core logic is inside _claimableDelegationPeriods:
Because the condition uses a strict endPeriod > nextClaimablePeriod, the ended-delegation branch does not trigger when the staker has claimed up to exactly endPeriod - 1.
The system incorrectly assumes the delegation is still active and falls through to this logic:
This returns:
Meaning the delegator can now claim rewards for all periods between endPeriod and the current completed period, even though the validator is no longer using their stake.
Impact
Delegators can claim VTHO rewards for validator periods after their delegation has ended, receiving rewards they did not earn.
Recommendation
Fix the boundary condition in the ended-delegation branch to be inclusive:
This ensures when the delegator has claimed up to endPeriod - 1 (so nextClaimablePeriod == endPeriod), the ended-delegation branch will correctly cap claimable periods to the delegation end.
Proof of Concept
Was this helpful?