AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

cosmos-vulnerability-scanner

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.

Original source
trailofbits
License
CC-BY-SA-4.0
Pinned revision
2be6433b39e009cd2b6fd3be1895f6b1faa5af9a

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read trailofbits--cosmos-vulnerability-scanner at revision 2be6433b39e009cd2b6fd3be1895f6b1faa5af9a, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 9

resources/VULNERABILITY_PATTERNS.md · 24000

ssages](https://jumpcrypto.com/bypassing-ethermint-ante-handlers/) inside x/authz MsgExec or x/group proposal execution. SDK enforces MaxUnpackAnyRecursionDepth = 10 (GHSA-8wcc-m6j2-qxvm) but semantic nesting (authz wrapping authz) must be handled by the ante handler itself

  • [ ] x/authz grant creation reviewed for privilege escalation (GHSA-4j93-fm92-rp4m) — verify grants cannot circumvent blocked address restrictions; also check x/feegrant's GrantAllowance and x/auth/vesting's CreatePeriodicVestingAccount against BlockedAddr
  • [ ] If PostHandler is set (app.SetPostHandler), its logic is reviewed — PostHandlers run after message execution and receive a success bool; errors can mask the original message result or cause unexpected state changes
  • [ ] Unordered transactions (ADR-070): SigVerificationDecorator configured with SigVerifyOptions (timeout duration, gas cost)

Key Vulnerability: Nested message bypass. An attacker wraps a message inside MsgExec (authz) or a group proposal. If the custom ante handler only inspects the outer message, inner messages skip validation entirely.

// VULNERABLE: AnteHandler only checks outer message type
func (d MyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
    for _, msg := range tx.GetMsgs() {
        // Only checks msg type — does NOT recurse into MsgExec.Msgs!
        if _, ok := msg.(*types.MsgDangerous); ok {
            return ctx, errors.New("blocked")
        }
    }
    return next(ctx, tx, simulate)
}
// SECURE: Recurse into nested messages
func (d MyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
    for _, msg := range tx.GetMsgs() {
        if err := d.checkMsg(msg); err != nil {
            return ctx, err
        }
    }
    return next(ctx, tx, simulate)
}

func (d MyDecorator) checkMsg(msg sdk.Msg) error {
    if _, ok := msg.(*types.MsgDangerous); ok {
        return errors.New("blocked")
    }
    if exec, ok := msg.(*authz.MsgExec); ok {
        for _, inner := range exec.Msgs {
            var innerMsg sdk.Msg
            if err := d.cdc.UnpackAny(inner, &innerMsg); err != nil {
                return err
            }
            if err := d.checkMsg(innerMsg); err != nil {  // Recurse
                return err
            }
        }
    }
    return nil
}

References: Jump Crypto — Bypassing Ethermint Ante Handlers


10 IBC SECURITY

IBC vulnerability patterns are covered separately in Step 4 of the scanning workflow. See IBC_VULNERABILITY_PATTERNS.md. This section intentionally left as a placeholder to preserve numbering.