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.
-
Length or offset values taken from the file were trusted and used to write outside the allocated buffer.
Seen in 11 reports
-
Memory accessed after being freed, often requiring a race condition to exploit.
Seen in 11 reports
-
File parsers lack length checks before copying file-supplied data into fixed-size stack or heap buffers.
Seen in 11 reports
-
Office mishandles objects in memory while parsing crafted documents.
Seen in 11 reports
-
Several Apple use-after-free and double free reports come from memory being freed while still referenced or freed twice.
Seen in 11 reports
-
Stack-based buffer overflows occur from copying input into fixed-size stack buffers without length checks.
Seen in 11 reports
-
The parser did not validate the size, type or structure of data read from DXF, SAT or JT files before using it.
Seen in 11 reports
-
The parser does not validate user-supplied data before using it, causing memory corruption.
Seen in 11 reports
-
The parser or handler does not check that an object still exists before using it, leading to use-after-free.
Seen in 11 reports
-
The parser trusts size or offset fields from the file when computing where to read or write, so accesses land outside the buffer.
Seen in 11 reports
-
User-supplied form values are copied into fixed-size stack buffers with unbounded string copies.
Seen in 11 reports
-
A length or size field taken from the file is trusted and copied into a fixed-size stack or heap buffer without a bounds check.
Seen in 10 reports
-
A length taken from the file is copied into a fixed-size stack buffer without checking that it fits.
Seen in 10 reports
-
A type confusion where an object of one type is used as another.
Seen in 10 reports
-
An in-place optimisation made source and destination share memory, so a scratch write past the output boundary landed in spliced page cache pages.
Seen in 10 reports
-
Data or resources are used as the wrong type because the type is not validated.
Seen in 10 reports
-
Heap buffers are written past their end when parsing crafted files.
Seen in 10 reports
-
HTTP handlers copy multipart values, boundaries, headers or bodies into fixed stack buffers without length checks.
Seen in 10 reports
-
Length or size calculations done in fixed-width integers without overflow checks, so buffers are undersized.
Seen in 10 reports
-
Memory management errors, including use-after-free, in web content processing.
Seen in 10 reports
-
Packet length validation is missing: parsers copy a length field from the packet into a buffer without checking that the declared length fits the destination.
Seen in 10 reports
-
CAD and 3D file parsers repeatedly failed to check the length of user-supplied data before copying it into fixed-size buffers.
Seen in 10 reports
-
Pointers or memory are used before being initialised, or uninitialised values are freed as pointers.
Seen in 10 reports
-
Race conditions open a timing window for memory corruption.
Seen in 10 reports
-
The parser copied a length-controlled field into a fixed-size buffer without checking that the length fitted.
Seen in 10 reports
-
The scripting engine mishandles objects in memory, such as a use-after-free or type confusion.
Seen in 10 reports
-
User-controlled length copied into a fixed stack or heap buffer without a bounds check.
Seen in 10 reports
-
User-supplied length is not checked before copying into a fixed-length stack buffer.
Seen in 10 reports
-
A length or size sum overflowed before allocation, so a small buffer was allocated and then written past its end.
Seen in 9 reports
-
An annotation object is freed but later operated on without checking that it still exists.
Seen in 9 reports
-
An object is freed by garbage collection or window teardown while an asynchronous callback or event handler still holds a raw pointer to it.
Seen in 9 reports
-
Annotation, document and form objects are freed but later used without checking that they still exist.
Seen in 9 reports
-
Data or objects are treated as the wrong type, either through type confusion or by trusting a type field from input.
Seen in 9 reports
-
Handlers trusted the type of user-supplied data without validating it, causing type confusion in document commands and virtual device commands.
Seen in 9 reports
-
Integer overflow or wraparound when handling sizes or lengths, leading to memory corruption.
Seen in 9 reports
-
Objects are freed but later used without checking that they still exist, across screen saver windows, sync objects, PDF fields and browser engine objects.
Seen in 9 reports
-
Objects are freed but still referenced, giving use-after-free conditions.
Seen in 9 reports
-
Objects are freed during document processing but later dereferenced without checking they still exist.
Seen in 9 reports
-
Windows Installer frees objects while they are still referenced, with a race window making the use-after-free reachable.
Seen in 9 reports
-
Office and graphics components do not handle objects in memory correctly during document or image processing, leading to memory corruption.
Seen in 9 reports
-
Office fails to properly handle objects in memory when parsing crafted files.
Seen in 9 reports
-
3D model file parsers did not validate the size or structure of user-supplied data before writing it to memory.
Seen in 9 reports
-
CAD file import parsers read fields from files without validating their length or structure, causing reads past the end of allocated buffers.
Seen in 9 reports
-
Pointers supplied by callers or left uninitialised are dereferenced without validation.
Seen in 9 reports
-
Size or count values from the input are used in arithmetic for buffer allocation without validation, so the calculation wraps around.
Seen in 9 reports
-
The parser does not validate the size of user-supplied data before writing to a fixed-size buffer, causing an out-of-bounds write.
Seen in 9 reports
-
The parser used an object without checking it still existed.
Seen in 9 reports
-
Uniscribe mishandles objects in memory while processing crafted content.
Seen in 9 reports
-
User-supplied length is not checked before copying into a heap buffer.
Seen in 9 reports
-
A bounds check is missing or only present as a debug assertion, so release builds proceed past the end of a buffer or map.
Seen in 8 reports