CVE-2021-39137の悪用に関する簡単な分析

CVE-2021-39137の悪用に関する簡単な分析

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

攻撃トランザクション

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

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

inOffset = 0, inSize = 32, retOffset = 7 and 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 Virtual Machineのメモリ操作における欠陥を含んでいましたが、バージョン1.10.8で修正されました。システムのセキュリティを確保するため、すべてのEthereumノードは直ちに最新バージョンに更新することを推奨します。

謝辞

攻撃はSiwei Wu, Yufeng Hu, Lei Wu, Yajin Zhou@BlockSecによって分析されました。

Sign up for the latest updates
Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

During the week of February 9 to February 15, 2026, three blockchain security incidents were reported with total losses of ~$657K. All incidents occurred on the BNB Smart Chain and involved flawed business logic in DeFi token contracts. The primary causes included an unchecked balance withdrawal from an intermediary contract that allowed donation-based inflation of a liquidity addition targeted by a sandwich attack, a post-swap deflationary clawback that returned sold tokens to the caller while draining pool reserves to create a repeatable price-manipulation primitive, and a token transfer override that burned tokens directly from a Uniswap V2 pair's balance and force-synced reserves within the same transaction to artificially inflate the token price.

Top 10 "Awesome" Security Incidents in 2025

Top 10 "Awesome" Security Incidents in 2025

To help the community learn from what happened, BlockSec selected ten incidents that stood out most this year. These cases were chosen not only for the scale of loss, but also for the distinct techniques involved, the unexpected twists in execution, and the new or underexplored attack surfaces they revealed.

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

On August 29, 2025, Panoptic disclosed a Cantina bounty finding and confirmed that, with support from Cantina and Seal911, it executed a rescue operation on August 25 to secure roughly $400K in funds. The issue stemmed from a flaw in Panoptic’s position fingerprint calculation algorithm, which could have enabled incorrect position identification and downstream fund risk.