cosmos vulnerability scanner

Other Community

Skill notes

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.

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

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Other
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@trailofbits · no license declared
Token usage
Lean
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
Local-only
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

01
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

02
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

03
Phase 3: Write Findings

After all scanning agents return, write finding files to the output directory (default `.bughunt_cosmos/`): Parse each agent's response for `FINDING_FILE:` blocks For each finding, Write the content to `{OUTPUT_DIR}/{filename}` using the filename from `FINDING_FILE:` Create the output directory first if it doesn't exist

04
Phase 4: Verify Completeness

After writing all findings, verify every pattern was assessed: Collect the summary lines (§NUM entries) returned by each agent Check pattern counts against expected totals: `core-scanner`: 8 patterns (§1-9, excluding §8 legacy-only) `state-scanner`: 13 patterns (§11-23)

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.