Stack Overflow
A stack overflow vulnerability occurs when a program tries to store more data in the stack than it can handle.
- stack is a region of memory that holds temporary data created by a program during runtime
- a fixed-size buffer
How it Occurs
- when a function is called, it creates a stack frame that contains information such as local variables, return addresses, and other data
- if a program tries to store more data than the stack frame can hold,
- it can cause a buffer overflow
- overwriting adjacent memory and potentially causing the program to crash or execute malicious code
- attacker can exploit stack overflow to gain control of a system or steal data
Mitigation
- ensure programs allocate enough memory for the stack
- use safe programming practices
- use OS that utilize Address Space Layout Randomization (ASLR)