# Bridge Attacks Security Review

> Use when reviewing cross-chain bridge security, including validator and multisig trust, message verification, mint and release logic, pause controls, and rate limits. Use when assessing a new bridge design, testing replay or fake deposit attacks on a fork, or scoring how much value a single compromised key can move.

- Skill: `mizazhaider-ceh/bridge-attacks-security-review` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/bridge-attacks-security-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/bridge-attacks-security-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/bridge-attacks-security-review

---


Bridges fail at the verification step between chains, not at the cryptography of either chain alone. A bridge locks value on one side and mints a representation on the other, and every major bridge loss traces back to a message that was trusted without proof, a validator set that was smaller than claimed, or a contract that was never initialized. This sub-skill belongs to bridge-attacks, which owns bridge architectures and hack patterns, and it supplies the review method: map the trust model, test the verification, and price the compromise.

## Quick Workflow

1. Map the design: lock and mint, burn and release, or liquidity pools, and name the contract on each chain that holds value.
2. Identify the trust model: validator set, multisig threshold, optimistic fraud proofs, or light client verification, and write down exactly who must be honest.
3. Review message verification line by line: what proof the destination chain requires, what it checks, and what it assumes about the source chain.
4. Price the compromise: how many keys, validators, or relayers must fail before an attacker can mint or release, and what total value that unlocks.
5. Test the classic patterns on a fork: fake deposits, replayed messages, uninitialized proxies, and mismatched chain identifiers.
6. Review upgradeability, pause, and rate limits: who can stop the bridge, how fast, and what cap bounds a single bad mint.
7. Check the relayer and watcher layer: liveness assumptions, fraud proof windows, and what happens if relayers simply stop.
8. Report each trust assumption with its compromise cost and its test result, not just a design diagram.

## 1. Architecture and trust model mapping

```bash
# Find the mint, release, lock, and burn entry points on each side
grep -rn "function mint\|function release\|function lock\|function burn\|function deposit\|function withdraw" \
  bridge-contracts/contracts --include="*.sol" | head -40
# For each one, record the caller check, the proof argument, and the
# event it emits, because the event is often the only cross-chain link
grep -rn "event " bridge-contracts/contracts --include="*.sol" | head -40
```

```python
#!/usr/bin/env python3
"""Bridge compromise cost model, kept deliberately simple."""
total_locked = 500_000_000.0
threshold, total_validators = 5, 9
print(f"threshold: {threshold} of {total_validators}")
print(f"value unlocked by threshold compromise: ${total_locked:,.0f}")
print("flag it if the threshold is under one third of the set,")
print("if one operator runs several validators, or if the set rarely rotates")
```

## 2. Message verification review

```solidity
// FAIL pattern, simplified from real bridge losses: mint trusts a
// message without verifying it against source chain state.
// The destination contract must check the proof, the source chain
// identifier, the nonce, and that the message was not already used.
function mint(address to, uint256 amt, bytes calldata proof) external {
    // Missing here: proof verification, chain id check, replay check.
    _mint(to, amt);
}
```

```bash
# Replay test on a fork: submit the same valid message twice
cast send $BRIDGE "mint(address,uint256,bytes)" $RECIPIENT 1000 $PROOF \
  --rpc-url http://127.0.0.1:8545 --private-key $TEST_KEY
cast send $BRIDGE "mint(address,uint256,bytes)" $RECIPIENT 1000 $PROOF \
  --rpc-url http://127.0.0.1:8545 --private-key $TEST_KEY
# The second call must revert. If it mints again, replay protection is absent.
```

## 3. Validator set and key management check

```bash
# Read the validator set and threshold on chain (fill addresses)
cast call $BRIDGE "getValidators()" --rpc-url $RPC_URL
cast call $BRIDGE "threshold()" --rpc-url $RPC_URL
cast call $BRIDGE "paused()" --rpc-url $RPC_URL
# Then check key hygiene off chain: hardware custody, rotation history,
# and whether the same keys sign for other protocols or testnets
```

## 4. Pause, limits, and initialization

```bash
# Uninitialized proxy check: an implementation left uninitialized can
# be claimed by an attacker and then used to upgrade the proxy
cast call $IMPLEMENTATION "owner()" --rpc-url $RPC_URL
cast call $IMPLEMENTATION "initialized()" --rpc-url $RPC_URL
# Rate limit check: read the daily cap and compare it with total locked
cast call $BRIDGE "dailyLimit()" --rpc-url $RPC_URL
cast call $BRIDGE "dailySpent()" --rpc-url $RPC_URL
```

## Edge cases

- A bridge with honest validators but a single relayer can still be censored; liveness is a security property, not just an operations detail.
- Optimistic bridges are only as strong as their fraud proof window and their watchers; a window nobody watches is no window at all.
- Chain identifier confusion lets a message valid on a testnet or a fork replay on mainnet; check the domain separator on every message type.
- Upgrades that change verification logic need a fresh review of the whole message path, not just a diff of the changed lines.
- Liquidity pool bridges move the risk from minting to pool accounting; check for double counting of the same deposit across chains.
- Emergency pause that only the compromised multisig can trigger is not an emergency control; check who can pause independently of who can mint.

## Key references

- Ethereum documentation, bridges and cross-chain concepts: https://ethereum.org/en/bridges/
- Foundry book, fork testing with Anvil: https://getfoundry.sh/
- OpenZeppelin Contracts, proxy and access control: https://docs.openzeppelin.com/contracts/
- Slither documentation and detectors: https://github.com/crytic/slither
- LayerZero and Wormhole public documentation on message verification models: https://docs.layerzero.network/ and https://docs.wormhole.com/

