Chuyển đến nội dung
Skillpedia
Bảo mật8.0k · #12660

cosmos-vulnerability-scanner

Skill này làm gì

Quét các module blockchain Cosmos và contract CosmWasm để tìm vấn đề quan trọng với đồng thuận, như dừng chuỗi và mất tiền. Dành cho kiểm toán viên và nhóm blockchain review code Cosmos tùy chỉnh.

Khi nào nên dùng

  • ✓Khi kiểm toán viên review các module tùy chỉnh trong một blockchain Cosmos SDK.
  • ✓Khi nhóm muốn kiểm tra một tích hợp IBC trước khi ra mắt.
  • ✓Khi nhóm đang tìm nguyên nhân một chuỗi Cosmos bị dừng.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Review module Cosmos tùy chỉnh của tôi xem có gì có thể làm dừng chuỗi hoặc mất tiền không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill chạy các kiểm tra song song, mỗi kiểm tra tập trung vào một nhóm lỗi đã biết, rồi kiểm tra từng phát hiện có nằm trên đường đi quan trọng với đồng thuận không. Nó lưu mỗi phát hiện thành một file markdown riêng trong thư mục đầu ra.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
`
Câu hỏi thường gặp

Đường đi quan trọng với đồng thuận là gì?

Skill tập trung vào code chạy trong quá trình xử lý khối và giao dịch, vì lỗi ở đó có thể làm dừng chuỗi hoặc gây mất tiền.

Nó có bao phủ CosmWasm không?

Có. Nó có các mẫu contract CosmWasm cùng với các kiểm tra Cosmos SDK.

Nó có kiểm tra engine đồng thuận của chuỗi không?

Không. Skill nói nó bao phủ các module SDK, không phải chính engine đồng thuận.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
8.0k
Vị trí xếp hạng
#12660
Giấy phép
CC-BY-SA-4.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự