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.
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.
Complex staking and reward distribution logic creates a class of vulnerabilities that are easy to miss in traditional audits.
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.
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.
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.
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.
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.
VeChain's Stargate contracts were opened to HackenProof's researcher community for adversarial review following the primary audit.
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.
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.
The researcher submitted the finding through HackenProof's DualDefense program with full reproduction steps using the Hardhat test environment and ProtocolStakerMock.
VeChain promptly fixed the boundary condition and rewarded the researcher through the DualDefense Flash Pool—no unexpected cost to the VeChain project budget.
// 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
}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.