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 Hayabusaarrow-up-right

  • 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 > nextClaimablePeriod

instead of the correct:

endPeriod >= nextClaimablePeriod

When 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

circle-exclamation

Proof of Concept

chevron-rightPoC: additional helper function and integration test demonstrating the issuehashtag

Add this function to Stargate.sol:

Add the following test to test/integration/Delegation.test.ts and run:

Test (excerpt):

Observed output (relevant lines):

This demonstrates that after requesting exit (endPeriod == 7) and having last claimed period == 6, the contract reports claimable periods starting at 7 and extending to 17, allowing claims for periods after delegation end.

Was this helpful?