Stargate eth strategy rounding bug
The Stargate ETH strategy rounds deposits down to a multiple of 1e12 wei but records the full requested amount as allocated. A withdrawal of a non-aligned amount then reverts because the strategy expects more WETH than was actually deposited, permanently locking the funds.
Originally disclosed on Immunefi
- Disclosed after under an hour
57545 sc medium stargate eth strategy rounding bug
Submitted on Oct 27th 2025 at 05:58:51 UTC by @LogicalJosselyn798 for Audit Comp | Alchemix V3
- Report ID: #57545
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi\\_audit/src/strategies/optimism/StargateEthPoolStrategy.sol
- Impacts:
- Permanent freezing of funds
Description
Brief/Intro
The Stargate ETH strategy (src/strategies/optimism/StargateEthPoolStrategy.sol) rounds deposits down to the nearest 1e12 wei but still reports the full requested amount as allocated. During withdrawal, the strategy insists that the original amount of WETH is present. Because only the rounded “truncated” amount was deposited (and the dust remains as raw ETH), any withdrawal for a non-1e12-aligned amount reverts. A single misaligned allocation permanently bricks the strategy, freezing all funds assigned to it.
Impact Details
- Impact type: Permanent freezing of funds.
- Loss surface: Once a misaligned amount is allocated, neither the vault nor any user can withdraw the associated funds; the strategy becomes unusable.
- Severity: High; assets are locked forever with a single transaction.
References
- Code:
src/strategies/optimism/StargateEthPoolStrategy.sol - PoC:
src/test/strategies/StargateEthPoolStrategy.t.sol(testDeallocateRevertsDueToRoundingDust) - Run:
forge test --match-test testDeallocateRevertsDueToRoundingDust
Link to Proof of Concept
https://gist.github.com/therzv/0b38dfe2f0da270c1c191fcc819531b5
Proof of Concept
Proof of Concept
The exploit is reproduced by src/test/strategies/StargateEthPoolStrategy.t.sol:
forge test --match-test testDeallocateRevertsDueToRoundingDust
Test outline:
- Mint
1 ether + 123 weiof mock WETH to the strategy. - Call
_allocate; only1 etheris deposited after rounding. - Attempt
_deallocatefor the original amount. - The call reverts with
Strategy balance is less than the amount needed, proving the strategy is bricked.
PoC Gist: https://gist.github.com/therzv/0b38dfe2f0da270c1c191fcc819531b5
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 strategy records the requested allocation amount rather than the rounded amount actually deposited, so its accounting and its real balance diverge by the truncated dust.
Impact
A single misaligned allocation could permanently freeze all funds assigned to the strategy, since neither the vault nor any user can withdraw them.
What the attacker needed
Strategy receives a non-1e12-aligned amount
How it was found
- Mint a mock WETH amount that is not a multiple of 1e12 wei to the strategy.
- Call the allocate function, which deposits only the rounded-down amount.
- Attempt to deallocate the original, unrounded amount.
- The call reverts because the strategy balance is less than the amount needed.
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.
A strategy is a contract that puts money to work elsewhere. It quietly rounds the amount it sends down to a whole number of tiny units, but still writes down the bigger number as if all of it was sent. Later, when someone asks for that bigger number back, the contract checks its own balance, sees it is short by a few wei (the smallest unit of ether), and refuses, so the money stays stuck.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.