Back to Blog

ゼロゴキ攻撃の分析

Code Auditing
August 9, 2021

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

コード分析

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

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

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

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

攻撃分析

攻撃トランザクション(0x81e5f715)では、攻撃者は有効な署名を含むメッセージを構築し、不正に細工されたnsパラメータ(大量のzUSDを含む)を渡しました。その結果、攻撃者は300REIを使用して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
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