ton-vulnerability-scanner

Detect TON FunC contract vulnerabilities including unauthorized Jetton transfers and unsafe gas forwarding.

6.5k|561|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/trailofbits/skills --skill ton-vulnerability-scanner-trailofbits
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ton-vulnerability-scanner
Source: https://github.com/trailofbits/skills/tree/main/plugins/building-secure-contracts/skills/ton-vulnerability-scanner
Command: npx skills add https://github.com/trailofbits/skills --skill ton-vulnerability-scanner-trailofbits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TON smart contracts written in FunC can harbor critical security flaws that enable unauthorized Jetton transfers, boolean logic errors, and unsafe gas forwarding; this skill provides detection patterns, mitigations, and guidance to audit and harden TON dApps.

Core Features & Use Cases

  • Detects three core vulnerability patterns in TON contracts: integer-as-boolean misuse, fake Jetton transfer notifications, and forward TON without proper gas checks.
  • Provides remediation guidance and test/verification strategies for TON FunC audits.
  • Useful during pre-launch security reviews, Jetton wallet integrations, and ongoing security assessments of TON-based dApps.

Quick Start

Run the TON vulnerability scanner against your FunC contracts to detect the three core issues and produce a remediation report.

Frequently Asked Questions about ton-vulnerability-scanner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit TON smart contracts for FunC vulnerabilities?

Auditing TON smart contracts for FunC vulnerabilities involves scanning the code to detect integer-as-boolean misuse, fake Jetton transfer notifications, and unsafe forward TON gas forwarding. The scanner outputs structured findings with mitigation guidance to harden TON dApps.

What security flaws enable unauthorized Jetton transfers in TON contracts?

Unauthorized Jetton transfers in TON contracts are typically enabled by fake transfer notification patterns and improper sender validation. The scanner identifies these specific flaws in FunC code, validating sender integrity within transfer-notification flows to prevent unauthorized asset movement.

How does unsafe gas forwarding affect TON smart contract security?

Unsafe gas forwarding in TON smart contracts allows execution to proceed without proper gas checks, potentially leading to unexpected contract behavior. The scanner detects forward TON patterns lacking proper gas accounting and provides remediation strategies to secure contract execution.

Can I use this scanner for Jetton wallet integration security reviews?

Yes, the scanner is specifically useful for Jetton wallet integrations and pre-launch security reviews. It validates sender integrity and gas accounting in Jetton-related wallets and transfer-notification flows, producing structured findings suitable for integration into security assessments.

What is integer-as-boolean misuse in FunC contract code?

Integer-as-boolean misuse in FunC code occurs when integer values are incorrectly evaluated as boolean conditions, causing logic errors. The scanner detects this vulnerability pattern in TON contracts and provides detection patterns alongside test and verification strategies.