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
Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation
Security Insights

Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation

On April 1, 2026 (UTC), Drift Protocol on Solana suffered a $285.3M loss after an attacker exploited Solana's durable nonce mechanism to delay the execution of phished multisig approvals, ultimately transferring administrative control of the protocol's 2-of-5 Squads governance with zero timelock. With full admin privileges, the attacker created a malicious collateral market (CVT), inflated its oracle price, relaxed withdrawal protections, and drained USDC, JLP, SOL, cbBTC, and other assets through 31 rapid withdrawals in approximately 12 minutes. This incident highlights how durable nonce-based delayed execution can decouple signer intent from on-chain execution, bypassing the temporal assumptions that multisig security implicitly relies on.

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

Weekly Web3 Security Incident Roundup | Mar 23 – Mar 29, 2026

This BlockSec weekly security report covers eight DeFi attack incidents detected between March 23 and March 29, 2026, across Ethereum and BNB Chain, with total estimated losses of approximately $1.53M. Incidents include a $679K flawed burn mechanism exploit on the BCE token, a $512K spot-price manipulation attack on Cyrus Finance's PancakeSwap V3 liquidity withdrawal, a $133.5K flash-loan-driven referral reward manipulation on a TUR staking contract, and multiple integer overflow, reentrancy, and accounting error vulnerabilities in DeFi protocols. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Newsletter -  March 2026
Security Insights

Newsletter - March 2026

In March 2026, the DeFi ecosystem experienced three major security incidents. Resolv Protocol lost ~$80M due to compromised privileged infrastructure keys, BitcoinReserveOffering suffered ~$2.7M from a double-minting logic flaw, and Venus Protocol incurred ~$2.15M following a donation attack combined with market manipulation.

Best Security Auditor for Web3

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

BlockSec Audit