cairo-vulnerability-scanner
An agent skill by trailofbits, from trailofbits/skills. Tags: analysis, blockchain, security, smart-contracts, starknet.
What it does
Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add trailofbits/skills --skill cairo-vulnerability-scanner
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/trailofbits/skills
cp -r skills/plugins/building-secure-contracts/skills/cairo-vulnerability-scanner ~/.claude/skills/cairo-vulnerability-scanner
Safety box score
Grade C, moderate risk: 35 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill is a read-only auditor for Cairo/StarkNet contracts: it searches source files, runs static analysis, and reports the six vulnerability patterns it documents. The main risks are environment impact from shell execution and installing Caracal from a GitHub git URL, which downloads and builds external code in the user’s account.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 2 (moderate) | It explicitly runs shell commands such as `rg "felt252" src/` and `caracal detect src/`, and the CI example runs `cargo install --git ...` before analysis. |
| Network access | 2 (moderate) | The documented install step fetches code from GitHub with `cargo install --git https://github.com/crytic/caracal --profile release --force`, so using the skill can download remote build inputs. |
| Filesystem reach | 2 (moderate) | The install workflow writes into the user’s home tooling area, e.g. the note to cache `~/.cargo`, so it can modify files outside the project directory. |
| Secrets & credentials | 0 (none) | The skill does not ask for API keys, browser sessions, `.env` files, or other credentials, and it only scans source code for vulnerabilities. |
| Privilege & persistence | 2 (moderate) | `cargo install` installs a binary for the current user and changes the user’s toolchain state; it does not need sudo, but it does perform a user-wide install. |
| Instruction hijack surface | 0 (none) | The file contains audit instructions and reporting requirements, but no prompt-injection content like hidden instructions, remote-follow directives, or attempts to override safety rules. |
| Irreversible actions | 0 (none) | It does not deploy, publish, send messages, pay, book, or delete anything; its purpose is analysis and reporting only. |
| Transparency | 1 (low) | The recommended `cargo install --git https://github.com/crytic/caracal ...` is an unpinned remote build, so the exact code executed at install time is not fully visible in the skill repo. |
Before installing
- Read the `cargo install --git https://github.com/crytic/caracal ...` step and decide whether you want an unpinned GitHub build.
- Run the skill in a scratch checkout first, since it scans `src/` and may inspect every `.cairo` file in the project.
- Check whether you are comfortable with user-level writes to `~/.cargo` and a new binary on your PATH.
- If you prefer tighter supply-chain control, pin Caracal to a release/tag before letting the agent use it.
Rated 2026-10-20 by an automated review of 4 files from the skill's repository.
Source
- Repository
- trailofbits/skills (all skills from this repository)
- Path
- plugins/building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md
- Branch
- main
- Collection
- building-secure-contracts
- Updated
- 2026-09-19
Related skills
- algorand-vulnerability-scanner — Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations.
- cosmos-vulnerability-scanner — Scans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence.
- solana-vulnerability-scanner — Scans Solana programs for 6 critical vulnerabilities including arbitrary CPI, improper PDA validation, missing signer/ownership checks, and sysvar spoofing.
- substrate-vulnerability-scanner — Scans Substrate/Polkadot pallets for 7 critical vulnerabilities including arithmetic overflow, panic DoS, incorrect weights, and bad origin checks.
- token-integration-analyzer — Token integration and implementation analyzer based on Trail of Bits' token integration checklist.
- ton-vulnerability-scanner — Scans TON (The Open Network) smart contracts for 3 critical vulnerabilities including integer-as-boolean misuse, fake Jetton contracts.