Heap Overflow

Heap Overflow

A heap overflow happens when a program writes more data into a heap allocation than the allocation can hold. In CTF binaries, this often corrupts nearby application data such as pointers, sizes, flags, or function references.

Common Checks

  • Identify heap allocations and their sizes.
  • Track which user inputs are copied into heap buffers.
  • Look for unsafe copy functions such as strcpy, strcat, gets, or unchecked read.
  • Check whether adjacent objects contain pointers that can become useful write targets.