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
~$15.9M Lost: Trusted Volumes & More | BlockSec Weekly
Security Insights

~$15.9M Lost: Trusted Volumes & More | BlockSec Weekly

This BlockSec bi-weekly security report covers 11 notable attack incidents identified between April 27 and May 10, 2026, across Sui, Ethereum, BNB Chain, Base, Blast, and Berachain, with total estimated losses of approximately $15.9M. Three incidents are analyzed in detail: the highlighted $1.14M Aftermath Finance exploit on Sui, where a signed/unsigned semantic mismatch in the builder-fee validation allowed an attacker to inject a negative fee that was converted into positive collateral during settlement; the $5.87M Trusted Volumes RFQ authorization mismatch on Ethereum; and the $5.7M Wasabi Protocol infrastructure-to-contract-control compromise across multiple EVM chains.

Newsletter - April 2026
Security Insights

Newsletter - April 2026

In April 2026, the DeFi ecosystem experienced three major security incidents. KelpDAO lost ~$290M due to an insecure 1-of-1 DVN bridge configuration exploited via RPC infrastructure compromise, Drift Protocol suffered ~$285M from a multisig governance takeover leveraging Solana's durable nonce mechanism, and Rhea Finance incurred ~$18.4M following a business logic flaw in its margin-trading module that allowed circular swap path manipulatio

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly
Security Insights

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly

This BlockSec weekly security report covers eight attack incidents detected between April 20 and April 26, 2026, across Ethereum, Avalanche, Sui, Base, HyperLiquid, and MegaETH, with total estimated losses of approximately $7.04M. The highlighted incident is the $1.3M GiddyDefi exploit, where the attacker did not break any cryptography or use a flash loan but simply replayed an existing on-chain EIP-712 signature with the unsigned `aggregator` and `fromToken` fields swapped out for a malicious contract, demonstrating how partial signature coverage turns any historical signature into a generic permit. Other incidents include a $3.5M Volo Vault operator key compromise on Sui, a $1.5M Purrlend privileged-role takeover, a $413K SingularityFinance oracle misconfiguration, a $142.7K Scallop cross-pool index injection, a $72.35K Kipseli Router decimal mismatch, a $50.7K REVLoans (Juicebox) accounting pollution, and a $64K Custom Rebalancer arbitrary-call exploit.

Best Security Auditor for Web3

Validate design, code, and business logic before launch. Aligned with the highest industry security standards.

BlockSec Audit