Transfer events can lie, storage cannot: catching malicious token transfers
Token transfer events on blockchain can be spoofed to deceive users and applications. While event logs can be faked, the actual on-chain storage state reveals the truth. This article explains how to detect malicious transfers by comparing event data with storage proofs, using Apollo as a detection tool to verify the real balance changes.
背景メモ
- **Apollo**(旧称Harmony)は、Cosmos SDKベースのレイヤー1ブロックチェーン。2022年に約1億ドル相当の資産が盗まれるハッキング被害を受けた後、エコシステムの再建とセキュリティ強化を進めている。
- **この記事の核心**: トークン移転の検出において、スマートコントラクトの`Transfer`イベントログ(EVM標準)を信用せず、ブロックチェーンの**ストレージデータ**(実際の残高変更)を直接読み取る手法を提案。イベントログは偽装(スプーフィング)できるが、ストレージの改ざんは事実上不可能だから。
- **なぜ重要か**: DeFiプロトコルや取引所は「不正なトークン移転」を検出するためにイベントログに依存する場合が多い。しかし悪意あるトークンコントラクトは、実際には移転が起きていないのに`Transfer`イベントを発行でき、監視システムを欺ける。この脆弱性は既に実戦で悪用されている。
- この手法は**Ethereumだけでなく、EVM互換の全チェーン(Apollo含む)**に適用可能な、汎用的なセキュリティアプローチ。