xToken Hack

TOTAL LOST $4.5M
Medium Flashloan Price Oracle Attack / Flash Loan Attack ethereum

Summarize with AI

Affected Chain ethereum Incident surface
Recovered - No recovery reported
All-Time Rank #451 By amount stolen
Auditors 1 Prior security audit

Incident Overview

The exploitation of Synthetix and Bancor protocols led to a loss of $24.5M in ETH, BNT, SNX, and xBNTa tokens.

The attacker initiated the exploit by borrowing a 61.8k ETH flash loan from dYdX. They then deposited 10k ETH to borrow 564k SNX on Aave and swapped 5.5k ETH for 700k SNX on SushiSwap. The attacker sold 1.2M SNX for 818 ETH on Uniswap v2, significantly reducing the SNX price. They then used only 0.12 ETH to mint 1.2B xSNXa, because the protocol buys SNX through Kyber, who in turn led to use Uniswap v2 for this swap. However, within the protocol, the xSNXa price turned out to be normal, which made it possible to swap 105M xSNX into 414 ETH. The attacker then began to do reverse swaps in SushiSwap and Uniswap and repaid loans in Aave. They began to sell the existing xSNXa to the Balancer SNX/ETH/xSNXa (25/25/50) pool, repaid the flash loan to dYdX, issued xBNTa four times for 0.03 ETH, which ultimately gave them 3.9B xBNTa, and swapped half of xBNTa to 781k BNT.

Stolen funds:

- 2.4k ETH ($10.3M)

- 781k BNT ($6.2M)

- 407k SNX ($8M)

- 1.9B xBNTa

The attacker's address:

https://etherscan.io/address/0x07e02088…79dc3e

The transaction behind the attack:

https://etherscan.io/tx/0x7cc7d935…40da22

Incident Report

Protocol / Project xToken
Date of Incident
Affected Chain(s) ethereum
Attack Technique Flashloan Price Oracle Attack / Flash Loan Attack
Classification Ecosystem / Token
Primary Source View Post-Mortem

Protocol Information

Protocol Type Liquidity manager
Affected Token XTK
Smart Contract Language Solidity
Official Website xtoken.market/
Protocol Twitter/X @xtokenmarket
Team Anonymous
Source Code Unverified

Market Context at Time of Hack

Token Categories
Marketplace Centralized Exchange (CEX) Token Discount Token Ethereum Ecosystem Made in China

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of flashloan price oracle attack / flash loan attack and Solidity and EVM internals
Capital Required Flash loan capital (borrowed atomically, zero upfront cost)
On-Chain Access Ability to interact with ethereum smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in xToken's contract logic - root cause: ecosystem / token
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Yes — skilled auditors routinely flag Flashloan Price Oracle Attack / Flash Loan Attack vulnerabilities in code review
Audited by Audit Report 1 — still lost $4.5M. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to xToken, these are the critical security checks that could have prevented this incident (August 2021).

  • Verify all logic paths related to Flashloan Price Oracle Attack / Flash Loan Attack are guarded by proper access controls and input validation - see the Flash Loans Attacks attack class for patterns
  • Audit oracle price feeds for manipulation risks - ensure time-weighted average prices (TWAPs) or multi-source aggregators are used, not spot prices
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Security Audit History

Related Attack Classes

The technique used in this hack maps to these vulnerability classes in our security curriculum:

See all Flash Loans Attacks examples →

Sources & References

Learn to Prevent the Next xToken

The xToken hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial