Lukas' Notes

security memory c

Definition

Memory Safety (Software)

A program is memory-safe if it cannot read or write memory outside the bounds of the objects it has legitimately allocated — no out-of-bounds access, no use after a deallocation, no access to uninitialised memory. A memory-safety issue is any bug that breaks this guarantee; the cluster of lectures around this note is the background needed to understand the attacks such bugs enable.

Why It Still Dominates

Obs

Memory-safety bugs have stayed the single largest class of software vulnerability for over a decade despite the maturity of mitigations. Two recent figures make the scale concrete:

  • roughly 50% of the vulnerabilities addressed through a security update each year continue to be memory-safety issues;
  • the Chromium project reports that around 70% of its serious security bugs are memory-safety problems.

The reason is structural rather than accidental: the systems software that the internet runs on is written in memory-unsafe languages — chiefly C and C++ — where a missing bounds check is the programmer’s responsibility and the language offers no runtime protection. buffer overflows and buffer over-reads such as Heartbleed are the concrete shapes these bugs take.