contracts-bridge-exploit
O que ela faz
Esta skill trata dos principais padrões de ataque contra pontes entre blockchains, que guardam grandes fundos agrupados. Ela é para auditores de segurança e desenvolvedores de pontes.
Quando usar
- ✓Quando você audita uma ponte entre blockchains ou a verificação de suas mensagens.
- ✓Quando você precisa avaliar os riscos de chaves de validadores em um desenho de ponte.
- ✓Quando você quer aprender com incidentes passados de pontes para não repetir os mesmos erros.
Link da skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/contracts/bridge-exploit/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Estamos criando uma ponte de tokens. Você pode revisar o desenho dela contra os padrões de ataque por trás de perdas passadas em pontes?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente classifica o tipo de ponte, compara o modelo de confiança dela com modos de falha conhecidos e aponta as verificações que impediriam cada um.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Cross-Chain Bridge Attack
Bridges hold large pooled assets and execute messages from a separate trust layer. Architecturally fragile.
Bridge taxonomy
| Type | Trust model | Past exploits |
|---|---|---|
| Lock-and-mint | Trusted validators sign mint events | Wormhole ($325M), Ronin ($600M), Harmony ($100M) |
| Burn-and-redeem | Same | Multichain/Anyswap ($126M) |
| Optimistic | Fraud proof window | Nomad ($190M) |
| Light-client / zk | Cryptographic | (Fewer hacks, but newer) |
| Liquidity-network (Hop, Connext) | Routers + relayers | Smaller individual exploits |
Attack classes
1. Validator-signature bypass (Wormhole, Feb 2022, $325M)
The Solana-side verify_signature function trusted the caller to provide a "verified" sigset account. Attacker passed a sysvar that wasn't a real sigset → unauthorized mint of 120k wETH.
Lesson: any verify function whose input is a struct fetched by address is bypassable if address-trust is missing.
2. Validator key compromise (Ronin, March 2022, $600M)
9-of-9 validators, 5 of which were operated by one entity. Sky Mavis got phished → attacker controlled 5 keys → arbitrary mint.
Lesson: validator decentralization isn't math, it's operational. Count distinct legal entities and key-storage methods, not just keys.
3. Merkle-proof forgery (Nomad, August 2022, $190M)
After an upgrade, the zero-hash was set as a "valid root" — any proof against root = 0 passed. The first attacker withdrew real funds; then thousands of others copy-pasted the same tx with their own address. ~$190M total.
Lesson: check initialize / upgrade scripts for accidental defaults — bytes32(0), address(0), 1 (often the most-tested value) becoming the trusted value.
4. Replay across chains (Multichain class)
Bridge tx signed for chain A is replayed on chain B because chainId wasn't bound into the signed message:
function claim(bytes32 nonce, uint256 amount, bytes calldata sig) external {
bytes32 hash = keccak256(abi.encode(nonce, msg.sender, amount)); // ⚠ no chainId
require(ecrecover(hash, ...) == validator);
token.transfer(msg.sender, amount);
}
// On chain A: legit claim
// On chain B (same validator, same token): replay the same sig
5. Reentrancy on bridge claim
Claim transfers tokens THEN updates nonce-used mapping:
function claim(...) external {
token.transfer(msg.sender, amount); // attacker token w/ callback
used[nonce] = true; // updated AFTER
}
// ERC777 / ERC1363 / malicious ERC20 callback → re-enter claim same nonce
6. Liquidity-pool draining via fee oracle (Hop / Across class)
Bridges using a quote-and-relay model price slippage via oracle. Manipulate the oracle → arbitrage drains liquidity:
Step 1: Borrow large position on chain A
Step 2: Manipulate underlying spot price oracle that bridge fee uses
Step 3: Initiate cross-chain transfer at the manipulated rate
Step 4: Repay loan, profit = bridge fee discount on a large transfer
Bridge audit checklist (the bugs that broke real bridges)
verify_signaturetrust chain: from where does the verifier load its trust roots? Can the caller spoof them?- Validator set update: is there a quorum check on changing validators? Can a 51% rotate themselves out and stay in?
- Nonce vs chainId binding: does the signed message include destChainId?
- Claim state machine: nonce-used mapping written BEFORE external token call?
- Default values: any
address(0),bytes32(0),1in initialize that becomes a trusted value? - Pause / rescue functions: are they gated by a multisig that's actually distributed?
- Relayer trust: does the bridge trust relayer-provided data, or re-verify on-chain?
- Fee/rate oracle: TWAP or spot? Manipulable?
Tooling
# Foundry test against a fork — simulate the exact bridge flow
forge test --fork-url $RPC --match-contract Bridge --fork-block-number 17000000
# Slither — finds reentrancy + signature-replay heuristics
slither <project>
# Echidna — fuzz the bridge claim function with arbitrary calldata
echidna-test test/Bridge.t.sol --config echidna.yaml
# Tenderly — live simulation against deployed bridge contracts
OPSEC / scope
- Bridge attacks are direct financial theft. Never test against live bridges without explicit ownership/written authorization.
- Bug bounty bridges (Immunefi top payouts) are the leg
Perguntas frequentes
Por que pontes são consideradas frágeis?
Elas guardam grandes ativos agrupados e dependem de uma camada de confiança separada para aprovar mensagens.
O que é comprometimento de chaves de validadores?
É quando chaves de assinatura suficientes estão sob controle de uma única parte, então aprovações podem ser forjadas.
Quais incidentes são usados como exemplo?
A skill cita perdas passadas como as da Wormhole, Ronin e Nomad.
Detalhes
Descrição original do autor
Cross-chain bridge attack — message-validation bypass (Wormhole class), validator key compromise (Ronin / Harmony class), reentrancy on token-bridge claim, Merkle-proof forgery on optimistic bridges, signature replay across chains. Bridges have lost >$2B; understand why.
Popularidade
- Estrelas no GitHub
- 6,5 mil
- Posição no ranking
- #14006
- Licença
- Apache-2.0
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
detector-overview
6,5 milAjuda seu agente a ler o código marcado por um scanner e decidir quais pontos sinalizados são falhas reais de segurança e quais são falsos alarmes.
exploiter-overview
6,5 milAjuda seu agente a combinar várias fraquezas de segurança confirmadas em uma única cadeia de teste e verificar até onde essa cadeia poderia chegar.
llm-redteam-overview
6,5 milAjuda seu agente a encontrar o guia certo de red team de IA para um teste, cobrindo 15 grupos de táticas, da injeção de prompt ao abuso de modelos.
aatmf-t01-prompt-injection
6,5 milExplica a injeção de prompt, em que instruções ocultas tentam sobrepor-se a um sistema de IA, para que testadores de segurança consigam verificá-la.
Skills parecidas
reverse-engineer-anything
422 milAjuda seu agente a analisar apps e pacotes já publicados para explicar recursos, comparar versões ou orientar uma reconstrução, usando a ferramenta REA.
1password
394 milAjuda seu agente a configurar a CLI do 1Password, fazer login e ler ou injetar segredos sem imprimir seus valores no chat.
healthcheck
394 milAjuda seu agente a auditar o computador ou servidor que roda o OpenClaw em busca de riscos como SSH, firewall, atualizações e backups, com correções seguras.