Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosGoogle Cloud Tech: Gemini is coming to your city(24.09.2026 um 15:00 Uhr)
AI & KI NachrichtenGoogle’s latest moonshot to put machine learning in space(24.09.2026 um 15:12 Uhr)
Windows Tipps & SecurityPoll: What's your favorite Surface of 2026?(24.09.2026 um 14:58 Uhr)
Sichere ProgrammierungStreaming Materialized Views for Live Read Models (2026)(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA Day Is Not 86400 Seconds: The DST Bug in Your Date Math(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungSetting up Traefik: reverse proxy with automatic HTTPS(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA 200 OK response does not prove a secret leak(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungHow hot do you like it?(24.09.2026 um 15:05 Uhr)
YouTube Security VideosGoogle Cloud Tech: Gemini is coming to your city(24.09.2026 um 15:00 Uhr)
AI & KI NachrichtenGoogle’s latest moonshot to put machine learning in space(24.09.2026 um 15:12 Uhr)
Windows Tipps & SecurityPoll: What's your favorite Surface of 2026?(24.09.2026 um 14:58 Uhr)
Sichere ProgrammierungStreaming Materialized Views for Live Read Models (2026)(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA Day Is Not 86400 Seconds: The DST Bug in Your Date Math(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungSetting up Traefik: reverse proxy with automatic HTTPS(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA 200 OK response does not prove a secret leak(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungHow hot do you like it?(24.09.2026 um 15:05 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

The Night I Almost Lost Everything: A Guide to Stopping Reentrancy Attacks

If you are a web developer, a bug means a 500 error page. If you are a smart contract developer, a bug means the money is gone. Forever. ​The scariest bug in the book is the Reentrancy Attack. It’s the vulnerability that destroyed The DAO i…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

If you are a web developer, a bug means a 500 error page.

If you are a smart contract developer, a bug means the money is gone. Forever.

​The scariest bug in the book is the Reentrancy Attack. It’s the vulnerability that destroyed The DAO in 2016 and keeps draining protocols in 2026.

​I remember auditing a contract I wrote for a client. I looked at the "Withdraw" function, and my stomach dropped. I had left the door wide open.

​Here is exactly how Reentrancy works, and the three patterns I use to lock my contracts down.

​The "Infinite ATM" Glitch

​Imagine you go to an ATM.

​You insert your card and ask for $100.

​The ATM gives you $100.

​Then the ATM checks your balance and subtracts $100.

​Now, imagine if you were fast enough to ask for another $100 before the ATM could subtract the first one. You could drain the machine.

​That is Reentrancy. A malicious contract calls your function, and before your function finishes updating the balance, the attacker calls it again. And again. Until the funds are zero.

​Defense 1: The "Checks-Effects-Interactions" Pattern

​This is the Golden Rule of Solidity. You must memorize this.

​Most juniors write code like this (Vulnerable):

​Check: Does user have funds?

​Interact: Send money to user.

​Effect: Subtract funds from balance.

​The Fix: Switch the order.

​Check: Does user have funds?

​Effect: Subtract funds from balance FIRST.

​Interact: Send money to user.

​By updating the balance before sending the money, even if they try to re-enter, their balance is already zero. The attack fails.

​Defense 2: The Mutex (ReentrancyGuard)

​Sometimes, logic gets complex, and reordering lines isn't enough. That’s when I use a Mutex (Mutual Exclusion).

​I use OpenZeppelin’s ReentrancyGuard. It works like a lock on a bathroom door.

​When a function starts, the nonReentrant modifier locks the door.

​If anyone tries to call the function again while the door is locked, the transaction reverts.

​When the function finishes, it unlocks the door.

​It costs a little extra gas, but it’s cheaper than losing $1 million.

​Defense 3: Pull vs. Push

​Stop sending ETH to users automatically.

Instead of pushing funds to them (which triggers code execution), let them pull the funds themselves.

​Create a pending balance for them and force them to call a separate withdraw() function. This isolates the dangerous external call into its own specific transaction, making it much harder to exploit reentrancy loops in your main logic.

​The Takeaway

​Smart contract security isn't about being a genius mathematician. It’s about paranoia.

​Whenever you write a line of code that sends tokens or ETH, stop. Stare at it. Ask yourself: "What happens if the person receiving this money is malicious?"

​If you don't have an answer, don't deploy.

​Hi, I'm Frank Oge. I build high-performance software and write about the tech that powers it. If you enjoyed this, check out more of my work at frankoge.com

SOC Incident Playbook: Remote Code Execution (RCE) Defense
title: Detect Exploitation - The Night I Almost Lost Everything: A Guide to Stopping Reentrancy Attacks
id: 7b191a47-c685-4e08-b23b-d63fc12980be
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "The Night I Almost Lost Everyt" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich The Night I Almost Lost Everything: A Gu.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten The Night I Almost Lost Everything: A Guide to Stopping Reentrancy Attacks

Thematisch verwandte Begriffe: Night, Almost, Lost, Everything · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97179 | A security vulnerability has been detected in O2OA up to 9.5.3/10.0.2. T…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick