Format string attacks allow an attacker to read or write anywhere in the memory of a process. Previous solutions designed
to detect format string attacks either require source code and recompilation of the program, or aim to defend only against
write attempts to security critical control information. They do not protect against arbitrary memory read attempts and non-control
data attacks. This paper presents FormatShield, a comprehensive defense against format string attacks. FormatShield identifies
potentially vulnerable call sites in a running process and dumps the corresponding context information in the program binary.
Attacks are detected when malicious input is found at vulnerable call sites with an exploitable context. It does not require
source code or recompilation of the program and can defend against arbitrary memory read and write attempts, including non-control
data attacks. Also, our experiments show that FormatShield incurs minimal performance overheads and is better than existing
solutions.
Keywords Format String Attacks - Binary Rewriting - Intrusion Detection - System Security