Memory-safety bug classes

Spatial and temporal memory errors in C and C++: overflows, out-of-bounds reads, use-after-free, double free, integer bugs, type confusion and uninitialised memory, and how attackers turn a bug into read, write and control-flow primitives.

🔒 PROBy ·Lesson·10 min read·Advanced → Staff
memory safetybuffer overflowuse-after-freetype confusioninteger overflowexploit primitives

01Why memory safety dominates the vulnerability data

✓What you will learn
  • Separate spatial from temporal memory-safety errors and name the main classes
  • Explain how a bug becomes an exploit primitive: info leak, arbitrary read or write, control-flow hijack
  • Recognise each class in code review and in sanitizer output
  • Use the industry data to argue for mitigations and memory-safe languages

C and C++ let code read and write memory through raw pointers with no runtime check that the pointer is in bounds or that the object it points to still exists. Get either wrong and the program silently touches memory it does not own. That is not just a crash: an attacker who controls what gets read or written can often control the program.

The numbers are consistent across vendors. Microsoft reported in 2019 that around 70 percent of the CVEs it assigns each year are memory-safety issues. The Chromium project found about 70 percent of its high and critical severity security bugs were memory-safety bugs. Google reported that memory-safety issues fell from 76 percent of Android vulnerabilities in 2019 to 24 percent in 2024 as new code moved to memory-safe languages. The bug class, not developer carelessness, is the problem.

CategoryMeaningClasses
SpatialAccess outside an object's boundsStack and heap overflow (CWE-787), out-of-bounds read (CWE-125)
TemporalAccess to an object outside its lifetimeUse-after-free (CWE-416), double free (CWE-415)
TypeMemory interpreted as the wrong typeType confusion (CWE-843)
InitialisationReading memory before it is writtenUninitialised use (CWE-457, CWE-908), often an info leak
Arithmetic feeding the aboveSize calculations that wrap or truncateInteger overflow (CWE-190) leading to a small allocation and a big copy

This is an advanced module

Vulnerability research & exploit mitigations is part of the Pro pass. 4 more sections — the deep dives, the final design, follow-ups and the test — unlock with it.

Already a cyart.io or studio.cyart.io member? Your pass code is in your Studio account.