Back to Blog

Rustle: NEARコミュニティのための初自動監査ツール

Code Auditing
November 1, 2022

BlockSec がNEARコミュニティ向けに提供する初の自動監査ツール、Rustle をリリースできることを大変嬉しく思います。

Rustleには、いくつかの素晴らしい機能があります。

  • Rustleは現在、NEARコントラクトで20種類以上の問題を検出できます。検出器の完全なリストについては、「検出器」セクションを参照してください。
  • Rustleは使いやすいです。詳細なインストールコマンドとチュートリアルを提供しています。さらに、ユーザーがすぐに始められるようにDockerも用意しています。
  • Rustleはかなり高速で、ほとんどのNEARコントラクトは3分以内に分析できます。
  • Rustleは、CSVとJSON形式の両方でレポートを作成できるため、ユーザーフレンドリーです。また、結果をNotionにインポートするためのスクリプトも提供しています。

検出器

Rustleが検出できるすべての脆弱性。詳細なドキュメントはこちらで見つけることができます。

検出器ID 説明 重要度
unhandled-promise ハンドルされていないPromiseを検出します
non-private-callback コールバック関数にマクロ #[private] がありません
reentrancy 再入可能攻撃に対して脆弱な関数を見つけます
unsafe-math 算術演算のオーバーフローチェックの欠如
self-transfer 送信者 != 受信者のチェックの欠如
incorrect-json-type パラメータまたは戻り値で間違った型が使用されています
div-before-mul 不正な操作順序による精度損失
round ceil または floor を指定せずに丸めています
lock-callback コールバック関数でのパニックがコントラクトをロックする可能性があります
yocto-attach 特権関数に assert_one_yocto がありません
prepaid-gas ft_transfer_call でプリペイドガスのチェックがありません
non-callback-private コールバック関数ではない関数でマクロ #[private] が使用されています
unused-ret 関数結果が使用されていないか、チェックされていません
upgrade-func コントラクトにアップグレード関数がありません
tautology 条件分岐でトートロジーが使用されています
inconsistency 類似しているがわずかに異なるシンボルの使用
timestamp タイムスタンプの使用をすべて見つけます 情報
complex-loop DoSにつながる可能性のある複雑なロジックを持つループをすべて見つけます 情報
ext-call クロスコントラクトの呼び出しをすべて見つけます 情報
promise-result Promiseの結果の使用をすべて見つけます 情報
transfer 送金アクションをすべて見つけます 情報

使用方法

Rustleを使用して、一般的なNEARコントラクト(例:LiNEAR)を分析しました。コマンドはUbuntu 20.04 LTSでテスト済みです。

  1. GitHubページのインストールマニュアルに従ってください。Dockerを使用したい場合は、これをスキップしてDockerマニュアルに進んでください。

  2. Rustleが分析するためのNEARコントラクトを準備します。

     git clone https://github.com/linear-protocol/LiNEAR.git ~/near-repo/LiNEAR
    
  3. ./rustleを実行して分析を開始します。

     ./rustle -t ~/near-repo/LiNEAR ~/near-repo/LiNEAR/contracts/linear
    
  1. audit-result/summary.csvでレポートを確認します。
  1. 使用する検出器や重要度グループを指定できます。

詳細については、./rustle -hを参照してください。

例:

./rustle -t ~/near-repo/LiNEAR ~/near-repo/LiNEAR/contracts/linear -d high,medium,complex-loop

もう一つ

Rustleは開発プロセスで使用して、NEARスマートコントラクトを反復的にスキャンできます。これにより、多くの手作業を節約し、潜在的な問題を一部軽減できます。ただし、複雑なロジックやセマンティクスに関連する脆弱性は、依然としてRustleの限界です。複雑なセマンティックな問題を見つけるには、BlockSecの専門家による網羅的かつ徹底的なレビューが必要です。監査サービスについては、お問い合わせください。

IssuePRも歓迎します。

BlockSecについて

BlockSecは、2021年に世界的に著名なセキュリティ専門家グループによって設立された、先駆的なブロックチェーンセキュリティ企業です。当社は、Web3の普及を促進するために、新興のWeb3の世界のセキュリティと使いやすさを向上させることに尽力しています。この目的のため、BlockSecはスマートコントラクトとEVMチェーンのセキュリティ監査サービス、セキュリティ開発とプロアクティブな脅威ブロックのためのPhalconプラットフォーム、資金追跡と調査のためのMetaSleuthプラットフォーム、そしてWeb3ビルダーが暗号世界を効率的にサーフィンするためのMetaSuites拡張機能を提供しています。

現在までに、MetaMask、Uniswap Foundation、Compound、Forta、PancakeSwapなど300社以上の著名なクライアントにサービスを提供し、Matrix Partners、Vitalbridge Capital、Fenbushi Capitalなどの著名な投資家から2回の資金調達で数千万米ドルを受け入れています。

公式ウェブサイト:https://blocksec.com/

公式Twitterアカウント:https://twitter.com/BlockSecTeam

Sign up for the latest updates
Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield
Security Insights

Tether Freezes $6.76M USDT Linked to Iran's IRGC & Houthi Forces: Why On-Chain Compliance is Now a Geopolitical Battlefield

Looking ahead, targeted freezing events like this $6.76M USDT action will only become more common. On-chain data analysis is improving. Stablecoin issuers are also working closely with regulators. As a result, hidden illicit financial networks will be exposed.

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Mar 2 – Mar 8, 2026

During the week of March 2 to March 8, 2026, seven blockchain security incidents were reported with total losses of ~$3.25M. The incidents occurred across Base, BNB Chain, and Ethereum, exposing critical vulnerabilities in smart contract business logic, token deflationary mechanics, and asset price manipulation. The primary causes included a double-minting logic flaw during full token deposits that allowed an attacker to exponentially inflate their balances through repeated burn-and-mint cycles, a price manipulation vulnerability in an AMM-based lending market where artificially inflated vault shares created divergent price anchors to incorrectly force healthy positions into liquidation, and a flawed access control implementation relying on trivially spoofed contract interfaces that enabled attackers to bypass authorization to batch-mint and dump arbitrary tokens.

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Feb 23 – Mar 1, 2026

During the week of February 23 to March 1, 2026, seven blockchain security incidents were reported with total losses of ~$13M. The incidents affected multiple protocols, exposing critical weaknesses in oracle design/configuration, cryptographic verification, and core business logic. The primary drivers included oracle manipulation/misconfiguration that led to the largest loss at YieldBloxDAO (~$10M), a crypto-proof verification flaw that enabled the FOOMCASH (~$2.26M) exploit, and additional token design and logic errors impacting Ploutos, LAXO, STO, HedgePay, and an unknown contract, underscoring the need for rigorous audits and continuous monitoring across all protocol layers.