In-depth lesson · Memory corruption
Root causes
Every point the Memory corruption reports back under this heading, best-backed first, each with the reports it is seen in.
-
Integer overflow, underflow or truncation in size calculations leads to undersized allocations.
Seen in 4 reports
-
Internet Explorer improperly accesses objects in memory, including through the Windows Text Services Framework.
Seen in 4 reports
-
Kernel-mode drivers do not correctly manage memory objects, leading to memory corruption.
Seen in 4 reports
-
Length and offset fields in the font file were trusted without checking them against the buffer size.
Seen in 4 reports
-
Memory is accessed after being freed without being cleared or revalidated.
Seen in 4 reports
-
Memory is used before it has been properly initialised.
Seen in 4 reports
-
Memory or a resource is used before it has been initialised, and the attacker can shape that state.
Seen in 4 reports
-
Office input parsing lacks bounds checks, causing reads past the end of a buffer.
Seen in 4 reports
-
A missing or incorrect length check when reading a buffer causes an over-read.
Seen in 4 reports
-
User-supplied data is not validated before arithmetic, causing integer overflow or underflow before a memory write.
Seen in 4 reports
-
Objects are freed while another structure still holds a reference, so the dangling pointer is later used.
Seen in 4 reports
-
Objects are handled as the wrong type, leading to memory corruption.
Seen in 4 reports
-
PDF index files trust offsets and lengths from the file without checking them against the buffer, and a pointer is used before initialisation.
Seen in 4 reports
-
Parsers copy user-supplied data into fixed-size buffers without checking its length.
Seen in 4 reports
-
File format parsers read from a fixed offset or fixed count without first checking that the buffer is large enough.
Seen in 4 reports
-
File parser bounds are missing: parsers trusted size or length values in the file without checking them against the destination buffer.
Seen in 4 reports
-
File format parsers used user-supplied values as pointers or indices without validation.
Seen in 4 reports
-
PHP extension parsers read fixed numbers of bytes or advance pointers without checking the remaining buffer length.
Seen in 4 reports
-
Pointers supplied by an attacker or a remote peer are dereferenced without validation.
Seen in 4 reports
-
PostScript command handlers trust lengths, indices or stack state from the file without bounds checks.
Seen in 4 reports
-
Protocol and media parsers copy user-supplied data into fixed stack buffers without validating length.
Seen in 4 reports
-
Protocol handlers copy user-supplied fields such as keys, encoded data or arrays into fixed buffers without length checks.
Seen in 4 reports
-
Raw pointers are kept to objects the cycle collector or teardown code can free, so later callbacks dereference freed memory.
Seen in 4 reports
-
Reference counts or object lifetimes are mishandled across threads, leading to use-after-free.
Seen in 4 reports
-
The same memory is freed twice.
Seen in 4 reports
-
Shader register functions use user-supplied data to calculate a write location without validating length or bounds.
Seen in 4 reports
-
Signed values and size fields are used in arithmetic or memory moves without checking for negative or overflowing results.
Seen in 4 reports
-
Size calculations multiply or subtract file-supplied values without overflow checks, producing undersized buffers.
Seen in 4 reports
-
Size or length values in the file are trusted without checking against the allocated buffer.
Seen in 4 reports
-
Size values from the file are multiplied or added without overflow checks before buffer allocation.
Seen in 4 reports
-
State checks or size assertions exist only in debug builds and are removed in release builds.
Seen in 4 reports
-
The DDNS client copies the IP address from the HTTP response into a fixed-size buffer without checking the length.
Seen in 4 reports
-
The decoder assumes a percent sign is always followed by two characters and reads past the terminator.
Seen in 4 reports
-
The driver dereferences a user-controlled value as a pointer without checking it points to valid kernel memory.
Seen in 4 reports
-
The driver trusted a caller-supplied length and copied that many bytes into a fixed-size heap allocation without checking it.
Seen in 4 reports
-
The engine assumes an object's type after certain operations, leading to type confusion.
Seen in 4 reports
-
The engine does not correctly check the type of array elements during processing, so an object is treated as a different type.
Seen in 4 reports
-
The font library does not validate embedded font data before using it, leading to memory corruption.
Seen in 4 reports
-
The graphics driver does not validate destination register indices or operands in shader instructions before writing to memory.
Seen in 4 reports
-
The graphics driver does not validate shader opcode operands, so an attacker-controlled value is used as a destination address or loop count.
Seen in 4 reports
-
The JIT compiler made unsound assumptions about object types and side effects.
Seen in 4 reports
-
The memory write methods do not validate the size or content of user data before using it in memory operations.
Seen in 4 reports
-
The parser does not validate that an object exists before performing operations on it.
Seen in 4 reports
-
The parser does not validate the type of user-supplied data before using it.
Seen in 4 reports
-
The parser does not validate the type of user-supplied data before using it, causing type confusion.
Seen in 4 reports
-
The parser trusts size or length values from the file without checking them against the allocated buffer size.
Seen in 4 reports
-
The reader did not check that an annotation object still existed before operating on it.
Seen in 4 reports
-
The reader did not validate that an annotation or signature object still existed before performing operations on it.
Seen in 4 reports
-
The reader does not validate that a Doc object exists before performing operations on it.
Seen in 4 reports
-
The same memory is freed more than once, or an invalid pointer is released.
Seen in 4 reports