What is a buffer overflow?

Introduction

Buffer overflow happens when more data is written to a buffer, then it is allocated to hold. This extra data is translated to memory direction numbers, which is executed by a computer. A buffer overflow could crash the application, and also could be exploited by an attacker to execute any command they want.

Types of Buffer Overflow

  • Stack Overflow
  • Heap Overflow

Prevention Mechanisms

  • Use higher level programming languages that are strongly typed and disallow direct memory access
  • Canary (stack cookie) is a data pattern that is written to the stack just before EIP register (EIP contains the address of the next instruction)
  • Address Space Layout Randomization (ASLR)
  • Data Execution Protection
  • Stack Canary/Cookie
Advertisements