---
title: "Bridge and cross-chain message validation"
url: https://dontgetrekt.today/dev/bridge-validation
section: "What does it trust?"
---

# Bridge and cross-chain message validation

A bridge releases funds for a message, a proof or a deposit that it did not verify correctly. The attacker forges a deposit on one chain and withdraws real funds on the other.

## How the attack works

1. A bridge contract releases or mints tokens when it receives a message that says "a deposit happened on chain A".
2. The verification has a gap: a default value is accepted as a valid root, the sender chain or sender contract is not checked, or a fake proof passes.
3. The attacker sends a forged message with no real deposit behind it.
4. The bridge releases real tokens. Bridges hold large pools, so a single bug can lose hundreds of millions.

## Vulnerable code

```solidity
function process(bytes calldata msg_, bytes32 root) external {
    bytes32 h = keccak256(msg_);
    require(acceptableRoot[confirmAt[root]], "root");  // root 0x00 was set as valid
    require(!processed[h]);
    processed[h] = true;
    _release(msg_);
}
```

## Fixed code

```solidity
function lzReceive(Origin calldata o, bytes32, bytes calldata payload, address, bytes calldata)
    external
{
    require(msg.sender == address(endpoint), "endpoint");
    require(o.srcEid == TRUSTED_EID, "src chain");
    require(o.sender == trustedPeer, "src contract");
    (address to, uint256 amt) = abi.decode(payload, (address, uint256));
    require(amt <= rateLimitLeft(), "rate limit");   // cap damage of a bug
    _release(to, amt);
}
```

## Review checklist

- Check the source chain, the source contract and the messaging endpoint on every message.
- Never accept a default value (zero root, zero hash, empty proof) as valid. Initialize mappings explicitly.
- Add rate limits and a pause that a monitor can trigger, so a bug cannot drain the whole pool at once.
- Mark each message as processed before you release funds.
- If you use a messaging protocol (LayerZero, Wormhole, CCIP, Hyperlane), follow its integration checklist exactly.

## How to test for it

- Send messages with a wrong source chain, a wrong sender, a zero root and a replayed message. All must revert.
- Test an upgrade of the bridge: many bridge bugs came from an upgrade that changed a default value.

## Real exploits (10)

- 2022-02-02 Wormhole ($326.0M): Wormhole's Solana bridge lost about $326M (120k ETH) when the attacker faked guardian signature verification and minted 120k whETH with no ETH deposited. [rekt.news](https://rekt.news/wormhole-rekt)
- 2022-08-01 Nomad Bridge ($190.0M): Nomad Bridge lost $190M because a June upgrade initialised the Replica contract with 0x00 as a trusted root, so any message passed validation in process(). [rekt.news](https://rekt.news/nomad-rekt) [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2022-08/NomadBridge_exp.sol)
- 2026-05-17 VerusBridge ($11.6M): VerusBridge on Ethereum lost about $11.58M (ETH, tBTC, USDC) when submitImports accepted a forged cross-chain import proof that was not validated properly. [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-05/VerusBridge_exp.sol)
- 2026-06-07 Syscoin ($8.6M): Syscoin's NEVM-to-UTXO bridge relay accepted a malformed SPV proof and minted 5 billion unbacked SYS (~$8.56M); the funds were later returned. [rekt.news](https://rekt.news/syscoin-rekt)
- 2026-07-23 Verus-Ethereum Bridge (VerusCoin) ($7.5M): The Verus-Ethereum Bridge lost about $7.54M to a forged but notarized cross-chain export that was never backed by real value on Verus. [rekt.news](https://rekt.news/veruscoin-rekt)
- 2026-01-21 Saga ($7.0M): Saga's SagaEVM IBC precompile accepted forged custom IBC messages, letting an attacker mint about $7M of Saga Dollar without collateral. [rekt.news](https://rekt.news/saga-rekt)
- 2026-06-10 Secret Network (Axelar-Secret IBC bridge) ($4.7M): Secret Network's Axelar IBC bridge contract lost $4.67M because a fork removed two checks, letting an attacker mint unbacked tokens from a fake chain and redeem them for real assets. [rekt.news](https://rekt.news/secret-network-rekt)
- 2026-04-13 Hyperbridge ($2.5M): Hyperbridge lost about $2.5M (first reported as $237k) when a missing leaf_index bounds check in its MMR proof verifier let an attacker forge a message, take admin of the bridged DOT token and mint 1 billion DOT. [rekt.news](https://rekt.news/hyperbridge-rekt)
- 2026-05-15 AdsharesBridge (Wrapped ADS) ($628K): The Adshares bridge to Ethereum lost about $628K when the bridge minter called wrapTo() three times to mint wADS for fake native-chain deposits that did not exist. [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-05/AdsharesBridge_exp.sol)
- 2026-08-19 Allbridge (Core / CCTP integration) ($190K): Allbridge on Base lost about 189,751 USDC because its CCTPTokenMessenger credited a forged, attested Circle message as a real deposit without checking that any USDC was minted. [PoC](https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-08/AllbridgeCCTP_exp.sol)

## References

- [Chainlink CCIP: Best practices](https://docs.chain.link/ccip/best-practices)
- [LayerZero V2: Integration checklist](https://docs.layerzero.network/v2/tools/integration-checklist)
