Skip to content
SkillModel-led3,210 tokens in use

Cairo Vulnerability Scanner

Scans Cairo and StarkNet contracts for 6 critical vulnerabilities in arithmetic, L1-L2 messaging and signatures, with a verdict for every pattern.

8,319 stars on the repository CC-BY-SA-4.0trailofbits/skills · plugins/building-secure-contracts/skills/cairo-vulnerability-scanner
/plugin marketplace add trailofbits/skills
View source

Install command as written in the repository's README

Skill label

measured from its files

What installing Cairo Vulnerability Scanner costs

48tokens idle
3,210tokens in use
8,394tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Model-led

Script-ledMixedModel-led

Mostly instructions, so how well it works depends on the model that follows them.

This describes the skill's structure, how much of it is scripts. It does not say how well it works.

Touches

shelldetectednetworkdetectedwrites filesdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Excellent
  • Frontmatter12/15
  • Structure23/25
  • Examples15/15
  • Output15/15
  • Size15/15
  • Resources7/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Good
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 120
  • Writes files−8

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 211
  • Reaches the network−10

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 309

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity100
  • Maintenance52
  • Community64
  • Maturity32
  • Momentum40

Cairo Vulnerability Scanner audits StarkNet contracts for six patterns: felt252 overflow, L1 to L2 address conversion, message failure without cancellation, overconstrained L1-L2 interaction, signature replay and an unchecked from_address in L1 handlers.

Reports start with a coverage table that gives every pattern a verdict of found, clear or n/a, then write up each finding with code, an attack scenario and a fix. The Caracal analyzer can be run alongside.

What You Get

  • A coverage table with all six patterns and a verdict with evidence for each
  • Findings with severity, location, vulnerable code, attack scenario and recommendation
  • Checklists for arithmetic safety, L1 handlers, L1-L2 messaging and signature security
  • Unit and integration test suggestions and a Caracal CI snippet

Common Use Cases

  • Auditing a StarkNet bridge before launch
  • Reviewing L1 handler functions for sender validation
  • Checking balance logic for felt252 wraparound
  • Reviewing signature verification and replay protection

What Makes It Unique

The skill is specific to StarkNet’s cross-layer model. It treats an unchecked from_address as the canonical bridge bug, flags felt252 where sized integers belong, and requires the L1 contract to be read and cited before an L1 check is accepted. A full coverage table is required even when nothing is found, and a clean Caracal run does not count as a verdict.

Under The Hood

The skill is an instruction file with a linked pattern resource. It tells the agent to search for Cairo files, use ripgrep to look for felt252 in arithmetic and balances, and run the Caracal detector, which the user installs with cargo from a git repository. Its CI example installs and runs Caracal from a workflow. The skill reads project files and does not edit contracts or fetch web pages.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers