Vestra’s $500K Yield Reuse Flaw, Mosca’s Incomplete State Res
Vestra's unStake() function failed to check if a staking position was still active, allowing the attacker to repeatedly claim yield from the same position. Mosca's exitProgram() left USDT and USDC balances unchanged after withdrawal, enabling repeated withdrawals.
Vestra lost $500K after failing to check if staking positions were still active, allowing repeated yield withdrawals. Mosca leaked $19.5K due to a flawed state reset that didn’t clear USDT and USDC balances.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely missing state checks: Vestra did not verify a staking position was still active before paying yield, and Mosca did not reset all balance fields after withdrawal.
Impact
The attacker could repeatedly claim yield from an already unstaked position, leading to a $500K loss for Vestra.
What the attacker needed
A staking position with expired lock; ability to deploy contracts
The fix
The unStake() function should check that the staking position is still active before allowing yield withdrawal.
How it was found
- Stake 500,000 VSTR tokens to earn yield after the lock period.
- After the lock expired, call unStake() to withdraw the 500,000 VSTR plus 20,000 VSTR in yield.
- Repeatedly call unStake() on the same position to keep earning 20,000 VSTR per call.
- Deploy new contracts to stake 500,000 VSTR each time to keep the pool's total balance intact.
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 write-up has not been written yet. The Original tab links to the source.
A smart contract is a program on a blockchain that holds and moves money automatically. In Vestra, the code let someone collect the reward for staking tokens over and over from the same stake, because it never checked that the stake had already been closed. In Mosca, the code forgot to reset some of the user's balances after paying out, so the user could withdraw again.
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.