Back to Blog

EthereumPoWにおける「メッセージ」リプレイ攻撃を暴く

Code Auditing
September 19, 2022
3 min read

2022年9月16日、一部の攻撃者がEthereumPoW(PoWチェーンとしても知られる)のPoSチェーンのメッセージ(つまり、calldata)をリプレイすることで、大量のETHWを正常に収穫できたことを検出しました。 エクスプロイトの根本原因は、PoWチェーン上のOmniブリッジが古いchainIdを使用しており、クロスチェーンメッセージの実際のchainIdを正しく検証していないことです。

直ちにEthereumPoWの公式チームに連絡しました。 チームは積極的に対応する意欲があり、Omni Bridgeとのコミュニケーションを試みることもしました。

しかし、多くの攻撃が観測されたため、リスクは一般に通知されるべきであると信じ、2022年9月18日にアラートを公開しました。

これらの攻撃について、メッセージではなくトランザクションをリプレイするという誤解が依然として存在します。このレポートでは、それを明確にするための詳細な分析を提供したいと思います。

攻撃分析

以下にエクスプロイトトランザクションの例を示します。

これらの2つのトランザクションは異なりますが、これらの2つのトランザクションのcalldata(または入力データ)はまったく同じです

0x23caab4900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000011500050000a7823d6f1e31569f51861e345b30c6bebf70ebe7000000000000e0f6f6a78083ca3e2a662d6dd1703c939c8ace2e268d88ad09518695c6c3712ac10a214be5109a655671000927c00101806401867f7a4d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a6439ca0fcba1d0f80df0be6a17220fed9c9038a0000000000000000000000000000000000000000000000ad78ebc5ac6200000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001482faed2da812d2e5cced3c12b3baeb1a522dc6770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105041c1b1c1c981df6cdaf073d55b78d7f0c7e2b421a569bff677a9464d1d5203672d7b5a3d6af658d14ebc11c26f2547fd0aed01750cca58753a0a79b297bad8a62a71eb6b7ac2099611604eff316e7fe733e9981c1b3890cb04ff9d43612e6f2687227f0226cfa27e4b6cd96a10865e04aa9e0f369dda7548771a094f69bf0a9fa6c27257e22d2b1bbb84beb52ad3966592037b328d352fce375a1fa75cb3fbfd18166f4177a19ad2cc74ce67da68f5ce17b857e6382c3ebf20f76482534135f426f4a74222daa07d9f401cb8baca4339ecd44e285df0e0cb88447a31d08b673cecc67d22c7e6e0ce5afd2ac9439c5a8b68f05077b850cdfdfb79cdaefc5b103bb693609440000000000000000000000000000000000000000000000000000

これは、safeExecuteSignaturesWithAutoGasLimit関数の呼び出しの入力データにすぎません。

明らかに、攻撃者(0x82fae)は最初にGnosisチェーンのOmniブリッジを介して200 WETHを転送し、次に同じメッセージをPoWチェーンでリプレイして、追加の200 ETHWを取得しました。 これにより、PoWチェーン上のデプロイされたチェーンコントラクトの残高を枯渇させることができました。

脆弱性分析

Omniブリッジのソースコードを分析した後、chainIdを検証するロジックが存在することがわかりました。

    function _isDestinationChainIdValid(uint256 _chainId) internal returns (bool res) {
        return _chainId == sourceChainId();
    }

残念ながら、このコントラクトで使用される検証済みのchainIdは、unitStorageという名前のストレージに保存されている値から取得されます。

    /**
     * Internal function for retrieving chain id for the source network
     * @return chain id for the current network
     */
    function sourceChainId() public view returns (uint256) {
        return uintStorage[SOURCE_CHAIN_ID];
    }

これは、EIP-1344で提案されたCHAINID opcodeを介して取得される実際のchainIdではありません。 これは、コードがかなり古い(Solidity 0.4.24を使用している)ためである可能性があります。 コードは、PoWチェーンのフォークまで常に正常に機能していました。

要するに、エクスプロイトの根本原因は、ETHWチェーン上のOmniブリッジが古いchainIdを使用しており、クロスチェーンメッセージの実際のchainIdを正しく検証していないことです。 さらに、同様の問題が他のプロトコルにも存在する可能性があります。

影響

直接的な影響は、攻撃者が大量のETHW(およびPoWチェーン上のブリッジが所有する他のトークン)を収穫し、一部のマーケットプレイス(例:一部のCEX)で取引できたことです。 これにより、流動性の増加によりETHWの価格に影響が出る可能性があります。 したがって、ユーザー/投資家はPoWチェーンでのこれらのトークンの取引に注意する必要があります。

結論

Solidity開発者は、コントラクト自体によって保守されるように設計されたchainIdを扱う際には、特別な注意を払う必要があります。

BlockSecについて

BlockSecは、世界的に著名なセキュリティ専門家グループによって2021年に設立された、先駆的なブロックチェーンセキュリティ企業です。同社は、新興のWeb3の世界のセキュリティとユーザビリティの向上にコミットしており、その大規模な採用を促進しています。この目的のために、BlockSecはスマートコントラクトおよびEVMチェーンのセキュリティ監査サービス、セキュリティ開発と脅威のプロアクティブなブロックのためのPhalconプラットフォーム、資金追跡と調査のためのMetaSleuthプラットフォーム、そしてWeb3ビルダーが暗号世界を効率的にサーフィンするためのMetaDock拡張機能を提供しています。

現在までに、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