본문으로 건너뛰기
Skillpedia
보안8.0k · #12660

cosmos-vulnerability-scanner

하는 일

체인 중단이나 자금 손실처럼 합의에 중요한 문제를 Cosmos 블록체인 모듈과 CosmWasm 계약에서 검사합니다. 맞춤 Cosmos 코드를 검토하는 감사자와 블록체인 팀을 위한 것입니다.

사용하는 경우

  • ✓감사자가 Cosmos SDK 블록체인의 맞춤 모듈을 검토할 때.
  • ✓팀이 출시 전에 IBC 연동을 확인하고 싶을 때.
  • ✓팀이 Cosmos 체인이 멈춘 원인을 조사하는 경우.

스킬 링크

https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 맞춤 Cosmos 모듈에서 체인을 멈추거나 자금을 잃게 할 수 있는 부분이 있는지 검토해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 병렬 검사를 실행하며, 각 검사는 알려진 문제 묶음 하나에 집중합니다. 각 발견 사항이 합의에 중요한 경로에 있는지도 확인합니다. 발견 사항은 출력 폴더에 마크다운 파일 하나씩으로 저장합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Cosmos Vulnerability Scanner

Purpose

Scan Cosmos SDK modules and CosmWasm contracts for vulnerabilities that cause chain halts, consensus failures, or fund loss. Spawns parallel scanning agents — each specializing in a vulnerability category — that return findings to the main skill, which then writes them as individual markdown files to an output directory.

Output directory: defaults to .bughunt_cosmos/. If the user specifies a different directory in their prompt, use that instead.

When to Use

  • Auditing Cosmos SDK modules (custom x/ modules)
  • Reviewing CosmWasm smart contracts
  • Pre-launch security assessment of Cosmos chains
  • Investigating chain halt incidents

When NOT to Use

  • Pure Solidity/EVM audits without Cosmos SDK — use Solidity-specific tools
  • CometBFT consensus engine internals — this covers SDK modules, not the consensus layer itself
  • General Go code review with no blockchain context
  • Cosmos SDK application logic that is not consensus-critical (e.g., CLI commands, REST endpoints)
  • CosmWasm contract-only audits on chains without custom SDK modules — use the CosmWasm checklist items alone

Essential Principles

  1. Consensus path is king — A bug only matters for chain halt/fund loss if it's on the consensus-critical execution path (BeginBlock, EndBlock, FinalizeBlock, msg_server handlers, AnteHandler). Always verify a finding is reachable from consensus before reporting it.
  2. State divergence = chain halt — Any non-determinism that causes validators to compute different state roots will halt the chain. This is the highest-severity class because it affects all validators simultaneously.
  3. Check the version — Cosmos SDK has breaking changes across major versions (v0.47 removed GetSigners, v0.50 added ABCI 2.0, v0.53 deprecated ValidateBasic). Always check go.mod versions before applying patterns.
  4. False positives waste audit time — A map iteration in a CLI command is not a consensus bug. A panic in a query handler does not halt the chain. Verify the execution context before flagging.
  5. Cross-module interactions are where bugs hide — The most severe findings (IBC reentrancy, EVM/Cosmos state desync, authz escalation) involve interactions between modules, not bugs within a single module.

Scanning Workflow

Phase 1: Discovery (synchronous)

Entry: Target codebase path provided by user. Codebase contains Go source (e.g., x/ modules, go.mod) or Rust contracts with cosmwasm_std.

Run a synchronous subagent (Agent tool) with the full contents of DISCOVERY.md as its prompt. The agent must:

  1. Follow the Discovery workflow to explore the target codebase
  2. Return the full CLAUDE.md content (the technical inventory and threat model) in its response
  3. Return a structured summary with exactly these fields:
PLATFORM: pure-cosmos | evm | wasm        (pick one; if multiple, comma-separated)
IBC_ENABLED: true | false
SDK_VERSION: <version from go.mod>
IBC_GO_VERSION: <version from go.mod, or "n/a">
CUSTOM_MODULES: <comma-separated list of x/* modules>

After the subagent returns, you (the main skill) Write the CLAUDE.md to the target repo root. Save its path and the discovery values — these feed into Phase 2.

Exit: CLAUDE.md written by main skill. PLATFORM, IBC_ENABLED, SDK_VERSION, IBC_GO_VERSION, and CUSTOM_MODULES captured.

Phase 2: Parallel Vulnerability Scan

Spawn scanning agents in a single message for maximum parallelism. Use the Agent Prompt Template below, filling in the reference file for each agent. Subagents only need read access (Grep, Glob, Read) — they return findings in their response and the main skill writes the files.

Always spawn these 3 agents:

Agent Name Reference File Scope
core-scanner VULNERABILITY_PATTERNS.md §1-9: non-determinism, ABCI, signers, validation, handlers, ante security
state-scanner STATE_VULNERABILITY_PATTERNS.md §11-23: bookkeeping, bank, pagination, events, tx replay, governance, arithmetic, encoding, deprecated modules
advanced-scanner ADVANCED_VULNERABILITY_PATTERNS.md §24-27: storage keys, consensus validation, circuit breaker, crypto

Spawn conditionally (in the same parallel message):

Agent Name Condition Reference File
evm-scanner PLATFORM includes evm EVM_VULNERABILITY_PATTERNS.md
`
자주 묻는 질문

합의에 중요하다는 것은 무엇인가요?

블록 처리와 거래 처리 중에 실행되는 코드에 중점을 둡니다. 그곳의 버그는 체인을 멈추거나 자금 손실을 일으킬 수 있기 때문입니다.

CosmWasm도 다루나요?

네. Cosmos SDK 검사와 함께 CosmWasm 계약 패턴을 포함합니다.

체인의 핵심 엔진도 검사하나요?

아니요. 이 스킬은 합의 엔진이 아니라 SDK 모듈을 다룬다고 설명합니다.

상세 정보

작성자의 원본 설명

Scans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence. 25 core + 16 IBC + 10 EVM + 3 CosmWasm patterns. Use when auditing custom x/ modules, reviewing IBC integrations, or assessing pre-launch chain security. Updated for SDK v0.53.x.

repo: trailofbits/skills

인기도

GitHub 스타
8.0k
순위
#12660
라이선스
CC-BY-SA-4.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬