Canister audit
Deep security audit of an Internet Computer Rust canister repo, detect an ic-cdk canister, model its invariants and trust boundaries first.
In detail
Deep security audit of an Internet Computer Rust canister repo - detect an ic-cdk canister, model its invariants and trust boundaries first, run a Semgrep IC ruleset plus cargo-audit/osv (best-effort), then a bounded agentic pass that hunts a path breaking each invariant against the 12 canister-security pitfalls, triage, adversarially refute, prove a confirmed HIGH/CRITICAL with a PocketIC reproduction through the shared PoC gate, and route each finding through the shared responsible-disclosure machinery. The IC sibling of sc-audit; Rust canisters only.
Safety check
- Not rated by Claude yet. We only sell skills Claude has read and rated 7 out of 10 or higher, so this one is a free link to its author.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: canister-audit
description: Deep security audit of an Internet Computer Rust canister repo - detect an ic-cdk canister, model its invariants and trust boundaries first, run a Semgrep IC ruleset plus cargo-audit/osv (best-effort), then a bounded agentic pass that hunts a path breaking each invariant against the 12 canister-security pitfalls, triage, adversarially refute, prove a confirmed HIGH/CRITICAL with a PocketIC reproduction through the shared PoC gate, and route each finding through the shared responsible-disclosure machinery. The IC sibling of sc-audit; Rust canisters only.
metadata:
title: Canister Audit
category: dev
mode: write
var: ""
tags:
- dev
- security
- icp
depends_on:
- github-trending
requires:
- GH_GLOBAL?
- RESEND_API_KEY?
- RESEND_FROM?
- RESEND_REPLY_TO?
---
> **${var}** - Target selector. Three forms:
> - `` (empty) -> auto-select the day's fresh feed target, audit **only if it is a Rust IC canister**, else exit clean. See §C1.
> - `owner/repo` -> audit that GitHub repo (e.g. `dfinity/examples`, a specific canister repo).
> - `fixture:<name>` -> **local regression mode**: audit the bundled fixture at `skills/canister-audit/fixtures/<name>/` (e.g. `fixture:token_vault`). No fork, no dedup, no disclosure - a self-contained way to exercise the whole pipeline including the PocketIC proof arm. See §C1/§C2.
>
> **Scope: Rust canisters only** (ic-cdk / candid). Motoko is out of scope for this skill. There is no on-chain-by-address mode - an IC audit operates on source (a canister's logic is not recoverable from its deployed wasm the way verified EVM source is).
Today is ${today}. Read `memory/MEMORY.md` and the last 30 days of `memory/logs/` before starting.
## Why this skill exists
Canister bugs are logic and economics on a message-passing model, not syntax. The high-value classes - anonymous-principal access, TOCTOU across `await`, callback-trap-after-mutation, unbounded storage/cycle-drain DoS, upgrade-safety - are what an agentic reviewer catches by reading the source and reasoning about **who can call what and which invariant breaks across an await**. No off-the-shelf static tool models them: `vuln-scanner` and `sc-audit` have zero IC-aware analysis (Slither is Solidity-only; osv/cargo-audit cover Rust *dependency* CVEs, not canister logic). This skill is that missing IC arm.
It is `sc-audit` with the EVM pieces swapped for IC pieces and the shared machinery reused unchanged: the PoC gate (`command` mode), disclosure routing, dedup ledger, coverage manifest, report shape, and the staging/allowlist pattern. The agentic source pass (§C5) is the **reliable core** and needs no toolchain; Semgrep and the PocketIC proof arm are best-effort extras, so a clean audit never depends on either succeeding.
**Shell shape.** Each Bash call is one allowed command (pipes are fine). The run refuses a call that **redirects into a file** (`> f`, `>> f`, `cat > f <<EOF`, `| tee f` - `/tmp` included), sets a variable (`REPO=...`), starts with `export`, uses `if` / `case` / `[ ... ]` tests, joins commands with `;` / `&&` / `||`, or uses `find` / `cp` / `rm` / `tr` / `printf` / `command -v`. So decide in prose from what each call printed, write the values you already know (`<WORKDIR>`, `<SCRATCH>`, `<TARGET_COMMIT>`, `<REPO>`, `<FIXTURE>`) into later commands **literally in place of the placeholder**, save tool output with a flag (`--output` / `-o`) or a `node -e` writer, copy files with `python3`, and write or append `sources.txt`/JSON artifacts with the **Write/Edit** tools. Only the working directory carries between calls; shell variables do not. `<SCRATCH>` is `/tmp/canister-audit` (the staging step sets `CARGO_TARGET_DIR` under it); `gh`, `git`, `cargo`, `semgrep`, `node`, `python3`, `mkdir`, `cd` are allowed by bare name (dep CVEs run via the `cargo audit` subcommand; the PocketIC server is launched by the repro's `pocket-ic` crate via `POCKET_IC_BIN`, not a bare command).
## C1. Detect a Rust canister and select the target
...From aeonfun's repository, MIT licence.
Related skills
-
Checked
Codebase quality audit
Audits a whole code repo for bugs, security holes, slow paths and dead code, ranked in plain English.
7/101 credit -
Checked
Security and CVE audit
Runs a security and CVE audit on code in any language and scores it out of 100, with false alarms filtered.
7/101 credit -
Checked
OWASP code review
Reviews code for security flaws using the latest OWASP Top 10 lists, including those for AI and agent apps.
7/101 credit -
Checked
Code security hardening
Hardens code that handles user input, logins and data against the OWASP Top 10, starting from a threat model.
7/101 credit -
Checked
Android intent security
Audits Android components and incoming intents to fix redirection and unauthorised access holes in your app.
8/101 credit -
Checked
GitHub Actions Security
Reviews your GitHub Actions workflows for script injection, risky triggers and over scoped tokens, with fixes.
7/101 credit