Skip to content
Business logic Audit finding Intermediate

Cross-Vault Reward Arbitrage in StakeV2 Allows Yield Theft

The StakeV2 contract does not track which vault a user's reward shares came from, so a user can claim shares from any whitelisted vault. An attacker can earn shares in a low-value vault and then claim the same number of shares from a high-value vault, stealing yield from other stakers.

DoD4uFN Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#41639 [SC-Insight] Cross-Vault Reward Arbitrage in StakeV2 Allows Yield Theft

Submitted on Mar 17th 2025 at 07:55:55 UTC by @DoD4uFN for Audit Comp | Yeet

Description

Brief/Intro

The StakeV2 contract allows users to claim staking rewards in the form of shares from different MoneyBrinter vaults. However, due to improper tracking of reward distributions, users can claim rewards from any whitelisted vault, regardless of which vault was used for their reward distribution. This enables users to exchange lower-value shares for higher-value shares, effectively stealing yield from other stakers.

Vulnerability Details

In StakeV2, when the manager calls executeRewardDistributionYeet, the Zapper contract performs a series of operations to convert YEET tokens into vault shares, which are then allocated as rewards to stakers. However, the contract does not properly associate users’ earned rewards with the specific MoneyBrinter vault from which they originated.

  • The _handleVaultShares function updates the total vault shares but does not track which vault the shares belong to.
  • The _verifyAndPrepareClaim function allows users to withdraw their earned shares from any whitelisted MoneyBrinter vault, without verifying that their rewards originated from that specific vault.
  • As a result, a user who earned shares from a vault with a lower share price can claim shares from a vault with a higher share price, effectively gaining more value than they are entitled to.

Example Scenario:

  1. A user stakes YEET and earns 10 shares in Vault A, where each share is worth $5 (total $50).
  2. The user calls claimRewardsInNative, but instead of withdrawing from Vault A, they specify Vault B, where each share is worth $10.
  3. The contract does not verify the vault mismatch and allows the user to withdraw 10 shares from Vault B, giving them $100 instead of $50.
  4. This results in a net loss of $50 to the protocol and other stakers.

The issue stems from the lack of vault-specific reward tracking in _handleVaultShares and _verifyAndPrepareClaim, allowing a user to arbitrage reward shares across different vaults.

Impact Details

This vulnerability allows users to unfairly claim higher-value rewards at the expense of other stakers, leading to direct yield loss to the honest stakers. Depending on the total TVL of the protocol, the impact could lead to significant fund misallocations.

References

StakeV2.sol:executeRewardDistributionYeetStakeV2.sol:_handleVaultSharesStakeV2.sol:claimRewardsInNativeStakeV2.sol:_verifyAndPrepareClaim

Recommended Fix

  • Track rewards on a per-vault basis to ensure users can only claim from the vault where their rewards originated.
  • Modify _handleVaultShares to store vault-specific reward information.
  • Update _verifyAndPrepareClaim to enforce reward claims from the correct vault.

Proof of Concept

Proof of Concept

  1. Manager distributes rewards into a high-value MoneyBrinter vault.
  2. User stakes tokens.
  3. Manager distributes rewards into a low-value MoneyBrinter vault.
  4. User earns shares of the low-value vault.
  5. User claims rewards but specifies a high-value MoneyBrinter vault.
  6. Contract fails to validate vault-specific rewards and allows the user to claim overvalued shares.
  7. User profits by swapping low-value shares for high-value ones, stealing yield from other stakers.

The original report as published on Immunefi, by DoD4uFN. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the contract does not associate earned reward shares with the specific vault they originated from, allowing claims from any whitelisted vault.

Impact

Users could unfairly claim higher-value rewards at the expense of other stakers, leading to direct yield loss to honest stakers.

What the attacker needed

Whitelisted vaults with different share values; user stakes tokens; manager distributes rewards

The fix

The contract should track rewards on a per-vault basis so users can only claim from the vault where their rewards originated.

How it was found

  1. Manager distributes rewards into a high-value vault.
  2. User stakes tokens.
  3. Manager distributes rewards into a low-value vault.
  4. User earns shares of the low-value vault.
  5. User claims rewards but specifies a high-value vault.
  6. Contract fails to validate vault-specific rewards and allows the user to claim overvalued shares.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Staking rewards are paid in shares from different vaults, and each vault's shares have a different value. The contract forgets to remember which vault your shares came from, so you can ask for shares from a more valuable vault instead. This lets you take more value than you earned, at the expense of other people staking.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by DoD4uFN

View all

6 more disclosed reports, best first.

More from Yeet

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.