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
The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis
Security Insights

The Decentralization Dilemma: Cascading Risk and Emergency Power in the KelpDAO Crisis

This BlockSec deep-dive analyzes the KelpDAO $290M rsETH cross-chain bridge exploit (April 18, 2026), attributed to the Lazarus Group, tracing a causal chain across three layers: how a single-point DVN dependency enabled the attack, how DeFi composability cascaded the damage through Aave V3 lending markets to freeze WETH liquidity exceeding $6.7B across Ethereum, Arbitrum, Base, Mantle, and Linea, and how the crisis forced decentralized governance to exercise centralized emergency powers. The article examines three parameters that shaped the cascade's severity (LTV, pool depth, and cross-chain deployment count) and provides an exclusive technical breakdown of Arbitrum Security Council's forced state transition, an atomic contract upgrade that moved 30,766 ETH without the holder's signature.

Weekly Web3 Security Incident Roundup | Apr 13 – Apr 19, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Apr 13 – Apr 19, 2026

This BlockSec weekly security report covers four attack incidents detected between April 13 and April 19, 2026, across multiple chains such as Ethereum, Unichain, Arbitrum, and NEAR, with total estimated losses of approximately $310M. The highlighted incident is the $290M KelpDAO rsETH bridge exploit, where an attacker poisoned the RPC infrastructure of the sole LayerZero DVN to fabricate a cross-chain message, triggering a cascading WETH freeze across five chains and an Arbitrum Security Council forced state transition that raises questions about the actual trust boundaries of decentralized systems. Other incidents include a $242K MMR proof forgery on Hyperbridge, a $1.5M signed integer abuse on Dango, and an $18.4M circular swap path exploit on Rhea Finance's Burrowland protocol.

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Apr 6 – Apr 12, 2026

This BlockSec weekly security report covers four DeFi attack incidents detected between April 6 and April 12, 2026, across Linea, BNB Chain, Arbitrum, Optimism, Avalanche, and Base, with total estimated losses of approximately $928.6K. Notable incidents include a $517K approval-related exploit where a user mistakenly approved a permissionless SquidMulticall contract enabling arbitrary external calls, a $193K business logic flaw in the HB token's reward-settlement logic that allowed direct AMM reserve manipulation, a $165.6K exploit in Denaria's perpetual DEX caused by a rounding asymmetry compounded with an unsafe cast, and a $53K access control issue in XBITVault caused by an initialization-dependent check that failed open. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Best Security Auditor for Web3

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

BlockSec Audit