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 fields from files were trusted and copied into fixed-size buffers without bounds checks.
Seen in 16 reports
-
Parsing embedded font data lacks a bounds check, so a write goes past the end of an allocated buffer.
Seen in 16 reports
-
Missing bounds checks on lengths and indices read from files or network data, and missing checks that objects still exist before use, recur across this batch.
Seen in 16 reports
-
Missing or insufficient bounds checks when reading parsed data lead to out-of-bounds reads.
Seen in 16 reports
-
The software does not verify that an annotation object still exists before operating on it, leading to a use-after-free.
Seen in 16 reports
-
Unchecked arithmetic on user-supplied sizes wraps or truncates before buffer allocation or copying.
Seen in 16 reports
-
Heap-based buffer overflows from missing or incorrect bounds checks before writing to a heap buffer.
Seen in 15 reports
-
Missing bounds checks when reading data let code read past the end of a buffer and disclose memory.
Seen in 15 reports
-
Document parsers trust size, length or count fields from the file without checking them against the buffer they drive.
Seen in 15 reports
-
The parsers fail to validate the length, size, or type of user-supplied data before copying it into buffers or using it in memory operations.
Seen in 15 reports
-
The parsers trust size or structure fields in image files without validating them against buffer lengths, leading to memory corruption.
Seen in 15 reports
-
The STEP, STP, X_B, SLDASM, SLDPRT, SLDDRW and X_T parsers do not validate the size or structure of user-supplied data before using it.
Seen in 15 reports
-
User-controlled parameters are copied into fixed-size stack buffers with sprintf or strcat and no length check.
Seen in 15 reports
-
User-supplied length is not checked before copying data into a fixed-size heap or stack buffer.
Seen in 15 reports
-
A user-supplied string is copied into a fixed-size stack buffer without proper validation.
Seen in 14 reports
-
Input copied into a fixed or heap buffer without checking its length first.
Seen in 14 reports
-
Input is not bounds-checked before being written to a heap buffer, giving heap overflows.
Seen in 14 reports
-
Objects are used after being freed because the code does not check that they still exist before operating on them.
Seen in 14 reports
-
Objects are used after being freed because their existence is not checked before operations.
Seen in 14 reports
-
File format parsers copy user data into fixed-size buffers without checking length, causing stack or heap overflows.
Seen in 14 reports
-
File parser validation is missing: parsers trusted size, offset or count fields in the file without checking them against the real buffer length.
Seen in 14 reports
-
CAD file import parsers use user-supplied data without validating its type or structure, causing memory corruption or type confusion.
Seen in 14 reports
-
User-supplied length fields are copied into fixed-size buffers without checking the length first.
Seen in 14 reports
-
User-supplied lengths are not validated before copying data into fixed-size stack or heap buffers.
Seen in 14 reports
-
A length or size value taken from the file is trusted and copied into a fixed-size buffer without checking it against the destination size.
Seen in 13 reports
-
A missing bounds check lets code read past the end of a buffer, leaking heap memory.
Seen in 13 reports
-
Lengths, offsets and counts read from files are trusted without being checked against buffer sizes.
Seen in 13 reports
-
Reading a buffer without a bounds check exposes heap or stack memory.
Seen in 13 reports
-
CAD file import parsers copy or write user-supplied data into fixed-size buffers without checking its length or size first.
Seen in 13 reports
-
The parser copies a length taken from the file into a fixed-size stack or heap buffer without checking it against the buffer size.
Seen in 13 reports
-
User-supplied data was copied into a fixed-size stack or heap buffer without checking its length first.
Seen in 13 reports
-
XML-supplied values are copied into fixed-length stack buffers without checking their length.
Seen in 13 reports
-
A memory management error in the runtime allowed a crafted application to corrupt or misuse objects and gain elevated privileges.
Seen in 12 reports
-
An object was used after being freed because its existence was not checked before the operation.
Seen in 12 reports
-
File and message parsers copy or read data using length or size values from the input without checking them against the destination buffer.
Seen in 12 reports
-
File-supplied data was copied into a fixed stack buffer without a length check.
Seen in 12 reports
-
Integer overflow, underflow or wraparound in size or count calculations is not rejected before memory is allocated or indexed.
Seen in 12 reports
-
Objects are used or freed without checking that they still exist, giving use-after-free or double free.
Seen in 12 reports
-
Objects are freed and then used again without checking they still exist.
Seen in 12 reports
-
Out-of-bounds reads occur from missing bounds checks when parsing input.
Seen in 12 reports
-
CAD and 3D file parsers repeatedly used objects after freeing them because they did not check that the object still existed.
Seen in 12 reports
-
The kernel-mode driver mishandled objects in memory, leading to memory corruption exploitable for privilege escalation.
Seen in 12 reports
-
The service mishandled objects in memory, allowing a crafted application to corrupt or misuse memory and gain elevated code execution.
Seen in 12 reports
-
User-supplied bitmap and drawing data is used without checking its type, structure or bounds before the driver operates on it.
Seen in 12 reports
-
User-supplied length or size values trusted without checking they fit the destination buffer.
Seen in 12 reports
-
User-supplied lengths are copied into fixed-size stack or heap buffers without a bounds check.
Seen in 12 reports
-
A recurring mistake is using an object after it has been freed because its existence is not checked before use.
Seen in 11 reports
-
Improper handling of objects in memory when parsing crafted files.
Seen in 11 reports
-
Kernel-mode drivers mishandle objects in memory, allowing corruption that can be turned into kernel-level code execution.
Seen in 11 reports
-
Kernel-mode drivers mishandle objects in memory, such as using a pointer after it is freed or failing to validate an object.
Seen in 11 reports