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
~$4.72M Lost: TAC, Transit Finance & More | BlockSec Weekly
Security Insights

~$4.72M Lost: TAC, Transit Finance & More | BlockSec Weekly

This BlockSec weekly security report covers 3 notable attack incidents identified between May 11 and May 17, 2026, across TRON, TON, and Ethereum, with total estimated losses of approximately $4.72M. Three incidents are analyzed in detail: the highlighted $1.88M Transit Finance exploit on TRON, where a deprecated swap bridge contract with lingering token approvals was exploited through arbitrary calldata forwarding; the $2.8M TAC TON-to-EVM bridge exploit caused by missing canonical wallet verification in the jetton deposit flow; and the $46.75K Boost Hook exploit on Ethereum, where spot price manipulation on a Uniswap V4 hook-based perpetual protocol forced the protocol to buy tokens at inflated prices using its own reserves.

~$15.9M Lost: Trusted Volumes, Wasabi & More | BlockSec Weekly
Security Insights

~$15.9M Lost: Trusted Volumes, Wasabi & 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

Best Security Auditor for Web3

Validate design, code, and business logic before launch. Aligned with the highest industry security standards.

BlockSec Audit