BiSwap Hack

Reported loss $865K
BNB Chain
Other

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

  1. Victims had approved the Biswap MigratorV3 contract to move their V2 LP tokens.
  2. 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.
  3. 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.
  4. The attacker withdrew that liquidity, swapped proceeds to BNB and moved them through Tornado Cash.

Protocol details

Classification Exchange (DEX) / Access Control
Protocol Type Exploit/Other
Affected asset / contract BSW
Implementation language Solidity
Protocol links Website @Biswap_Dex

Security review history

Bug bounty BiSwap Protocol

Understand the attack patterns

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.