Back to Blog

Kurze Analyse der wilden Ausbeutung von CVE-2021–39137

Code Auditing
August 28, 2021
3 min read

CVE-2021-39137 ist eine Schwachstelle, die vor wenigen Tagen gemeldet und behoben wurde. Jedoch haben noch nicht alle Ethereum-Nodes den Patch angewendet. Wir beobachten, dass diese Schwachstelle durch eine bösartige Transaktion ausgenutzt wurde.

Angriffstransaktion

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

Diese Transaktion enthält einen STATICCALL mit der Adresse 0x4. Dies ist ein vorkompilierter Smart Contract, dataCopy. Das Argument ist wie folgt.

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

Der 0x4 Smart Contract

Abbildung 1

Da das Ziel des STATICCALL der 0x4 vorkompilierte Vertrag ist, wird die Funktion RunPrecompiledContract in Abbildung 1 ausgeführt.

Abbildung 2

Abbildung 3

Gemäß Abbildung 2/3 gibt der 0x4 Smart Contract einfach die Referenz des in-Zeigers zurück.

Abbildung 4

Abbildung 5

Abbildung 4 zeigt den Code für den Opcode STATICCALL. In Zeile 751 zeigt args auf [inOffset ~ inOffset + inSize ] des EVM-Speichers, was Mem[0:32] ist.

Gemäß Abbildung 5 und der Analyse der Code-Logik von 0x04 (Abbildung 2/3) ist der Rückgabewert (ret) eine Referenz auf denselben Speicher wie args. Das bedeutet, er zeigt ebenfalls auf Mem[0:32].

Schwachstelle

Im verwundbaren Code (Version 1.10.7) kopiert Zeile 762 den Inhalt von ret nach Mem[retOffset : retOffset + retOffset], d.h. kopiert Mem[0:32] nach Mem [7:7+32]. Diese Operation verändert versehentlich den Inhalt von ret. Das bedeutet, der Rückgabewert des 0x4 vorkompilierten Vertrags wurde modifiziert.

In der behobenen Version (1.10.8) wird eine Kopie von ret erstellt (Zeile 766). Dies kann die Schwachstelle beheben, da die Kopie in Zeile 767 den Inhalt von ret nicht verändern kann.

Die Schwachstelle CVE-2021–39137 wurde aufgrund von Nodes, die ihre Patches nicht rechtzeitig aktualisierten, durch eine bösartige Transaktion ausgenutzt. Dieser Fehler betraf einen Defekt in den Speicheroperationen der Ethereum Virtual Machine, wurde aber in Version 1.10.8 behoben. Um die Systemsicherheit zu gewährleisten, wird allen Ethereum-Nodes dringend empfohlen, sofort auf die neueste Version zu aktualisieren.

Danksagungen

Der Angriff wird von Siwei Wu, Yufeng Hu, Lei Wu, Yajin Zhou@BlockSec analysiert.

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