Crypto news

21.07.2026
11:38

Critical hack of Wanchain bridge for Cardano: 515 million NIGHT tokens stolen

An exploit of the Wanchain cross-chain bridge connecting Cardano to BNB Chain has shocked the community. The attack drained approximately 515 million NIGHT tokens from the liquidity pool. Based on my estimates, at the time of the incident, this amount was worth between $9 and $13 million, depending on market conditions.

This event is yet another stark reminder that cross-chain bridges remain the most vulnerable link in the DeFi ecosystem. Let's break down the technical details and consequences.

Cause of the Incident: Bug in the TreasuryCheck Validator

An initial investigation conducted by security experts from BlockSec identified the root cause — non-injective encoding of signed messages in the TreasuryCheck validator. A validator is a smart contract responsible for verifying the legitimacy of operations. The term "non-injective encoding" means that different input data sets can produce the same output value. Simply put, the system loses its ability to distinguish between different operations, opening the door for an attack.

The vulnerability mechanism worked as follows:

  • The signed message was formed by "raw" concatenation of 14 variable-length fields (redeemer) using the AppendByteString function, without delimiters or length prefixes. A redeemer is a data set attached to a transaction to confirm its validity.
  • Due to this, different sets of field values could produce an identical byte string.
  • An identical string led to an identical hash (digital fingerprint) and, consequently, to the same signature, suitable for reuse.

BlockSec confirmed this by decompiling the on-chain Plutus V2 bytecode and decoding the redeemer from the exploit transaction. The code included a built-in SerialiseData function, but it was only used when matching output-datum, not when constructing the hash for the signature. Using Sha3_256(SerialiseData(...)) would have ensured unambiguous field boundaries in CBOR encoding and prevented attacks of this class.

Imagine: a director approves the digital combination "12345" and certifies it with a signature. The verification program splits the combination into fields: "to whom" = 12, "how much" = 345. But the combination itself has no delimiter. The attacker does not forge the signature but merely shifts the invisible boundary: "to whom" = 123, "how much" = 45. The signature remains valid, while the recipient and amount change. This is precisely how the attack was constructed.

Consequences and Market Reaction

Exploiting this vulnerability, attackers fabricated messages for illegitimate token issuance, then converted the stolen NIGHT into ADA on the Cardano network. The Wanchain team promptly disabled the bridge to conduct an investigation and promised full transparency.

The NIGHT token is the native asset of the Midnight project, focused on privacy and developed with support from Input Output (IO), the entity behind Cardano. The market reaction was swift and brutal: the price of NIGHT collapsed by over 30% in a single day, hitting an all-time low of around $0.016.

The Midnight Foundation quickly assured the community that the incident is isolated to the Wanchain bridge and does not affect the Midnight network itself, its protocol, validators, or key infrastructure. They emphasize that the problem lies in third-party infrastructure, not in the NIGHT asset or the Midnight blockchain.

Analytical Conclusion: This incident is a classic example of a "signature reuse attack," made possible by neglecting secure coding standards. It does not spell doom for Cardano or Midnight, but it serves as a critical signal for all developers of cross-chain solutions. Bridge security must be an order of magnitude higher, otherwise we will continue to witness such collapses. Restoring trust in Wanchain and the NIGHT token will now be a long and painful process.