TL;DR

On October 17, 2022, BitKeep suffered an exploit on BNB Chain through a service used to swap tokens, causing a loss of approximately $1 million.

Introduction to BitKeep

BitKeep is a decentralized multi-chain cryptocurrency wallet that provides numerous digital asset management services to consumers worldwide.

Vulnerability Assessment

The vulnerability was exploited because of a flaw in BitBTC code, in which the said contract utilized a custom bridge instead of the standard bridge that Optimism provides.

Steps

  1. The L2 side of their bridge permits the withdrawal of any token and allows that token to choose the l1Token address transmitted to the L1 side of the bridge.
function withdrawTo(address _l2Token, address _to, uint256 _amount, uint32 _l1Gas, bytes calldata _data) external override {
    _initiateWithdrawal(_l2Token, msg.sender, _to, _amount, _l1Gas, _data);
  }
  1. Nonetheless, the L1 bridge disregards what the L2 token was and simply mints the arbitrary L1 token.
  1. Thus, an adversary could deploy their own token on Optimism, give themselves the entire quantity, and set the l1Token of their token to the actual BitBTC L1 address.

  2. An attacker withdraws billions of fake BitBTC tokens from Optimism.

  1. Then, when the attacker attempted to withdraw their fraudulent token via the BitBTC bridge, they are given actual BitBTC tokens on L1.

Aftermath

To ensure that there are no other asset security issues, the team had suspended their Swap service. They also communicated and collaborated with major security agencies in order to track down the hackers and recover the stolen assets.

How to prevent such an attack vector

Security is of the foremost importance, therefore project teams should use the standard bridge as opposed to developing a custom bridge without any prior risk estimates..

Protocol, and Platform Security

Our security team at Neptune Mutual can validate your platform for DNS and web-based security, smart contract reviews, as well as frontend and backend security. We can offer you a solution to scan your platform and safeguard your protocol for known and unknown vulnerabilities that have the potential to have catastrophic long-term effects. Contact us on social media if you are serious about security and have the budget, desire, and feeling of responsibility to do so.


About Us

Neptune Mutual project safeguards the Ethereum community from cyber threats. The protocol uses parametric cover as opposed to discretionary insurance. It has an easy and reliable on-chain claim process. This means that when incidents are confirmed by our community, resolution is fast.

Join us in our mission to cover, protect, and secure on-chain digital assets.

Official Website: https://neptunemutual.com
Blog: https://blog.neptunemutual.com/
Twitter: https://twitter.com/neptunemutual
Reddit: https://www.reddit.com/r/NeptuneMutual
Telegram: https://t.me/neptunemutual
Discord: https://discord.gg/2qMGTtJtnW
YouTube: https://www.youtube.com/c/NeptuneMutual
LinkedIn: https://www.linkedin.com/company/neptune-mutual