Token导航 LogoToken导航

Agent Skill · 研究检索

ton-vulnerability-scanner(吨漏洞扫描器)

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

ton-vulnerability-scanner 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 3,177。

总安装 47,424周安装 1,916GitHub Stars 4,912下载 15,352核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ton-vulnerability-scanner(吨漏洞扫描器)
来源仓库:https://github.com/trailofbits/skills
仓库路径:skills/ton-vulnerability-scanner
安装命令:
npx skills add https://github.com/trailofbits/skills --skill ton-vulnerability-scanner
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/trailofbits/skills --skill ton-vulnerability-scanner

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

扫描 TON 智能合约是否存在 3 个严重漏洞:整数布尔值滥用、虚假 Jetton 合约和不安全的气体转发。

通过文件扩展名(.fc)检测 FunC 合约, .func )和 TON 项目结构(蓝图、toncli 配置) 识别三种漏洞模式:Jetton 处理程序中缺少发送者验证、使用正整数而不是 -1/0 的错误布尔逻辑以及在没有 Gas 检查的情况下转发 TON 金额 提供详细的发现结果,包括易受攻击的代码片段、攻击场景、概念验证示例和建议的修复 包括带有单元和集成测试模板的测试策略,用于验证布尔运算、拒绝虚假 Jetton 传输以及验证气体约束

来源仓库内路径:skills/ton-vulnerability-scanner

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/trailofbits/skills --skill ton-vulnerability-s…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

ton-vulnerability-scanner 怎么安装?

在终端执行 npx skills add https://github.com/trailofbits/skills --skill ton-vulnerability-scanner。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ton-vulnerability-scanner 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ton-vulnerability-scanner 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

ton-vulnerability-scanner 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

ton-vulnerability-scanner 用的人多吗?

公开数据是累计安装 47,424 次,近一周安装 1,916 次,下载 15,352 次,GitHub 4,912 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ton-vulnerability-scanner 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 来源仓库有 4,912 星,维护活跃度相对可查。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
ton-vulnerability-scanner

吨漏洞扫描器 · 本页

47,4244,912只读MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

TON Vulnerability Scanner

1. Purpose

Systematically scan TON blockchain smart contracts written in FunC for platform-specific security vulnerabilities related to boolean logic, Jetton token handling, and gas management. This skill encodes 3 critical vulnerability patterns unique to TON's architecture.

2. When to Use This Skill

  • Auditing TON smart contracts (FunC language)
  • Reviewing Jetton token implementations
  • Validating token transfer notification handlers
  • Pre-launch security assessment of TON dApps
  • Reviewing gas forwarding logic
  • Assessing boolean condition handling

3. Platform Detection

File Extensions & Indicators

  • FunC files: .fc, .func

Language/Framework Markers

;; FunC contract indicators
#include "imports/stdlib.fc";

() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {
    ;; Contract logic
}

() recv_external(slice in_msg) impure {
    ;; External message handler
}

;; Common patterns
send_raw_message()
load_uint(), load_msg_addr(), load_coins()
begin_cell(), end_cell(), store_*()
transfer_notification operation
op::transfer, op::transfer_notification
.store_uint().store_slice().store_coins()

Project Structure

  • contracts/*.fc - FunC contract source
  • wrappers/*.ts - TypeScript wrappers
  • tests/*.spec.ts - Contract tests
  • ton.config.ts or wasm.config.ts - TON project config

Tool Support

  • TON Blueprint: Development framework for TON
  • toncli: CLI tool for TON contracts
  • ton-compiler: FunC compiler
  • Manual review primarily (limited automated tools)

4. How This Skill Works

When invoked, I will:

  1. Search your codebase for FunC/Tact contracts
  2. Analyze each contract for the 3 vulnerability patterns
  3. Report findings with file references and severity
  4. Provide fixes for each identified issue
  5. Check replay protection and sender validation

5. Example Output

When vulnerabilities are found, you'll get a report like this:

=== TON VULNERABILITY SCAN RESULTS ===

Project: my-ton-contract
Files Scanned: 3 (.fc, .tact)
Vulnerabilities Found: 2

---

[CRITICAL] Missing Replay Protection
File: contracts/wallet.fc:45
Pattern: No sequence number or nonce validation

---

## 5. Vulnerability Patterns (3 Patterns)

I check for 3 critical vulnerability patterns unique to TON. For detailed detection patterns, code examples, mitigations, and testing strategies, see [VULNERABILITY_PATTERNS.md](resources/VULNERABILITY_PATTERNS.md).

### Pattern Summary:

1. **Missing Sender Check** ⚠️ CRITICAL - No sender validation on privileged operations
2. **Integer Overflow** ⚠️ CRITICAL - Unchecked arithmetic in FunC
3. **Improper Gas Handling** ⚠️ HIGH - Insufficient gas reservations

For complete vulnerability patterns with code examples, see [VULNERABILITY_PATTERNS.md](resources/VULNERABILITY_PATTERNS.md).
## 5. Scanning Workflow

### Step 1: Platform Identification
1. Verify FunC language (`.fc` or `.func` files)
2. Check for TON Blueprint or toncli project structure
3. Locate contract source files
4. Identify Jetton-related contracts

### Step 2: Boolean Logic Review

Find boolean-like variables

rg "int.*is_|int.*has_|int.*flag|int.*enabled" contracts/

Check for positive integers used as booleans

rg "= 1;|return 1;" contracts/ | grep -E "is_|has_|flag|enabled|valid"

Look for NOT operations on boolean-like values

rg "~.*\(|~ " contracts/


For each boolean:

- Uses -1 for true, 0 for false
- NOT using 1 or other positive integers
- Logic operations work correctly

### Step 3: Jetton Handler Analysis

Find transfer_notification handlers

rg "transfer_notification|op::transfer_notification" contracts/


For each Jetton handler:

- Validates sender address
- Sender checked against stored Jetton wallet address
- Cannot trust forward_payload without sender validation
- Has admin function to set Jetton wallet address

### Step 4: Gas/Forward Amount Review

Find forward amount usage

rg "forward_ton_amount|forward_amount" contracts/ rg "load_coins\(\)" contracts/

Find send_raw_message calls

rg "send_raw_message" contracts/


For each outgoing message:

- Forward amounts are fixed/bounded
- OR user-provided amounts validated against msg_value
- Cannot drain contract balance
- Appropriate send_raw_message flags used

### Step 5: Manual Review

TON contracts require thorough manual review:

- Boolean logic with `~`, `&`, `|` operators
- Message parsing and validation
- Gas economics and fee calculations
- Storage operations and data serialization

---

## 6. Reporting Format

### Finding Template

[CRITICAL] Fake Jetton Contract - Missing Sender Validation

Location: contracts/staking.fc:85-95 (recv_internal, transfer_notification handler)

Description: The transfer_notification operation handler does not validate that the sender is the expected Jetton wallet contract. Any attacker can send a fake transfer_notification message claiming to have transferred tokens, crediting themselves without actually depositing any Jettons.

Vulnerable Code:

// staking.fc, line 85
if (op == op::transfer_notification) {
    int jetton_amount = in_msg_body~load_coins();
    slice from_user = in_msg_body~load_msg_addr();

    ;; WRONG: No validation of sender_address!
    ;; Attacker can claim any jetton_amount

    credit_user(from_user, jetton_amount);
}

Attack Scenario:

  1. Attacker deploys malicious contract
  2. Malicious contract sends transfer_notification message to staking contract
  3. Message claims attacker transferred 1,000,000 Jettons
  4. Staking contract credits attacker without checking sender
  5. Attacker can now withdraw from contract or gain benefits without depositing

Proof of Concept:

// Attacker sends fake transfer_notification
const attackerContract = await blockchain.treasury("attacker");

await stakingContract.sendInternalMessage(attackerContract.getSender(), {
  op: OP_CODES.TRANSFER_NOTIFICATION,
  jettonAmount: toNano("1000000"), // Fake amount
  fromUser: attackerContract.address,
});

// Attacker successfully credited without sending real Jettons
const balance = await stakingContract.getUserBalance(attackerContract.address);
expect(balance).toEqual(toNano("1000000")); // Attack succeeded

Recommendation: Store expected Jetton wallet address and validate sender:

global slice jetton_wallet_address;

() recv_internal(...) impure {
    load_data();  ;; Load jetton_wallet_address from storage

    slice cs = in_msg_full.begin_parse();
    int flags = cs~load_uint(4);
    slice sender_address = cs~load_msg_addr();

    int op = in_msg_body~load_uint(32);

    if (op == op::transfer_notification) {
        ;; CRITICAL: Validate sender
        throw_unless(error::wrong_jetton_wallet,
            equal_slices(sender_address, jetton_wallet_address));

        int jetton_amount = in_msg_body~load_coins();
        slice from_user = in_msg_body~load_msg_addr();

        ;; Safe to credit user
        credit_user(from_user, jetton_amount);
    }
}

References:

  • building-secure-contracts/not-so-smart-contracts/ton/fake_jetton_contract
---

## 7. Priority Guidelines

### Critical (Immediate Fix Required)
- Fake Jetton contract (unauthorized minting/crediting)

### High (Fix Before Launch)
- Integer as boolean (logic errors, broken conditions)
- Forward TON without gas check (balance drainage)

---

## 8. Testing Recommendations

### Unit Tests

import { Blockchain } from "@ton/sandbox"; import { toNano } from "ton-core";

describe("Security tests", () => { let blockchain: Blockchain; let contract: Contract;

beforeEach(async () => { blockchain = await Blockchain.create(); contract = blockchain.openContract(await Contract.fromInit()); });

it("should use correct boolean values", async () => { // Test that TRUE = -1, FALSE = 0 const result = await contract.getFlag(); expect(result).toEqual(-1n); // True expect(result).not.toEqual(1n); // Not 1! });

it("should reject fake jetton transfer", async () => { const attacker = await blockchain.treasury("attacker");

const result = await contract.send( attacker.getSender(), { value: toNano("0.05") }, { $$type: "TransferNotification", query_id: 0n, amount: toNano("1000"), from: attacker.address, } );

expect(result.transactions).toHaveTransaction({ success: false, // Should reject }); });

it("should validate gas for forward amount", async () => { const result = await contract.send( user.getSender(), { value: toNano("0.01") }, // Insufficient gas { $$type: "Transfer", to: recipient.address, forward_ton_amount: toNano("1"), // Trying to forward 1 TON } );

expect(result.transactions).toHaveTransaction({ success: false, }); }); });


### Integration Tests

// Test with real Jetton wallet it("should accept transfer from real jetton wallet", async () => { // Deploy actual Jetton minter and wallet const jettonMinter = await blockchain.openContract(JettonMinter.create()); const userJettonWallet = await jettonMinter.getWalletAddress(user.address);

// Set jetton wallet in contract await contract.setJettonWallet(userJettonWallet);

// Real transfer from Jetton wallet const result = await userJettonWallet.sendTransfer( user.getSender(), contract.address, toNano("100"), {} );

expect(result.transactions).toHaveTransaction({ to: contract.address, success: true, }); });


---

## 9. Additional Resources

- **Building Secure Contracts**: `building-secure-contracts/not-so-smart-contracts/ton/`
- **TON Documentation**: [https://docs.ton.org/](https://docs.ton.org/)
- **FunC Documentation**: [https://docs.ton.org/develop/func/overview](https://docs.ton.org/develop/func/overview)
- **TON Blueprint**: [https://github.com/ton-org/blueprint](https://github.com/ton-org/blueprint)
- **Jetton Standard**: [https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md)

---

## 10. Quick Reference Checklist

Before completing TON contract audit:

**Boolean Logic (HIGH)**:

- All boolean values use -1 (true) and 0 (false)
- NO positive integers (1, 2, etc.) used as booleans
- Functions returning booleans return -1 for true
- Boolean logic with `~`, `&`, `|` uses correct values
- Tests verify boolean operations work correctly

**Jetton Security (CRITICAL)**:

- `transfer_notification` handler validates sender address
- Sender checked against stored Jetton wallet address
- Jetton wallet address stored during initialization
- Admin function to set/update Jetton wallet
- Cannot trust forward_payload without sender validation
- Tests with fake Jetton contracts verify rejection

**Gas & Forward Amounts (HIGH)**:

- Forward TON amounts are fixed/bounded
- OR user-provided amounts validated: `msg_value >= tx_fee + forward_amount`
- Contract balance protected from drainage
- Appropriate `send_raw_message` flags used
- Tests verify cannot drain contract with excessive forward amounts

**Testing**:

- Unit tests for all three vulnerability types
- Integration tests with real Jetton contracts
- Gas cost analysis for all operations
- Testnet deployment before mainnet

平台分布

Claude Code

27.12%
按下载量换算4,163

OpenCode

21.16%
按下载量换算3,248

Gemini CLI

16.13%
按下载量换算2,476

Cursor

13.38%
按下载量换算2,054

Antigravity

7.39%
按下载量换算1,135

Codex

3.73%
按下载量换算573

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills