Back to Blog

CVE-2021–39137 の悪用に関する短報

Code Auditing
August 28, 2021
2 min read

CVE-2021-39137 は、数日前に報告され修正された脆弱性です。しかし、すべてのEthereumノードがパッチを適用したわけではありません。この脆弱性が悪意のあるトランザクションによって悪用されていることを確認しました。

攻撃トランザクション

https://tx.blocksecteam.com/tx/0x1cb6fb36633d270edefc04d048145b4298e67b8aa82a9e5ec4aa1435dd770ce4

このトランザクションは、アドレス0x4に対するSTATICCALLを含んでいます。これはプリコンパイルされたスマートコントラクトdataCopyです。引数は以下の通りです。

inOffset = 0, inSize = 32, retOffset = 7, retSize = 32.

0x4 スマートコントラクト

図1

STATICCALLのターゲットが0x4プリコンパイル済みコントラクトであるため、図1のRunPrecompiledContract関数が実行されます。

図2

図3

図2/3によると、0x4スマートコントラクトは単にinポインタへの参照を返します。

図4

図5

図4はSTATICCALLオペコードのコードです。751行目では、argsはEVMメモリの[inOffset 〜 inOffset + inSize]、つまりMem[0:32]を指しています。

図5と0x04(図2/3)のコードロジックの分析によると、戻り値(ret)はargsと同じメモリへの参照です。つまり、Mem[0:32]を指します。

脆弱性

脆弱性のあるコード(バージョン1.10.7)では、762行目がretの内容をMem[retOffset : retOffset + retOffset]、つまりMem[0:32]をMem[7:7+32]にコピーします。**この操作により、誤ってretの内容が変更されます。**これは、0x4プリコンパイル済みコントラクトの戻り値が変更されたことを意味します。

修正されたバージョン(1.10.8)では、retのコピーを作成します(766行目)。767行目のコピーはretの内容を変更できないため、これにより脆弱性が修正されます。

CVE-2021–39137の脆弱性は、ノードがタイムリーにパッチを更新しなかったために、悪意のあるトランザクションによって悪用されました。この欠陥は、Ethereum仮想マシンのメモリ操作における不具合が原因でしたが、バージョン1.10.8で修正されています。システムのセキュリティを確保するため、すべてのEthereumノードは速やかに最新バージョンにアップデートすることを推奨します。

謝辞

攻撃の分析は、Siwei Wu、Yufeng Hu、Lei Wu、Yajin Zhou@BlockSec

Sign up for the latest updates
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.

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 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