Back to Blog

ゼロ号機攻撃の分析

Code Auditing
August 9, 2021
3 min read

2021年8月8日(北京時間、ブロック高12982491)、Zerogokiは攻撃を受け、67万ドルの損失が発生しました。調査の結果、価格オラクルの侵害に関連していることが判明しました。攻撃者は、正当な秘密鍵で署名された価格オラクルを提供し、そこには交換されるトークンの不正な数が含まれていました。しかし、攻撃者が有効な署名を構築できた理由は、現時点では不明です。

コード解析

まず、攻撃されたコントラクト(0x80ecdb90)の解析を行いました。

swap関数は、オラクルの情報を取得するためにdecode_opを呼び出します。検証を実行した後、コントラクトはns[0] x.tokenをバーンし、ns[1] y.tokenをミントし、swap手数料をGOVコントラクトに支払います。

decode_opの実装から、パラメータには3つの署名が存在することがわかります。これらの署名は、トークンスワップ(バーンとミント)を実行する前にチェック(および承認)される必要があります。

要約すると、swap関数の最初のパラメータnsは、交換されるトークンの数を定義します。2番目のパラメータには、検証が必要な署名が含まれています。検証が成功すると、交換されるトークンの数は最初のパラメータ(ns)で定義されます。

攻撃解析

攻撃トランザクション(0x81e5f715)では、攻撃者は有効な署名を含むメッセージを構築し、不正なnsパラメータ(大量のzUSDを含む)を渡しました。その結果、攻撃者は300 REIを使用して70万zUSDを交換しました。

署名に関連付けられている3つのアドレスは次のとおりです。

0x0d93A21b4A971dF713CfC057e43F5D230E76261C
0x3054e19707447800f0666ba274a249fc9a67aa4a
0x4448993f493b1d8d9ed51f22f1d30b9b4377dfd2

しかし、現時点では、これらのアドレスの秘密鍵が漏洩した理由は不明です。

まとめ

DeFiプロジェクトを安全にすることは容易ではありません。コード監査に加えて、コミュニティはプロジェクトの状況を積極的に監視し、攻撃が発生する前にブロックするべきだと考えています。

BlockSecについて

BlockSecは、2021年に世界的に著名なセキュリティ専門家グループによって設立された、先駆的なブロックチェーンセキュリティ企業です。当社は、新興の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