Vestra DAO $500K Exploit: A Simple Breakdown
The Vestra DAO staking contract's unStake function failed to clear a user's staking data after a successful withdrawal, allowing repeated calls to withdraw the same funds. An attacker could drain the contract's funds, resulting in a $500,000 loss.
medium.com
Published on medium.com
Smart contracts are the backbone of decentralized finance (DeFi), but their design flaws can lead to catastrophic losses. In this case, Vestra DAO suffered a $500,000 exploit due to vulnerabilities in its staking contract
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
The unStake function did not clear the user's staking data or check that the stake was still active before transferring funds, allowing repeated withdrawals.
Impact
An attacker could repeatedly withdraw the same staked funds, draining the contract of $500,000.
What the attacker needed
A staking position in the contract
The fix
The contract should be fixed by adding a check that the stake is active and by clearing the user's staking data after a successful unstake.
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 digital money automatically. In this case, the contract let people take out their staked tokens, but it forgot to mark the stake as finished, so someone could take out the same tokens again and again. This drained the contract's funds.
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.