Introduction to format string vulnerabilities
3-Second Blueprint (English)
- Because C's variadic printf trusts its format string for argument count, user-controlled specifiers like %p walk up the stack leaking memory.
- Dynamically linked binaries resolve external libc calls at runtime through modifiable function pointers stored in the Global Offset Table (GOT).
- Attackers combine width padding with %hn half-word write specifiers to overwrite a GOT entry like strdup with system's address for shell access.
Format String Bug (printf)x86 Stack Frame LayoutPLT & GOT Pointers%hn Arbitrary Memory Write
3-Sekunden-Fazit (Deutsch)
- Da die variadische C-Funktion printf dem Formatstring blind vertraut, lesen eingeschleuste %p-Spezifizierer fremde Speicherwerte vom Stack aus.
- Dynamisch gelinkte Programme rufen externe libc-Funktionen über zur Laufzeit beschreibbare Funktionszeiger in der Global Offset Table (GOT) auf.
- Durch Breiten-Padding und %hn-Halbwort-Schreibbefehle lässt sich ein GOT-Zeiger wie strdup auf system umbiegen, um Codeausführung zu erlangen.
Format-String-Schwachstellex86-Stack-SpeicherlayoutPLT- & GOT-ZeigerSpeicherzugriff via %hn
Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.