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

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly
Security Insights

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly

This BlockSec weekly security report covers eight attack incidents detected between April 20 and April 26, 2026, across Ethereum, Avalanche, Sui, Base, HyperLiquid, and MegaETH, with total estimated losses of approximately $7.04M. The highlighted incident is the $1.3M GiddyDefi exploit, where the attacker did not break any cryptography or use a flash loan but simply replayed an existing on-chain EIP-712 signature with the unsigned `aggregator` and `fromToken` fields swapped out for a malicious contract, demonstrating how partial signature coverage turns any historical signature into a generic permit. Other incidents include a $3.5M Volo Vault operator key compromise on Sui, a $1.5M Purrlend privileged-role takeover, a $413K SingularityFinance oracle misconfiguration, a $142.7K Scallop cross-pool index injection, a $72.35K Kipseli Router decimal mismatch, a $50.7K REVLoans (Juicebox) accounting pollution, and a $64K Custom Rebalancer arbitrary-call exploit.

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.

Best Security Auditor for Web3

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

BlockSec Audit