Status DataClose notification

The Delegator That Never Left: How DualDefense Caught a Critical VeChain Staking Flaw Before Mainnet

A boundary condition in VeChain Stargate's delegation reward logic allowed exited stakers to keep claiming VTHO from active delegators' yield pools. Caught by a HackenProof DualDefense researcher before the Hayabusa hard fork—and fixed with a $1,530 bounty.

  • ClientVeChain
  • IndustryPublic Blockchain / RWA
  • Program TypeDualDefense (Audit + Crowdsourced)
  • ScopeStargate Smart Contracts

01 — Case Overview

VeChain is a public blockchain platform connecting blockchain technology with real-world action—making impact measurable, verifiable, and economically meaningful. VeChain has been listed on HackenProof since May 2018 and has run three bug bounty programs and two DualDefense audits as part of a continuous security approach.

Stargate is VeChain's upcoming smart-contract suite for the Hayabusa hard fork. It defines how VET holders delegate stake to validator nodes, how delegation exits are handled, and how rewards are calculated and distributed. A DualDefense audit covering November 17–December 10, 2025 uncovered a critical logic flaw in its reward calculation.

CRITICAL FINDING
1Critical vulnerability found—a staking reward boundary condition that let exited delegators steal active users' yield
REWARD PAID
$1,530Bounty awarded to the researcher from the DualDefense Flash Pool—no unexpected cost to VeChain
AUDIT DURATION
24 daysDuration of the DualDefense audit (Nov 17–Dec 10, 2025)
EXPLOITED INCIDENTS
0User funds at risk at time of fix—resolved before Hayabusa hard fork launch

02 — Challenges

Complex staking and reward distribution logic creates a class of vulnerabilities that are easy to miss in traditional audits.

Boundary conditions in reward windows

Off-by-one errors in period range calculations are notoriously hard to catch in manual code review—especially when the flaw only manifests over multiple validator periods.

State evolution across epochs

The vulnerability only became exploitable after the delegation exit was finalized and new periods were completed—a time-delayed attack pattern that unit tests may not simulate.

Fixed reward pool dilution

Because each period's delegator rewards are fixed, any extra VTHO claimed by an exited NFT is directly subtracted from active delegators—making this a theft-of-yield scenario.

Coverage gap after formal audit

Traditional audits cover code at a point in time. DualDefense added a second layer of crowdsourced review after the primary audit—catching what the first pass missed.

03 — The DualDefense Finding

DualDefense combined a traditional smart contract audit with HackenProof's crowdsourced community as a second review layer—the critical finding came from the crowd, not the primary auditor.

  1. 1

    DualDefense audit period (Nov 17–Dec 10, 2025)

    VeChain's Stargate contracts were opened to HackenProof's researcher community for adversarial review following the primary audit.

  2. 2

    Vulnerability identified in _claimableDelegationPeriods

    An independent researcher found that the condition endPeriod > nextClaimablePeriod fails when endPeriod == nextClaimablePeriod—causing the ended-delegation branch to be skipped and the NFT treated as still active.

  3. 3

    Exploit mechanics confirmed

    As completedPeriods grows over time, the exited NFTs' claimable range keeps expanding. It computes a positive reward using its full effectiveStake, divided by active delegators' stake—draining yield that belongs to current stakers.

  4. 4

    Responsible disclosure via HackenProof

    The researcher submitted the finding through HackenProof's DualDefense program with full reproduction steps using the Hardhat test environment and ProtocolStakerMock.

  5. 5

    Fix and $1,530 reward

    VeChain promptly fixed the boundary condition and rewarded the researcher through the DualDefense Flash Pool—no unexpected cost to the VeChain project budget.

  • Solidity
  • Staking
  • Reward logic
  • DualDefense
  • Hayabusa hard fork
  • VTHO

Root cause (simplified):

// Bug: equality case not handled — exited delegation treated as active
if (
    endPeriod != type(uint32).max &&
    endPeriod < currentValidatorPeriod &&
    endPeriod > nextClaimablePeriod   // <-- should be >= to catch equality
) {
    return (nextClaimablePeriod, endPeriod); // ended delegation
}
// Falls through to active branch when endPeriod == nextClaimablePeriod
if (nextClaimablePeriod < currentValidatorPeriod) {
    return (nextClaimablePeriod, completedPeriods); // incorrectly treated as active
}

04 — Results

VULNERABILITY SEVERITY
CriticalSeverity—theft of unclaimed yield from active delegators, enabling ongoing financial loss if left unpatched
REWARD PAID
$1,530Bounty paid from the DualDefense Flash Pool—funded by the staking community, not by VeChain
STATUS
FixedVulnerability resolved before the Hayabusa hard fork—zero user impact
COVERAGE LAYERS
2xSecurity layers applied: traditional audit followed by DualDefense crowdsourced review

05 — Key Takeaway

VeChain's Stargate case illustrates why DualDefense matters for complex, long-running protocol logic. Traditional audits deliver coverage at a point in time—DualDefense adds a second adversarial layer that targets the gaps. By combining both, VeChain caught a critical staking flaw before it could affect any user after the Hayabusa launch.