Decoding Vestra DAO’s $500K Exploit

Updated at: December 13, 20247 Mins Read

Author:QuillAudits Team

On December 4, 2024, Vestra_DAO was hacked due to a logic error in in the staking contract's unStake() function. The function failed to check whether a staking position was still active before allowing it to be unstaked, enabling the attacker to repeatedly claim yield from an already unstaked position. Exploiting this flaw, the attacker prepared for a month by initially staking VSTR tokens, then calling the unStake()function multiple times to siphon yield repeatedly. The attack drained approximately $500,000 worth of tokens from the Vestra DAO contract.

About Project:

VSTR is a token that provides semi-decentralized, Web2+Web3 hybrid services, launched and developed by the NFT community "CMLE" (Crypto Monster Limited Edition). Simultaneously, it operates as a Decentralized Autonomous Operation (DAO) project providing DeFi (Decentralized Finance) solutions. The project, built on the Ethereum platform, adheres to ERC20 standards.

Exploit Details:

Attack Transactions: 0x213991ca, 0xa0dcf9b

Vulnerable Contract: 0x8A30d6

Attacker Address: 0x954386

Attacker Contract Address: 0x81AD99

Attack Process:

  • One month before the attack, the attacker staked an initial amount of 500,000 VSTR tokens in the Vestra DAO staking contract.

image (48).png

  • The lock period for staking was set to one month, allowing the attacker to wait and earn yield.
  • After lock period is over, the attacker used the same account to call the unStake() function.

    image (49).png

  • This action returned the initial 500,000 VSTR along with 20,000 VSTR in yield, marking the staking position as isActive = false.

    image (50).png

  • Due to a missing check for the isActive status in the unStake() function, the attacker could repeatedly call unStake()on the same position.

    image (51).png

  • Each subsequent call continued to yield an additional 20,000 VSTR despite the position being inactive.
  • To prevent an underflow in data.totalStaked and data.countUser, the attacker created new accounts or smart contracts.

    image (52).png

  • These fresh accounts staked 500,000 VSTR each, ensuring the contract’s staking balance remained sufficient.

    image (53).png

  • The attacker alternated between unstaking the original position to claim 20,000 VSTR in yield per call and staking fresh tokens using new accounts or contracts to maintain the data.totalStaked and data.countUser value.
  • The process was repeated until the contract's token balance was fully drained, exploiting the unchecked logic to extract as much yield as possible.
  • The attack caused a financial loss of approximately $500,000 in VSTR tokens.

Funds Flow:

See the funds flow here:

1 (2).png

Post Exploit Scenes

Vestra DAO addressed the hack incident via their official Twitter (X) account:

How could they have prevented the Exploit?

  1. Ensure the unStake() function checks whether a staking position is still active before proceeding.
  2. Remove the user's staking data after a successful unstake to prevent repeated claims.
  3. Collaborate with reputable auditors like QuillAudits to analyse smart contracts and identify vulnerabilities.

Why QuillAudits?

Choosing a reputable audit firm like QuillAudits ensures that your protocol undergoes rigorous scrutiny from experienced security professionals. QuillAudits specializes in uncovering critical vulnerabilities and providing actionable remediation strategies. Our expertise helps safeguard your project from attacks, ensuring that security issues are addressed proactively.image (42) (1).png

QuillAudits Team

QuillAudits Team

The QuillAudits team, comprises of expert security researchers & auditors in Web3 security, has completed 1,000+ audits across Ethereum, Polygon, Solana, Arbitrum, BSC, and more, securing $30B+ with 0 exploits, advancing the blockchain ecosystem.

TwitterLinkedInTelegram

Get an audit done today for your
Smart Contract

Join 1000+ leaders who secured themselves from losing Billion Dollars.

Request An Audit

Subscribe to our Newsletter

Get Pure Alpha Straight to Your Inbox. Miss this, and you’re missing out. Insider Secrets - Delivered Right to You. Subscribe now.

Telegram