Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Format String Vulnerabilities: Explanation, Impact, and Prevention, Slides of Software Engineering

An overview of format string vulnerabilities, their impact on security, and methods for exploiting and preventing them. It covers the concept of string formatting, common causes of format string problems, and their effects on access control, confidentiality, and integrity. Examples of incorrect and correct usage are also provided, along with detection and mitigation strategies.

Typology: Slides

2012/2013

Uploaded on 04/26/2013

sharad_984
sharad_984 🇮🇳

4.5

(13)

146 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Format String pROBLEMS
Docsity.com
pf3
pf4
pf5
pf8

Partial preview of the text

Download Format String Vulnerabilities: Explanation, Impact, and Prevention and more Slides Software Engineering in PDF only on Docsity!

Format String pROBLEMS

Overview

  • String Formatting Explained
  • Exploiting string format errors
  • Examples
  • Spotting and correcting the problem

How it affects security

Access Control: Redirect execution to malicious code

Confidentiality: Can expose information about a program that can lead to further exploitation

Integrity: Values can be overwritten in memory

Exploiting string format problems

#include <stdio.h>

int main(int argc, char* argv[]) { If(argc > 1) printf(argv[1]); return 0; }

Sample input: “%x %x” Sample output: 12ffc0 4011e

Source: (Howard, LeBlanc, and Viega 19)

Detecting and spotting the problems

 Luckily the problem is easy to detect and mitigate

 Lexical source code scanners can detect the errors and Crispin Cowan offers FormatGuard a built in compilation tool

 Right: printf(“%s,” user_input); printf(“%d,” user_input);  Wrong: printf(user_input); syslog(LOG_FILE, userText);

Summary

  • Do use fixed format strings
  • Do NOT pass user intput directly as the format

string functions.

  • Do avoid using printf(), scanf() family of

functions if you can.