cosmos-vulnerability-scanner
Fungsinya
Memindai modul blockchain Cosmos dan kontrak CosmWasm untuk masalah kritis konsensus, seperti penghentian rantai dan kehilangan dana. Skill ini untuk auditor dan tim blockchain yang meninjau kode Cosmos kustom.
Kapan dipakai
- βSaat auditor meninjau modul kustom dalam blockchain Cosmos SDK.
- βSaat tim ingin memeriksa integrasi IBC sebelum diluncurkan.
- βSaat tim menyelidiki penyebab penghentian rantai pada blockchain Cosmos.
Link skill
https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTinjau modul Cosmos kustom saya untuk hal apa pun yang bisa menghentikan rantai atau menyebabkan kehilangan dana.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini menjalankan pemeriksaan paralel, masing-masing berfokus pada satu kelompok masalah yang sudah dikenal, dan memeriksa apakah setiap temuan berada di jalur kritis konsensus. Setiap temuan disimpan sebagai file markdown terpisah di folder output.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
- 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.
- 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.
- 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.modversions before applying patterns. - 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.
- 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:
- Follow the Discovery workflow to explore the target codebase
- Return the full CLAUDE.md content (the technical inventory and threat model) in its response
- 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 |
| ` |
Pertanyaan umum
Apa yang dimaksud dengan kritis konsensus?
Skill ini berfokus pada kode yang berjalan selama pemrosesan blok dan penanganan transaksi, karena bug di sana bisa menghentikan rantai atau menyebabkan kehilangan dana.
Apakah skill ini mencakup CosmWasm?
Ya. Skill ini mencakup pola kontrak CosmWasm bersama pemeriksaan Cosmos SDK.
Apakah skill ini memeriksa mesin inti rantai?
Tidak. Skill ini menyatakan hanya mencakup modul SDK, bukan mesin konsensus itu sendiri.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 8.0k
- Peringkat
- #12660
- Lisensi
- CC-BY-SA-4.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
audit-context-building
8.0kMembantu agent Anda mempelajari basis kode yang belum dikenal sebelum tinjauan keamanan, dengan memetakan apa yang diasumsikan, dijamin, dan bergantung pada setiap fungsi.
algorand-vulnerability-scanner
8.0kMembantu agent Anda memindai smart contract Algorand, yang ditulis dalam TEAL atau PyTeal, untuk 11 masalah keamanan umum seperti serangan rekeying dan biaya yang tidak diperiksa.
audit-prep-assistant
8.0kMembantu agent Anda menyiapkan basis kode untuk tinjauan keamanan dari luar, dengan analisis statis, cakupan tes, pembersihan kode mati, dan dokumentasi yang jelas.
cairo-vulnerability-scanner
8.0kMembantu agent Anda memindai smart contract Cairo di StarkNet untuk 6 masalah serius, termasuk overflow aritmetika, pesan lintas lapisan yang berisiko, dan replay tanda tangan.
Skill serupa
reverse-engineer-anything
422kMembantu agent Anda memeriksa aplikasi dan paket yang sudah dirilis untuk menjelaskan fitur, membandingkan versi, atau memandu pembangunan ulang dengan alat REA.
1password
394kMembantu agent Anda mengatur CLI 1Password, masuk, serta membaca atau menyisipkan rahasia tanpa menampilkan nilainya di chat.
healthcheck
394kMembantu agent Anda mengaudit komputer atau server OpenClaw dari risiko keamanan seperti SSH, firewall, pembaruan, dan cadangan, lalu menyarankan perbaikan aman.