Utopia Hack
What happened
Utopia, a BEP20 reward token on BNB Smart Chain, was exploited on July 20, 2023 for roughly $119K-$120K of WBNB drained from its PancakeSwap liquidity pool.
The token's transfer logic included an _airdrop routine that, on every transfer, derived a series of "random" addresses from public on-chain values and set each one's balance to exactly 1 wei. Because the seed used only the last airdrop address, the block number and the transfer's from/to addresses, an attacker could steer one derived address onto the Utopia/WBNB pair and overwrite the pool's Utopia balance. After syncing the pair, a few wei of Utopia bought almost all of the WBNB reserve. The same _airdrop code was used by the FFIST token, exploited the same day.
**Block data**
- Attacker:
0xe84ef3615b8df94c52e5b6ef21acbf0039b29113 - Attack contract:
0x6191203510c2a6442faecdb6c7bb837a76f02d23 - Vulnerable token:
0xb1da08c472567eb0ec19639b1822f578d39f3333 - Exploit tx:
0xeb4eb487f58d39c05778fed30cd001b986d3c52279e44f46b2de2773e7ee1d5e
How it happened
- The attacker contract swapped a dust amount of WBNB (0.01 in the public reproduction) for Utopia to hold a small balance.
- It sent tiny Utopia transfers and called
skimon the Utopia/WBNB pair, choosing parameters so that the pseudo-random address computed by_airdropfromlastAirdropAddress,block.numberand the from/to addresses landed on the pair. _airdropthen assigned_balances[pair] = 1wei instead of adding to it, wiping out the pool's real Utopia balance.- Calling
syncmade the pair record that near-zero Utopia balance as its reserve. - The attacker transferred 32 wei of Utopia to the pair and swapped it out for nearly the entire WBNB reserve.
Protocol details
Security review history
- Cyberscope View report
Evidence
- report @PeckShieldAlert incident report twitter.com
- transaction bscscan.com transaction 0x43ae…2f02 bscscan.com
- transaction bscscan.com transaction 0xeb4e…1d5e bscscan.com
- address bscscan.com address 0x6191…2d23 bscscan.com
- address bscscan.com address 0xe84e…9113 bscscan.com
- analysis DeFiLlama defillama.com
- analysis DeFiHackLabs Utopia_exp.sol (PoC with @KeyInfo) raw.githubusercontent.com
- analysis DeFiHackLabs 2023 incident list (20230720 Utopia - Business Logic Flaw) raw.githubusercontent.com
- analysis DeFiScreener: Efficient DeFi Attack Pre-screening in Smart Contracts (arXiv 2607.22184) arxiv.org
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.