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.