Home.
ExploitationCritical

Buffer Overflow

Buffer overflows exploit unsafe memory handling in native code. Modern mitigations raise attacker cost but secure coding and memory-safe languages remain essential.

How Attackers Use It

Attack Summary

Writing more data into a buffer than it can hold overwrites adjacent memory — including the saved return address. Classic technique for redirecting execution to attacker-controlled shellcode.

  • Attacker finds an input path with inadequate bounds checking.
  • Crafted payload overwrites stack or heap structures.
  • Control flow is redirected to shellcode or ROP chains.
  • Privilege abuse and persistence follow successful code execution.

Defensive Strategy

Defense Summary

Stack canaries (GCC -fstack-protector). ASLR (address space layout randomisation). NX/DEP (non-executable stack). Use of memory-safe languages (Rust, Go) where possible.

  • Adopt memory-safe languages for new security-critical components.
  • Enable compiler/runtime protections such as ASLR, DEP, and stack canaries.
  • Use fuzz testing and sanitizers in CI for native modules.
  • Perform secure code review focused on memory operations.

Detection Signals

  • Crashes with segmentation faults under malformed input.
  • Exploit-like payload patterns in application logs.
  • Unexpected process behavior after memory allocation anomalies.

Keywords

Buffer OverflowBuffer Overflow DetectionBuffer Overflow PreventionCritical SeverityExploitation SecurityAttack and DefenseThreat DetectionSecurity Hardening

External References

Authoritative references for deeper learning and validation.

Related Techniques

Explore additional techniques with similar risk level.