The Business & Technology Network
Helping Business Interpret and Use Technology
S M T W T F S
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
 
 
 
 
 
 
 
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31
 
 
 
 
 

Breaking Down CloberDEX’s Costly $501K Exploit

DATE POSTED:December 16, 2024
Overview:

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.

Join @CoinCodeCap on TelegramExploit 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.
  • 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.
  • This action returned the initial 500,000 VSTR along with 20,000 VSTR in yield, marking the staking position as isActive = false.
  • Due to a missing check for the isActive status in the unStake() function, the attacker could repeatedly call unStake()on the same position.
  • 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.
  • These fresh accounts staked 500,000 VSTR each, ensuring the contract’s staking balance remained sufficient.
  • 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:

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.

Breaking Down CloberDEX’s Costly $501K Exploit was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.