Skip to main content
skill CX Codex

cairo-vulnerability-scanner — Claude Code skill: Cairo contract audit

cairo-vulnerability-scanner — a skill that scans Cairo contracts on StarkNet for 6 vulnerability patterns, from felt252 overflow to replayed signatures. Use it when auditing L1-L2 bridges.

CC-BY-SA-4.0 5,700 installs ★ 8,341 updated 2026-10-24

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add trailofbits/skills --skill cairo-vulnerability-scanner -a claude-code
Open on GitHub

What cairo-vulnerability-scanner does

The skill walks through the .cairo files in a project and checks each contract against 6 StarkNet-specific vulnerability patterns. They include silent felt252 wraparound, replayable signatures, an L1 address never compared with STARKNET_FIELD_PRIME, and L1 to L2 messages with no way to cancel. The worst one, an unchecked from_address in an #[l1_handler], is rated CRITICAL. The others are HIGH or MEDIUM.

It works in steps: identify the Cairo version and contract files, search for felt252 in arithmetic with rg, go through every L1 handler, review nonces and domain separators in signature code, audit the bridge, then run caracal detect src/. Each finding comes with a file location and a suggested fix.

Before the findings, the report shows a coverage table where all 6 patterns get a verdict, even those that turned up nothing. So a quiet pattern never reads as a clean contract. The static analysis step needs Caracal installed first: it is a Rust tool, installed with cargo, not from PyPI.

What it helps with

  • find felt252 balances that wrap silently
  • check that every #[l1_handler] validates from_address
  • confirm signatures cannot be replayed
  • review an L1-L2 bridge before launch
  • get a suggested fix for each finding

Example prompts for the agent

  • Scan the Cairo contracts in src/ with cairo-vulnerability-scanner
  • Audit this StarkNet bridge: check every #[l1_handler] and the message cancellation path
  • Check the signature code in my .cairo files for nonce and domain separator problems

How to install cairo-vulnerability-scanner

1Skills CLI (Vercel)

npx skills add trailofbits/skills --skill cairo-vulnerability-scanner -a claude-code

2Manually: put the files in place

~/.claude/skills/cairo-vulnerability-scanner/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cairo-vulnerability-scanner/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cairo-vulnerability-scanner

How do I install cairo-vulnerability-scanner in Claude Code?

Run npx skills add trailofbits/skills --skill cairo-vulnerability-scanner -a claude-code. The skill file should end up at ~/.claude/skills/cairo-vulnerability-scanner/SKILL.md.

What does cairo-vulnerability-scanner do?

It checks .cairo files against 6 StarkNet vulnerability patterns. The report opens with a coverage table, followed by findings and fixes.

Does cairo-vulnerability-scanner need Caracal?

The static analysis step does: it runs caracal detect src/. Caracal is a Rust tool, installed with cargo and not from PyPI.

Similar skills

All skills for Security →

From the same set95

The whole set →
ruzzy Installs and runs Ruzzy, a coverage-guided Ruby fuzzer built on libFuzzer. It also covers fuzzing C extensions in gems and sanitizer builds. CX Codex +1 5,700installs wycheproof A skill for Claude Code, Codex, Cursor, and other platforms that validates cryptographic implementations against Project Wycheproof test vectors, covering AES, RSA, ECDSA, ECDH, and more. CX Codex +1 5,700installs substrate-vulnerability-scanner substrate-vulnerability-scanner scans Substrate and Polkadot pallets for 7 critical vulnerabilities such as panic DoS and integer overflow. Useful when auditing FRAME runtimes before mainnet launch. CX Codex +1 5,700installs atheris Sets up Atheris, a coverage-guided Python fuzzer built on libFuzzer. Runs fuzzing on pure Python code and native C extensions with AddressSanitizer. CX Codex +1 5,700installs ossfuzz Guides your AI agent through enrolling projects in Google OSS-Fuzz and running fuzzer targets locally with helper scripts. CX Codex +1 5,700installs ton-vulnerability-scanner ton-vulnerability-scanner scans TON smart contracts (FunC) for three critical vulnerabilities: integer-as-boolean misuse, fake Jetton contracts, and forwarding TON without gas checks. CX Codex +1 5,700installs skill-improver The skill-improver skill runs repeated reviews and fixes on another skill until the review has no critical or major findings. It relies on the plugin-dev reviewer agent. CX Codex +1 5,600installs let-fate-decide The let-fate-decide skill uses a Tarot spread to suggest a direction when a request leaves several reasonable options open. It suits casual handoffs where the agent is asked to choose. CX Codex +1 5,300installs

Project sponsors

Companies that keep this analytics open