All vulnerabilities
CRITICALWeb3exploited in the wild

WEB3-BNB-CHAIN-2022

Web3 · BNB Chain · BSC Token Hub

Summary

On October 6, 2022, an attacker exploited the BSC Token Hub, the cross-chain bridge of BNB Chain, forging Merkle proofs to mint about 2 million BNB worth roughly $570 million. The root cause was a flaw in the IAVL Merkle-tree range-proof verification, which computed the tree root using only the left path and failed to verify that intermediate nodes had no right child; an attacker could append an arbitrary malicious right-leaf hash plus an empty inner node to balance the path without changing the root hash, so a forged proof passed validation. After registering as a relayer by depositing 100 BNB to reach the handlePackage() handler, the attacker submitted the forged proof to the iavlMerkleProofValidate precompile at address 0x65, validating a fabricated cross-chain message that authorized minting 1M BNB to their address, executed twice. BNB Chain halted all 44 validators (26 active), freezing the bulk of the funds on-chain; only about $137 million escaped to other networks, of which around $7 million was further frozen by Tether. No named attribution and no existing user funds were drained since the tokens were freshly minted.

How to avoid it in your code

  • Correctly verify Merkle/IAVL range proofs: reject proofs where inner nodes carry an unexpected right child or both left and right leaves are present.
  • Pin and patch verified library versions (IAVL/cosmos-sdk) and re-audit proof-verification precompiles against malformed inputs.
  • Fuzz and formally verify cross-chain proof verification against forged and edge-case tree structures.
  • Gate privileged cross-chain message handlers and minting behind stricter relayer authorization and anomaly limits.
  • Add circuit breakers and rapid validator-halt procedures to cap loss when abnormal mint/withdraw volume appears.

References

Related vulnerabilities

All Web3 →