ton-vulnerability-scanner — Claude Code skill: TON security audit
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.
CC-BY-SA-4.0 5,700 installs ★ 8,341 updated 2026-10-24
npx skills add trailofbits/skills --skill ton-vulnerability-scanner -a claude-codeWhat ton-vulnerability-scanner does
The skill detects three vulnerability types in TON contracts. First: treating positive integers as booleans — FunC true is -1, not 1, and confusion breaks conditional logic. Second: missing sender validation in transfer_notification handlers — without checking that the sender matches the trusted Jetton wallet address, an attacker can forge token transfer notifications. Third: forwarding user-supplied forward_ton_amount values without balance checks — the contract can be drained.
The skill scans .fc and .func files, outputs a coverage table for all three patterns (found, verified, or not applicable), and provides detailed reports for each finding with line numbers. Without ton-compiler and toncli installed, it will not run. Reports include specific fixes for each vulnerability.
What it helps with
- detect use of 1 instead of -1 in FunC boolean flags
- verify sender validation in Jetton transfer_notification handlers
- identify user-supplied TON forwarding without balance limits
- run pre-launch security audit on a TON contract
Example prompts for the agent
- Check contracts in
contracts/for TON vulnerabilities - Run ton-vulnerability-scanner on all
.fcfiles in the project - Scan Jetton handlers for missing sender validation
How to install ton-vulnerability-scanner
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill ton-vulnerability-scanner -a claude-code2Manually: put the files in place
~/.claude/skills/ton-vulnerability-scanner/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ton-vulnerability-scanner/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill ton-vulnerability-scanner -a codex2Manually: put the files in place
.agents/skills/ton-vulnerability-scanner/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill ton-vulnerability-scanner -a cursor2Manually: put the files in place
.cursor/skills/ton-vulnerability-scanner/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills plugins/building-secure-contracts/skills/ton-vulnerability-scanner2Manually: put the files in place
.github/skills/ton-vulnerability-scanner/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill ton-vulnerability-scanner -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/building-secure-contracts/skills/ton-vulnerability-scannerManually: put the files in place
.devin/skills/ton-vulnerability-scanner/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill ton-vulnerability-scanner -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ton-vulnerability-scanner
How to install ton-vulnerability-scanner in Claude Code?
Run npx skills add trailofbits/skills --skill ton-vulnerability-scanner -a claude-code, then open ~/.claude/skills/ton-vulnerability-scanner/SKILL.md.
What does ton-vulnerability-scanner do?
It scans FunC contracts for three vulnerabilities: integer-as-boolean misuse, missing sender checks in Jetton notifications, and unsafe TON forwarding without gas reservation.
What does ton-vulnerability-scanner require to run?
It needs ton-compiler and toncli installed on the system. Without them, the skill cannot analyze FunC files.