Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Buffer Overflow Causes Author: Jedidiah.

Slides:



Advertisements
Similar presentations
CSc 352 Programming Hygiene Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
Advertisements

An Empirical Study of the Reliability in UNIX Utilities Barton Miller Lars Fredriksen Brysn So Presented by Liping Cai.
Buffer Overflow Intro. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Preventing Buffer Overflows (for C programmers)
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
Chapter 15 : Attacking Compiled Applications Alexis Kirat - International Student.
Gabe Kanzelmeyer CS 450 4/14/10.  What is buffer overflow?  How memory is processed and the stack  The threat  Stack overrun attack  Dangers  Prevention.
Teaching Buffer Overflow Ken Williams NC A&T State University.
Teaching Buffer Overflow Ken Williams NC A&T State University.
Software and Software Vulnerabilities. Synopsis Array overflows Stack overflows String problems Pointer clobbering. Dynamic memory management Integer.
Software Engineering Lifecycle. ©2002. Jan G. Hogle, Susan L. Gerhart. Software Engineering Lifecycle Authors: Jan G. Hogle,
Assembly תרגול 8 פונקציות והתקפת buffer.. Procedures (Functions) A procedure call involves passing both data and control from one part of the code to.
C Programmer Quiz. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Quiz: For C Programmers Author: Jedidiah.
CMSC 414 Computer and Network Security Lecture 20 Jonathan Katz.
1 - buttons Click “Step Forward” to execute one line of the program. Click “Reset” to start over. “Play,” “Stop,” and “Step Back” are disabled in this.
CS110/CS119 Introduction to Computing (Java)
An Introduction to Textual Programming
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Buffer Overflow Defenses. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Buffer Overflow Defenses Author:
An Introduction to Information Security Why there’s more to hide than you might think and why hiding it is a lot tougher than you ever dreamed of in your.
General Programming Introduction to Computing Science and Programming I.
Introduction to Buffer Overflows Author: Jedidiah R. Crandall, Distributed: 14 July 2002 Embry-Riddle Aeronautical University in Prescott,
Computer Security and Penetration Testing
BLENDED ATTACKS EXPLOITS, VULNERABILITIES AND BUFFER-OVERFLOW TECHNIQUES IN COMPUTER VIRUSES By: Eric Chien and Peter Szor Presented by: Jesus Morales.
Buffer Overflows Lesson 14. Example of poor programming/errors Buffer Overflows result of poor programming practice use of functions such as gets and.
OSI and TCP/IP Models And Some Vulnerabilities AfNOG th May 2011 – 10 th June 2011 Tanzania By Marcus K. G. Adomey.
Testing E001 Access to Computing: Programming. 2 Introduction This presentation is designed to show you the importance of testing, and how it is used.
Buffer Overflow Intro. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Introduction to Buffer Overflows Author:
Overview of Key Security Concepts and Vocabulary This Document was Funded by the National Science Foundation Federal Cyber Service Scholarship For Service.
Embry-Riddle Aeronautical University Prescott, Arizona
IT253: Computer Organization Lecture 3: Memory and Bit Operations Tonga Institute of Higher Education.
Buffer Overflow Causes Quiz. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Quiz: Buffer Overflow Causes Author:
Buffer Overflow Defenses. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Buffer Overflow Defenses Author:
Introduction to CS520/CS596_026 Lecture Two Gordon Tian Fall 2015.
Buffer Overflow Defenses Quiz. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Quiz: Buffer Overflow Defenses.
How to Use BO Demos. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. How to Use Buffer Overflow Demos (applets)
Decision Structures, String Comparison, Nested Structures
Buffer overflow and stack smashing attacks Principles of application software security.
S ECURE P ROGRAMMING 6. B UFFER O VERFLOW (S TRINGS AND I NTEGERS ) P ART 2 Chih Hung Wang Reference: 1. B. Chess and J. West, Secure Programming with.
Sairajiv Burugapalli. This chapter covers three main categories of classic software vulnerability: Buffer overflows Integer vulnerabilities Format string.
Intro to Buffer Overflow Quiz. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Quiz: Buffer Overflow Intro Author:
Introducing C++ to Java Programmers by Kip Irvine updated 2/27/2003.
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 9: Designing Exceptionally.
Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Chapter 7 Continued Arrays & Strings. Arrays of Structures Arrays can contain structures as well as simple data types. Let’s look at an example of this,
Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade Crispin Cowan SANS 2000.
Cases Study: Code Red. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Case Study: Code Red Author: Jedidiah.
Buffer Overflow Defenses
SE-1021 Software Engineering II
Protecting Memory What is there to protect in memory?
Buffer Overflow Defenses
Introduction to Information Security
Protecting Memory What is there to protect in memory?
Module 30 (Unix/Linux Security Issues II)
Protecting Memory What is there to protect in memory?
Other Kinds of Arrays Chapter 11
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Quiz: Buffer Overflow Causes
Software Security Lesson Introduction
Format String.
Case Study: Code Red Author: Jedidiah R. Crandall,
Buffer Overflow Defenses
Buffer Overflows.
Preventing Buffer Overflows (for C programmers)
Understanding and Preventing Buffer Overflow Attacks in Unix
Testing & Security Dr. X.
Presentation transcript:

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Buffer Overflow Causes Author: Jedidiah R. Crandall, This Document was Funded by the National Science Foundation Federal Cyber Service Scholarship For Service Program: Grant No Distributed July 2002 Embry-Riddle Aeronautical University Prescott, Arizona USA

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Causes of Buffer Overflows This section explains some of the causes of buffer overflows and types of buffer overflow attacks in a not-too-technical manner The intention is to give the reader an appreciation for the complexity of the problem

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Types of buffer overflow attacks Stack smashing or heap-based attacks The attacker can hijack execution of the program, and if the program was running with elevated privileges, the attacker now has those privileges This is the way many worms spread by tricking a network server into running the a program the attacker wrote Data corruption An attacker can change their privileges or other security-related data by overwriting it in memory Program crash A program crash can lead to denial-of-service because the service that program was providing will not be there until the program is restarted Sometimes a program crash causes a “core dump” where the entire memory of the program (possibly security-sensitive data) is written out to a file the attacker may be able to read

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. What can cause buffer overflows? Careless use of buffers without bounds checking. Formatting and logical errors. Unsafe library function calls. Off-by-one errors. Old code used for new purposes (like UNICODE international characters). All sorts of other far-fetched but deadly-serious things you should think about.

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Careless use of buffers without bounds checking This is the classical cause of a buffer overflow. It is a blatant programmer error analogous to trying to pour five gallons of water into a four gallon bucket. It can lead to the program being hijacked, data being corrupted, or the program crashing.

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Formatting and logical errors Sometimes its not the size of the input but the value of the input that causes a buffer to overflow. The input might be an integer that you want to convert to an ASCII string. The buffer needs to be big enough to hold all of the digits of the biggest integer someone could enter. Otherwise the program might be vulnerable to program crashes or data corruption.

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Unsafe library function calls A library is a collection of useful subroutines that a programmer can use in their program. The standard C library, which every C compiler has, has subroutines in it that can cause buffer overflows if not used properly. Programmers have to learn to use the library subroutines properly. Unsafe library function calls are responsible for many vulnerabilities of all types.

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Off-by-one errors In C, if you create a buffer that will hold 100 bytes then it will only hold 99 ASCII characters (other than the NULL character at the end), the 99 th character being indexed with the number 98. This can lead to a lot of confusion even for seasoned C programmers who do bounds checking. This can lead to a small amount of data corruption or even a program crash.

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Old code used for new purposes Programmers often reuse code that someone else wrote a long time ago. If you write a program and limit a user’s input to 100 characters and then put them into the old code’s 101-byte buffer you can still get a buffer overflow. How? When the old code was written the programmer assumed the use of ASCII where 1 character fills 1 byte. Your new code uses UNICODE (supports international character sets) where 1 character fills two bytes. This was the cause of Code Red.

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. All sorts of other far-fetched but deadly- serious things you should think about. User input is not always what causes buffer overflows, they may be caused through things like environment variables or race conditions. You don’t have to know all about environment variables or race conditions but if you’re managing a software project then your programmers should.

Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. About this Project This presentation is part of a larger package of materials on buffer overflow vulnerabilities, defenses, and software practices. For more information, go to: Also available are: Demonstrations of how buffer overflows occur (Java applets) PowerPoint lecture-style presentations on an introduction to buffer overflows, preventing buffer overflows (for C programmers), and a case study of Code Red Checklists and Points to Remember for C Programmers An interactive module and quiz set with alternative paths for journalists/analysts and IT managers as well as programmers and testers A scavenger hunt on implications of the buffer overflow vulnerability Please complete a feedback form at to tell us how you used this material and to offer suggestions for improvements.