SteamSwap Hack
What happened
Steam Swap, a BNB Chain trading platform, lost about $105,000 on June 6, 2024 when two attackers exploited its MineSTM contract. The contract's sell function priced STM redemptions from the live reserves of the BSC-USD/STM PancakeSwap pair, so a large swap in the same transaction changed how much liquidity it paid out. The first attacker, using a 500,000 BSC-USD flash loan, took about $91,670.
A second attacker, likely a copycat, repeated the trick for about $13,892. Neptune Mutual noted that the contract had been deployed about 16 hours before the attack and had not been audited, and it raised the possibility of an inside job; that suspicion is unproven. The team said it would commission an audit after the incident.
How it happened
- The attacker flash-borrowed 500,000 BSC-USD from a PancakeSwap V3 pool.
- It swapped the borrowed BSC-USD for about 2.74 million STM in the BSC-USD/STM pair, which skewed the pair's reserves.
- It called
updateAllowance()onMineSTM, approved STM, and calledsell()several times. Each call computedlpAmount = amount * totalSupply / (2 * r1)from the manipulated reserver1and removed that much LP liquidity to the caller, returning more BSC-USD and STM than the tokens were worth. - The attacker sold the extra STM, repaid the flash loan plus fee, and kept about $91,670. A second address later ran the same sequence for about $13,892.
Protocol details
Evidence
- report SlowMist Security Alert on SteamSwap x.com
- analysis DeFiLlama defillama.com
- analysis How Was Steam Swap Exploited? (Neptune Mutual, Wayback copy) neptunemutual.com
- analysis DeFiHackLabs SteamSwap_exp.sol raw.githubusercontent.com
- analysis MineSTM Hack Analysis (SolidityScan) blog.solidityscan.com
- analysis DeFiHackLabs MineSTM_exp.sol raw.githubusercontent.com
- analysis SlowMist Hacked, BSC ecosystem list (2024-06-07 SteamSwap (STM)) hacked.slowmist.io
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.