Export
The link always opens the latest version of this page.
Ask an AI about it
Open in ChatGPTA new chat that reads this entry from the site Open in ClaudeThe same, in ClaudeShare the link instead of a file, and they will always see the latest version.
Files are a snapshot of today. The live page has anything newer.
Stack Buffer Overflow
A stack buffer overflow occurs when a program writes more data to a buffer allocated on the stack than the buffer can hold, causing the excess data to overwrite adjacent memory. This is a class of memory safety vulnerability 1.
Consequences
Stack buffer overflows can lead to multiple severe outcomes:
Code Execution & Control Flow
The overflow can enable Remote Code Execution 2 or arbitrary code execution 3 by overwriting return addresses or function pointers on the stack, allowing an attacker to redirect program execution to malicious code. More broadly, the vulnerability permits hijacking program execution flow 4.
Memory & Availability
The overflow causes memory corruption 5, potentially destabilizing the process. Attackers may also trigger Denial of Service alongside arbitrary code execution.
Attack Mechanism
The core mechanism exploits the stack's linear memory layout. When a function allocates a local buffer without proper bounds checking, input longer than the buffer's size overwrites the return address or saved frame pointer stored above it on the stack. By crafting input with a specific payload, an attacker can replace the return address with a pointer to shellcode or a gadget chain, causing the CPU to execute attacker-controlled instructions when the function returns.
Stack buffer overflows are particularly dangerous because they are often exploitable without Address Space Layout Randomization (ASLR) or other mitigations, and they require no special privileges to trigger—only the ability to provide input to the vulnerable function.
In the news 5
- ZDI-26-499: WatchGuard FireWare OS cli Token Parser Stack-based Buffer Overflow Remote Code Execution Vulnerability · Zero Day Initiative
- ZDI-26-456: GIMP TIF File Parsing Stack-based Buffer Overflow Remote Code Execution Vulnerability · Zero Day Initiative
- This Week in Security: Another Record Patch Tuesday, LAME is More Secure, Secure Boot is Less Secure, and Milk Malware · Hackaday
- My Stack Simulator, (Wed, Jul 8th) · SANS Internet Storm Center
- thttpd v2.26 Stack-Based Buffer Overflow in thttpd htpasswd Utility Allows Local Memory Corruption · Full Disclosure
Sign in for the full story cards: summaries, tags and starring.