Buffer Overflow


Format String Attacks

Key Takeaway

NEVER use printf directly with user input as the format string. ALWAYS sanitize user inputs to prevent format string attacks and other injection vulnerabilities.

Summary: Format String Attacks

Overview

Example of Vulnerable Code

Consequences of Vulnerable Code

Safe Usage

Example of Correct Usage with Conditional Format

Input Sanitization