Eine kurze Analyse der wilden Ausbeutung von CVE-2021-39137

Eine kurze Analyse der wilden Ausbeutung von CVE-2021-39137

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

Angriffstransaktion

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

Diese Transaktion hat einen STATICCALL mit der Adresse 0x4. Dies ist ein vorkompilierter Smart Contract dataCopy. Das Argument lautet wie folgt.

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

Der 0x4 Smart Contract

Abbildung 1

Da das Ziel des STATICCALL der vorkompilierte Vertrag 0x4 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, der Mem[0:32] ist.

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

Schwachstelle

Im anfälligen 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 ändert versehentlich den Inhalt von ret. Das bedeutet, dass der Rückgabewert des vorkompilierten Vertrags 0x4 modifiziert wurde.

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 ändern kann.

Die Schwachstelle CVE-2021–39137 wurde durch eine bösartige Transaktion ausgenutzt, da die Knoten ihre Patches nicht rechtzeitig aktualisiert haben. Dieser Fehler beinhaltete 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-Knoten 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 | 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.