cosmos-sdk-audit-checklist
Skill220 starsChanged 20 days agoMITView on GitHub
Use when auditing a Cosmos-SDK / CometBFT chain or appchain — custom modules (x/*), app wiring (app/), and the ante chain. Covers the classes that halt chains or move funds, starting with non-determinism in consensus code.
In this repository179 other files it gives its agents.
- AGENTS.mdAGENTS.md
- chrono/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- accessible-media-authoringSkill
- agentic-safety-auditSkill
- agent-prompt-engineeringSkill
- audio-event-map-authoringSkill
- auto-scaffoldSkill
- chain-constructSkill
- chain-construct-smart-contractSkill
- claim-verificationSkill
- code-reachability-auditSkill
- code-review-loopSkill
- color-theorySkill
- conversation-designSkill
- copy-refinementSkill
- cross-chain-bridge-auditSkill
- cross-file-relationship-synthesisSkill
- data-flow-traceSkill
- dedup-prior-art-checkSkill
- defi-invariant-checkSkill
- dependency-cycle-auditSkill
- dependency-health-triageSkill
- detection-as-codeSkill
- diff-aware-semgrep-scanSkill
- differential-reviewSkill
- dimensional-analysis-checkSkill
- dual-level-retrievalSkill
- durable-nonce-exploitationSkill
- erc1271-revert-data-checkSkill
- error-based-sstiSkill
- evm-audit-flowSkill
- figma-implement-designSkill
- findings-filterSkill
- forensic-timeline-authoringSkill
- game-design-fundamentalsSkill
- game-mechanics-balancingSkill
- head-tailSkill
- incident-response-runbookSkill
- interactive-audio-designSkill
- interface-ambiguity-checkSkill
- keyword-clusteringSkill
- knowledge-base-integrationSkill
- known-advisory-backport-checkSkill
- layered-analysis-loopSkill
- level-design-patternsSkill
- locale-adaptationSkill
- multi-stance-audit-fanoutSkill
- narrative-structureSkill
- osint-platform-auditSkill
- parser-differential-route-confusionSkill
- persuasive-technical-writingSkill
- platform-complianceSkill
- player-engagement-psychologySkill
- pre-audit-threat-modelSkill
- program-rubric-lookupSkill
- read-only-reentrancy-checkSkill
- requirements-elicitationSkill
- review-severity-ladderSkill
- rule6-rights-gateSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
time.Now()/ wall-clock: instead of ctx.BlockTime() in a state-affecting path (telemetry/queries are fine. - Very specific: line 37
Run osv-scanner --lockfile go.mod + check cometbft/cosmos-sdk/ibc versions against published GHSAs/ASAs — a shipped-vulnerable consensus …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
cosmos-sdk-audit-checklist
Known critical-bug classes for Cosmos-SDK / CometBFT chains and appchains. Run every item against custom modules (x/*), the app wiring (app/), and the ante chain. These are the classes that halt chains or move funds.
Non-determinism → consensus fork/halt (the #1 Cosmos class)
Any code reached in consensus (DeliverTx, BeginBlock, EndBlock, msg handlers, ValidateBasic) MUST be deterministic across nodes. Grep for:
- Map iteration without sorted keys (
for k := range someMapthat affects state/events) → nodes diverge. time.Now()/ wall-clock instead ofctx.BlockTime()in a state-affecting path (telemetry/queries are fine; state is not).math/rand, goroutine/scheduling-dependent order, floating point,os/env/filesystem reads, non-deterministic serialization.- Iterating a
sdk.Contextstore and mutating during iteration.
Begin/EndBlocker panics → chain halt
Begin/EndBlock panics are NOT recovered (unlike DeliverTx). Any panic reachable from permissionless state (a delegation, a zero-power validator, a division, a LegacyNewDecFromStr on attacker-influenced input, an out-of-range slice) = a chain halt. Audit every division/decimal/slice/MustXxx in ABCI paths for a reachable panic. (Historical: x/group EndBlock zero-tally error — GHSA-47ww.)
Unmetered / unbounded functions → DoS
EndBlocker or msg handlers that do work proportional to unbounded state (a list an attacker can grow cheaply: pending items, ballots, groups, gasless accounts) → sustained griefing / slowdown / halt. Check every loop over a growable collection for gas metering + a bound.
AnteHandler bypass
- Nested/inner messages (authz
MsgExec, group proposals, ICA) that skip the ante checks applied to top-level msgs — recursion must re-classify (fee, sig, gas) on inner msgs. - Gasless / fee-abstraction whitelists: does a "free" path let an attacker execute value-moving msgs or grow state for free? Does account-init verify the signer's sig before bypassing later sig decorators?
- Sequence/nonce ordering and replay across the ante.
authz / module authorization
- Historical authz bypasses (Elderflower/Jackfruit) enabling inflation/theft — confirm every
Msg*handler enforces the correct signer/authority (gov module account, admin param). Registry/config mutations especially. x/group,x/gov, ICA, IBC packet-forward / rate-limit / wasm composition — audit the interaction, not just each module alone.
Fund/decimal precision
Token conversion, reward division (F1 distribution), fee/refund math — check extrema, rounding direction, and over/underflow (G115-style uint conversions in HAND-WRITTEN code; generated *.pulsar.go conversions are false positives).
Dependencies (always)
Run osv-scanner --lockfile go.mod + check cometbft/cosmos-sdk/ibc versions against published GHSAs/ASAs — a shipped-vulnerable consensus dep with a reachable in-scope impact is a real finding (though often dedup-dead / "known"; see [[known-advisory-backport-check]]). Note: govulncheck needs a buildable module.
Tools
gosec -severity=medium ./..., staticcheck ./..., semgrep --config=p/gosec --config=p/golang, osv-scanner, go test -race for concurrency, native go test -fuzz for parsers. Related: [[cross-chain-bridge-audit]] for the interop layer.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

