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.
-
Memory accessed after being freed, often only reachable by winning a race condition.
Seen in 24 reports
-
Image and document parsing has missing or insufficient bounds checks before reading or writing user-controlled data.
Seen in 24 reports
-
File parsers copy or read file-supplied lengths and sizes without checking them against the destination buffer.
Seen in 24 reports
-
The software does not check that an object still exists before using it, leading to a use-after-free.
Seen in 24 reports
-
User-supplied values are used as indexes or lengths without bounds checks, causing out-of-bounds writes.
Seen in 24 reports
-
Helper executables copied user-supplied data into fixed-length stack buffers without validating length, often via scanf or sprintf.
Seen in 23 reports
-
File format parsers trusted length or size fields from the file without checking them against the destination buffer.
Seen in 23 reports
-
Input is copied into a heap buffer without checking its length against the allocation.
Seen in 22 reports
-
Missing or incorrect size checks before copying data into fixed-size heap or stack buffers.
Seen in 22 reports
-
Objects are used after being freed because cleanup does not remove outstanding references.
Seen in 22 reports
-
Objects are used after being freed, including when a synchronous callback destroys them mid-call.
Seen in 22 reports
-
PDF editor file parsers do not validate the size, length or structure of user-supplied data before reading or copying it.
Seen in 22 reports
-
Parsers read or wrote past buffers because bounds were not checked against actual sizes.
Seen in 22 reports
-
Missing bounds checks cause reads past the end of an allocated buffer.
Seen in 21 reports
-
File format parsers repeatedly failed to check that an object still existed before using it, causing use-after-free.
Seen in 21 reports
-
Reads and writes go past the end or start of allocated buffers because bounds are not checked.
Seen in 21 reports
-
User-supplied length fields are trusted and copied into fixed-size stack or heap buffers.
Seen in 21 reports
-
A pointer is used before it is initialised.
Seen in 20 reports
-
A pointer or index derived from file data is used to read or write without confirming it stays inside the allocated buffer.
Seen in 20 reports
-
An object was freed and then used again, or a reference was leaked until the object was freed while still referenced.
Seen in 20 reports
-
Browser engines mishandle objects in memory, giving use-after-free, type confusion or out-of-bounds access.
Seen in 20 reports
-
Size calculations for allocations overflow because counts or sizes from the user are not validated.
Seen in 20 reports
-
The scripting engine mishandles objects in memory, such as through use-after-free or type confusion.
Seen in 20 reports
-
Use-after-free where memory is accessed after being freed.
Seen in 20 reports
-
Data was copied into fixed-size stack or heap buffers without checking the length first.
Seen in 19 reports
-
Length fields read from the file were trusted and copied into fixed-size stack buffers without checking them against the buffer size.
Seen in 19 reports
-
Objects are freed while still referenced, or freed twice, during parsing or teardown.
Seen in 19 reports
-
Objects are used after being freed because existence was not checked before use.
Seen in 19 reports
-
Size calculations multiplied user-controlled counts by structure sizes in 32-bit arithmetic without overflow checks, so undersized buffers were allocated and then overfilled.
Seen in 19 reports
-
The parser copies user-supplied data into a fixed-length buffer without checking its length first.
Seen in 19 reports
-
User-supplied length is copied into a fixed-size buffer without checking that it fits.
Seen in 19 reports
-
Data written past the end of an allocated heap buffer.
Seen in 18 reports
-
File parsers lack bounds checks before writing parsed file data into a buffer.
Seen in 18 reports
-
Missing or incorrect length checks before copying data into heap or stack buffers.
Seen in 18 reports
-
Objects are freed and then used again without checking that they still exist.
Seen in 18 reports
-
Office memory management frees objects but still references them, giving use-after-free.
Seen in 18 reports
-
An out-of-bounds read occurs from a missing bounds check when parsing or reading data.
Seen in 18 reports
-
CAD file parsers read or write past the end of allocated buffers because bounds checks on file data are missing.
Seen in 18 reports
-
File format parsers trust size, length or offset fields from the file without checking them against the allocated buffer.
Seen in 18 reports
-
The DPAX, ALM, CMT and TBK parsers copy user-supplied data into fixed-size stack buffers without checking the length first.
Seen in 18 reports
-
User-supplied data is copied into fixed-size buffers without a length check.
Seen in 18 reports
-
Buffers written or read without checking input length, causing heap overflows, stack overflows and over-reads.
Seen in 17 reports
-
Input length is not checked before copying into a fixed-size heap or stack buffer.
Seen in 17 reports
-
Objects are freed but still referenced, often with a race condition making the timing exploitable.
Seen in 17 reports
-
File format parsers copy user-supplied data into fixed-size buffers without validating its length.
Seen in 17 reports
-
The engine lets a document close while script execution continues, so saved references to freed objects are later dereferenced.
Seen in 17 reports
-
The parser does not validate the size or structure of user-supplied data before reading or writing it.
Seen in 17 reports
-
A synchronous callback can destroy the object whose method is still executing, and the code continues using the dangling pointer.
Seen in 16 reports
-
A user-supplied array index is used to access memory without validation.
Seen in 16 reports
-
Count, offset and size fields from the file were trusted without checking them against the record size.
Seen in 16 reports