Post Mortem: BiSwap

Research Incident Analysis
Post Mortem: BiSwap

Project name: BiSwap

Project type: DEX

Date of exploit: June 30th, 2023

Asset loss: $865,000

Vulnerability: Lack of Input Validation

Date of audit report publishing:

  • May 24th, 2021: Biswap
  • Sep 10th, 2021: Biswap (Audit 4)
  • Sep 05th, 2023: Biswap v3 amm (audit)

Conclusion: Out of Audit Scope

Details of the Exploit

Background

Biswap is a DEX project, supporting swap, farm, staking, etc.

Nature of the Vulnerability

Root cause behind the incident is that the BiswapV3 Migrator failed to validate user input parameters, which allows the attacker to 1. migrate the victim user’s BiswapV2 LP to a bad tick and 2. use a fake BiswapV2 pair contract to deceive the migrator and receive BiswapV3 LP of the same tick. He then was able to drain the reserve of the migrator and steal the victim's V3 liquidity through the refund process in the MigratorV3 contract.

CertiK Audit Overview

biswap1 biswap2 biswap3 biswap4 biswap5 biswap6 biswap7

Conclusion

On June 30th, 2023, the liquidity migrator contract of Biswap, for migrating liquidity from v2 to v3, was exploited. The vulnerable code is located on the MigratorV3 contract, which is not audited by Certik.

Related Blogs

Post Mortem: Thoreum Finance

Post Mortem: Thoreum Finance

On Jan 18, 2023, Thoreum Finance's token contract v4 was exploited, leading to a loss of around 2,260 WBNB. The attacker took advantage of the flawed implementation in the token contract's transfer function and manipulated its balance.

Post Mortem:  TerraPort Finance

Post Mortem: TerraPort Finance

On April 10th, 2023, the Terraport project team was alarmed breach detected with the Terraport Liquidity wallet. The total loss is around $4M.

Post Mortem: Telcoin

Post Mortem: Telcoin

​​On Dec 26th, 2023, Telcoin experienced a loss of ~$1.25M attack. The vulnerable contract is due to a vulnerability in the proxy implementation of wallet contracts, which is a different application from what CertiK has audited.