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.
-
A user-controlled compressed size is stored in an int despite being a long, so it truncates before a memory copy.
Seen in 1 report
-
A user-controlled index from a setup packet was used to index a function pointer array without bounds checking.
Seen in 1 report
-
A user-controlled URI directory was copied into a fixed-size stack buffer with no length check.
Seen in 1 report
-
A user-defined function is called while still holding a pointer to a buffer the user can detach, leading to use-after-free and out-of-bounds write.
Seen in 1 report
-
A user-supplied filename is copied into a fixed stack buffer without limiting length.
-
A user-supplied offset was used as a write destination without validation.
Seen in 1 report
-
A user-supplied string is copied into a heap buffer without proper validation.
-
A user-supplied string parameter is copied into a fixed-size stack buffer with an unbounded formatted copy.
Seen in 1 report
-
A user-supplied URI path is copied into a fixed-size buffer without first checking its length.
Seen in 1 report
-
A UTF-16 to UTF-8 conversion sizes its output buffer wrongly for odd-length input, and detection tables are indexed without a correct size check.
-
A V8 exception object was stored in an untraceable callback, so the garbage collector freed it before use.
Seen in 1 report
-
$4,000 Medium
-
-
A validation function returned success on the first supported field instead of failing on any unsupported field, so unsupported fields were never rejected.
Seen in 1 report
-
A value is handled as the wrong object type and dereferenced unsafely in the wasm-to-JS conversion path.
Seen in 1 report
-
$7,000 High
-
-
A value mishandled through numeric truncation, allowing privilege gain.
Seen in 1 report
-
A value of the wrong type is stored through a typed store that skips the write barrier, leaving a stale pointer.
Seen in 1 report
-
A variable was not initialised before use and the create function did not set it on failure, so the error path freed an arbitrary address.
Seen in 1 report
-
A vector constructor narrows a 64-bit span size to 32 bits without a checked cast, so allocation uses the truncated size while the copy uses the full size.
Seen in 1 report
-
A vector of attributes is iterated with raw pointers that are not protected against reallocation caused by synchronous JavaScript.
Seen in 1 report
-
A very large input made the string length wrap to a negative value, corrupting the string value.
Seen in 1 report
-
A vtable entry taken from file-controlled data is called without validation.
-
A waitable event was cleared before the worker finished, so the task object was freed while still in use.
Seen in 1 report
-
A weak pointer check on one thread is not atomic with destruction on another thread.
Seen in 1 report
-
A weak-pointer callback fired after the render frame was destroyed, touching freed memory outside the existing protection.
Seen in 1 report
-
A website name taken from a parsed JSON field is copied into a fixed-size stack buffer without a length check.
Seen in 1 report
-
A WebTransportCloseInfo object is confused with a WebSocketCloseInfo during promise resolution.
Seen in 1 report
-
A window handle's property still referenced freed memory after the window was destroyed, and the pointer could be controlled through the window long pointer calls.
-
A window is destroyed while still being observed during a drag-and-drop operation.
Seen in 1 report
-
A Window object is dereferenced without checking it still exists.
Seen in 1 report
-
A WinRT property-changed callback runs on an MTA thread and notifies a non-thread-safe observer list directly.
Seen in 1 report
-
A workaround increases the streamed vertex count after the buffer is allocated from the original count, so the copy loop writes past the end.
Seen in 1 report
-
A worker's termination freed an object while another thread still held a reference.
Seen in 1 report
-
A writable range is validated before some edit keys resolve their offset, so the later write lands outside the private copy.
Seen in 1 report
-
A write barrier was skipped when resetting a dispatch entry, so a concurrent mark bit could be cleared and the live entry swept.
Seen in 1 report
-
A write occurs to a channel array that was allocated with zero elements.
Seen in 1 report
-
A zero size was treated as a signal to use a string length call on a buffer that was not null-terminated.
Seen in 1 report
-
A zero-length buffer makes the write probe return immediately, so a caller-controlled pointer is never validated before increments are applied.
Seen in 1 report
-
A zero-sized buffer is allocated when the image height is zero and an uninitialised pointer from it is later freed.
Seen in 1 report
-
A zero-sized reallocation was treated as a plain free but left the stale pointer, so a later zero-sized reallocation freed the same buffer again.
Seen in 1 report
-
Adding 1 to a 32-bit length of the maximum value wraps to 0, leading to a zero-size allocation.
Seen in 1 report
-
Adding the current buffer length and new data length can wrap around, bypassing the capacity check.
Seen in 1 report
-
Adding the filename length to a header size overflows, producing a negative size passed to memcpy.
Seen in 1 report
-
Medium
-
-
Adding two to a size field from the file overflows and the size check passes incorrectly.
Seen in 1 report
-
Address of an array element held across a reallocation, leaving a stale pointer.
-
Adopt sets the string length directly without enforcing the maximum length, breaking the invariant that adding two lengths cannot overflow.
Seen in 1 report
-
AES decryption wrote into a fixed 1024-byte buffer without validating the decrypted length, unlike the RSA path.
Seen in 1 report
-
$200,000
-
-
Allocation size assumed tightly packed rows while the internal read still honoured an attacker-set pack alignment.
Seen in 1 report
-
$43,000 Critical
-
-
ALTER TYPE on a composite attribute changes type metadata without rewriting values already stored in a prepared statement.
Seen in 1 report
-
Alternate stack exhaustion in the exception logging enable function.
Seen in 1 report
-
ALU sanitation set per-operation limits that were too weak to stop the crafted program at runtime.
-
An absolute character index was passed as the bound to a forward macro that expected a subrange length.
Seen in 1 report