contracts-bridge-exploit
하는 일
이 스킬은 큰 규모의 자금을 모아 두는 크로스체인 브리지에 대한 주요 공격 패턴을 다룹니다. 보안 감사자와 브리지 개발자를 위한 스킬입니다.
사용하는 경우
- ✓크로스체인 브리지나 메시지 검증을 감사할 때.
- ✓브리지 설계에서 검증자 키 위험을 평가해야 할 때.
- ✓과거 브리지 사고에서 배워 같은 실수를 반복하지 않으려는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/contracts/bridge-exploit/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리는 토큰 브리지를 만들고 있습니다. 과거 브리지 손실의 원인이 된 공격 패턴에 비추어 이 설계를 검토해 주시겠어요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 브리지 유형을 분류하고, 신뢰 모델을 알려진 실패 방식과 비교한 뒤, 각 실패를 막을 검사를 짚어 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
브리지는 왜 취약하다고 여겨지나요?
큰 규모의 공동 자산을 보관하며, 메시지를 승인하기 위해 별도의 신뢰 계층에 의존하기 때문입니다.
검증자 키 침해란 무엇인가요?
서명 키 중 충분한 수가 한 주체에게 통제되어 승인을 위조할 수 있는 경우입니다.
예시로 어떤 사고가 쓰이나요?
Wormhole, Ronin, Nomad 같은 과거 손실 사례를 인용합니다.
상세 정보
작성자의 원본 설명
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.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14006
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.