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.
01Why memory safety dominates the vulnerability data
- 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.
| Category | Meaning | Classes |
|---|---|---|
| Spatial | Access outside an object's bounds | Stack and heap overflow (CWE-787), out-of-bounds read (CWE-125) |
| Temporal | Access to an object outside its lifetime | Use-after-free (CWE-416), double free (CWE-415) |
| Type | Memory interpreted as the wrong type | Type confusion (CWE-843) |
| Initialisation | Reading memory before it is written | Uninitialised use (CWE-457, CWE-908), often an info leak |
| Arithmetic feeding the above | Size calculations that wrap or truncate | Integer 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.