BiSwap Hack
What happened
On June 30, 2023, attackers drained about $865,000 from Biswap liquidity providers through the MigratorV3 contract, which Biswap had deployed days earlier to move liquidity from its V2 pools to V3. The migrator trusted the pair and token addresses supplied by the caller: it did not check that token0 and token1 matched the real V2 LP pair. Attackers mixed fake tokens and fake pair contracts with victims' real LP positions, so the migrator burned victims' V2 LP tokens (for users who had approved it) and routed the underlying assets into positions and refunds the attacker controlled.
MetaTrust's analysis of one attacker's transactions names 0xA1E31B29f94296FC85FAC8739511360f279B1976 as the attacker, 0x1d448e9661c5abfc732ea81330c6439b0aa449b5 as the attacking contract and 0x839b0afd0a0528ea184448e890cbaaffd99c1dbf as the targeted migrator. DeFiHackLabs' reproduction of that wave uses attack transaction 0xebe5248820241d8de80bcf66f4f1bfaaca62962824efaaa662db84bd27f5e47e. Proceeds were converted to BNB and sent through Tornado Cash.
CertiK noted the migrator was outside the scope of its earlier Biswap audits. Biswap said it took responsibility and fully compensated affected users in July 2023.
How it happened
- Victims had approved the Biswap MigratorV3 contract to move their V2 LP tokens.
- The attacker called the migration function with a victim's real V2 pair but fake
token0/token1; the migrator burned the victim's LP tokens, left the real underlying assets in the migrator, and added V3 liquidity using the attacker's fake tokens. - The attacker called migration again with a fake pair contract and the real tokens, so the migrator used the assets it was holding to mint V3 liquidity or refunds for the attacker.
- The attacker withdrew that liquidity, swapped proceeds to BNB and moved them through Tornado Cash.
Protocol details
Security review history
Evidence
- report @FairyproofT incident report twitter.com
- report Report blog.biswap.org
- transaction bscscan.com transaction 0xa6cc…7a6c bscscan.com
- address bscscan.com address 0x2a82…b833 bscscan.com
- address bscscan.com address 0x839b…1dbf bscscan.com
- address bscscan.com address 0xA1E3…1976 bscscan.com
- address bscscan.com address 0xe3ae…30f6 bscscan.com
- code DeFiHackLabs Biswap_exp.sol (2023-06 V3Migrator exploit reproduction) github.com
- analysis DeFiLlama defillama.com
- analysis Post Mortem: BiSwap certik.com
- analysis 2023 Biswap v3 Migrator Hack: Check If You're Affected revoke.cash
- analysis How a Fake Token Attack Drained $144,000 from Biswap Users on BSC metatrust.io
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.