thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Application & OT Security · Advanced

Heap-Based Buffer Overflow

Writing beyond the bounds of memory allocated on the heap, corrupting adjacent data or allocator metadata.

Definition

Heap overflows can corrupt function pointers, objects or allocator structures and lead to code execution. Mitigations include bounds checking, hardened allocators, ASLR, DEP and memory-safe languages. Tracked as CWE-122.

Example

An image parser allocates a heap buffer based on a header value and then copies more pixel data than allocated.

Exam tip

Stack canaries do not protect heap overflows.

Related terms