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.
-
Image parsers did not validate the size or content of user-supplied data before writing to memory.
Seen in 3 reports
-
Input copied into heap buffers without a proper bounds check.
Seen in 3 reports
-
Insufficient bounds checking when the graphics compilation service processed crafted graphics data.
Seen in 3 reports
-
Integer conversion errors (signed conversion, sign extension, multiplication overflow) in record length handling lead to undersized allocations and out-of-bounds writes.
Seen in 3 reports
-
Integer overflow or wraparound not handled safely.
Seen in 3 reports
-
Integer overflow, wraparound or underflow is not checked before the value is used.
Seen in 3 reports
-
Integer underflow or overflow when handling crafted input.
Seen in 3 reports
-
Integer wraparound when parsing HID device data.
Seen in 3 reports
-
JSON string values were copied into fixed-size global or stack buffers with string copy routines and no length validation.
Seen in 3 reports
-
Kernel-mode driver fails to properly handle objects in memory.
Seen in 3 reports
-
Length and size values taken from the PDF file were used without bounds checks, allowing writes past allocated buffers.
Seen in 3 reports
-
Length checks use addition or subtraction that can overflow or underflow, letting an oversized value pass the check.
Seen in 3 reports
-
Media decoders mapped or copied data without checking sizes and run counts, allowing out-of-bounds heap access.
Seen in 3 reports
-
Memory freed but still referenced during packet handling.
Seen in 3 reports
-
Memory is freed and then used again while processing a crafted document.
Seen in 3 reports
-
Image parsing has missing or incorrect bounds checks before writing to a memory buffer, and an integer underflow.
Seen in 3 reports
-
Storage Spaces has a missing or incorrect length check when copying into a fixed-size stack buffer.
Seen in 3 reports
-
The SMB client has missing or incorrect length checks when parsing data returned by an SMB server.
Seen in 3 reports
-
The Exynos NPU driver does not validate user-supplied buffer lengths before copying data.
Seen in 3 reports
-
Handling crafted input causes a NULL pointer dereference.
Seen in 3 reports
-
Numeric conversions and additions are done without checking for truncation or overflow.
Seen in 3 reports
-
Objects are freed while another thread or callback still holds a reference.
Seen in 3 reports
-
The graphics kernel frees objects while they are still referenced, with a race window.
Seen in 3 reports
-
PDF link annotations use objects without checking they still existed.
Seen in 3 reports
-
Printer client decoding uses packet length fields to drive decode loops without checking them against the real buffer size.
Seen in 3 reports
-
Parameters and objects are used without validating their type, leading to type confusion.
Seen in 3 reports
-
CAD file import parsers access memory that was never initialised before use.
Seen in 3 reports
-
Parsers did not validate the type of user-supplied data, leading to type confusion.
Seen in 3 reports
-
CAD file parsers trusted length values from the file and copied that many bytes into fixed-size heap or stack buffers without checking against the buffer size.
Seen in 3 reports
-
CAD file parsers use a pointer that was never initialised when handling particular file elements.
Seen in 3 reports
-
Pointers are dereferenced before being initialised.
Seen in 3 reports
-
Pointers taken from untrusted input are dereferenced without validation.
Seen in 3 reports
-
Products of dimensions or additions of offsets overflow before allocation, so buffers are smaller than the data written.
Seen in 3 reports
-
Reference counts are decremented incorrectly, freeing objects still held in tables or queues.
Seen in 3 reports
-
Resources are freed before pending GPU work is waited on, or before a re-entrant flush completes.
Seen in 3 reports
-
Run-length decoding loops do not check the fill count against the remaining buffer space.
Seen in 3 reports
-
Shared memory is read twice or accessed without locking, allowing a race to change data between uses.
Seen in 3 reports
-
Signed comparisons let negative or wrapped sizes pass allocation checks and return undersized buffers.
Seen in 3 reports
-
Size and length fields read from the file are used without checking them against the remaining buffer.
Seen in 3 reports
-
Size arithmetic used signed integers without overflow checks, so wrapped values produced undersized allocations.
Seen in 3 reports
-
Size calculations multiply or add values without checking for integer overflow.
Seen in 3 reports
-
Size calculations overflow or underflow before allocation or copying.
Seen in 3 reports
-
Size calculations such as head plus count or index plus one overflow before the capacity check, so buffers are undersized.
Seen in 3 reports
-
Size fields from the file are multiplied or added without overflow checks, so allocations wrap to tiny buffers.
Seen in 3 reports
-
Size or length values were not validated, causing integer overflow or underflow before memory allocation or writes.
Seen in 3 reports
-
Stack buffers are written past their end when parsing crafted files.
Seen in 3 reports
-
Static casts to the wrong type or type confusion between field types and argument lists.
Seen in 3 reports
-
The action handler used an object after it had been freed without checking it still existed.
Seen in 3 reports
-
The array element count is multiplied by the structure size without an overflow check, leading to an undersized allocation.
Seen in 3 reports
-
The buffer is sized with one calculation while the read or write uses a different, larger value.
Seen in 3 reports