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.
-
The cached frame index was not reset when cached pixel buffers were freed, so a later decode skipped re-initialisation and wrote through a dangling pointer.
Seen in 1 report
-
The cached memory index was truncated to a single byte, so different memory indices were confused and the wrong start pointer and size were used.
Seen in 1 report
-
The callback fanout loop did not hold a reference while invoking callbacks that could release the last reference.
Seen in 1 report
-
The callback ID counter is a signed 32-bit integer incremented without skipping the reserved sentinel values used by the hash map.
Seen in 1 report
-
The callee Phi width is checked when snapshotting the candidate but read again at finalisation without re-checking.
Seen in 1 report
-
The caller caches the list head in a local variable while the release helper updates only the member, so a second removal unlinks the wrong node.
Seen in 1 report
-
The caller does not check whether the returned query set is an error placeholder before casting it to the backend type.
Seen in 1 report
-
The caller freed a buffer after a write failure while the write helper had already freed the same buffer when no callback was supplied.
Seen in 1 report
-
The caller obtained the clipboard buffer and its length but called the image converter without passing the length.
-
The cancel handler triggers a step change that synchronously destroys its own owning objects, then keeps using its member pointer.
Seen in 1 report
-
The cancellation path did not check whether the tool objects were destroyed during a synchronous event dispatch that can run attacker script.
Seen in 1 report
-
The cancellation path fails to abort the pending fetch because the session identifier is nil, and the callback stores the tab group pointer in an assign property.
Seen in 1 report
-
The canvas code did not validate the source rectangle and image dimensions before premultiplying pixels into the destination buffer.
Seen in 1 report
-
The capacity check compares a signed 32-bit size against the capacity, so an increment past the maximum wraps negative and the reallocation branch is never taken.
-
The capture code validates the cursor image width and pixel format but never checks its height before copying rows.
Seen in 1 report
-
The capture delegate loop re-checks the old capture window's liveness after each update but not the new capture window's.
Seen in 1 report
-
The capture method did not check whether the widget was destroyed during the synchronous, reentrant native capture call before continuing to use itself.
Seen in 1 report
-
The captured length was replaced by the full on-wire length when calling the Ethernet printer, so bounds checks used the wrong value.
-
The certificate stats cache is reused across getStats() calls without invalidation, and only a debug-only check confirms the lookup succeeded.
Seen in 1 report
-
The certificate string conversion function calls free on a stack buffer, corrupting the allocator state.
Seen in 1 report
-
The CGI handler stores the original client connection as user data, but that connection is closed and freed before the handler later dereferences the stale pointer.
Seen in 1 report
-
The channel attribute value was cast to the colour channel enum and used as an array index without a range check.
-
The channel ordering lookup returned indices up to five while the buffer was sized from the caller-supplied channel count, and a validation exemption let it through.
Seen in 1 report
-
The channel selection value is stored without verifying it is at least minus one, so other negative values pass and are used as array indices.
Seen in 1 report
-
The channel split descriptors into batches of 128, and later batches carried only descriptors with no message bytes, which the stream socket send did not handle.
Seen in 1 report
-
The character array for the formatted integer was sized without room for the minus sign and terminator of the longest negative value.
Seen in 1 report
-
The character count field is not validated against the documented maximum before the Unicode expansion loop writes two bytes per character.
Seen in 1 report
-
The CharStringsOffset value in the CFF2 table is not validated against the table bounds, allowing an arbitrarily large length.
Seen in 1 report
-
The check for whether an unload acknowledgement was expected happened after the inner delegate attachment branch.
Seen in 1 report
-
The check preventing drawing from a mapped buffer was skipped for WebGL contexts, and an internal reallocation freed the staging buffer without updating the cached pointer.
Seen in 1 report
-
The chunk size parsed from the request was used as the length in a memmove without a bounds check.
Seen in 1 report
-
The chunk size read from the file is used directly as the copy length into a fixed stack buffer with no bounds check.
Seen in 1 report
-
The class does not override release to route destruction back to its bound task runner, so the last reference dropped on a threadpool thread deletes it there.
Seen in 1 report
-
The class lock is not taken around reads and writes of the port vectors, so a push back reallocation frees storage another thread is reading.
Seen in 1 report
-
The cleanup length is not set when skipping an out-of-bounds read on a legitimate fat pointer, so the destination register is not zeroed.
Seen in 1 report
-
The cleanup loop destroyed shader module handles but did not reset them to the null handle, so a later cleanup destroyed them again.
Seen in 1 report
-
The cleanup routine freed the same filename pointer more than once and then used it again because overlapping upload structures were created.
Seen in 1 report
-
The clear-queue handler identified sockets by file descriptor number rather than by socket object, so a reused descriptor caused a double reference drop.
Seen in 1 report
-
$10,000 High
-
-
The CLFS driver mishandled objects in memory, leading to memory corruption exploitable for privilege escalation.
-
The client allocated a buffer for the password but copied the password without checking that it fitted.
Seen in 1 report
-
The client assumes each column descriptor's fixed header is at least 12 bytes without validating the actual field length.
-
The client passed an attacker-controlled buffer length and serialised array counts to the deserialiser without checking them against the actual buffer size.
-
The client picks a struct type from the context name in the reply instead of the request.
Seen in 1 report
-
The client processes a server response without a bounds check on the data size.
Seen in 1 report
-
The client uses the server-supplied per-row field length as the readable extent of a buffer sized from the smaller prepare-time length.
-
The close path ignored the failure return of the internal removal call during a callback and freed the handle anyway.
Seen in 1 report
-
The code accessed the byte before the buffer when encoding an empty hostname.
Seen in 1 report
-
The code accesses the sequence member of the SDP data union without first checking that the element's type field is a sequence type.
Seen in 1 report
-
The code adds the header length to the data length without checking for overflow, so a huge data length wraps to a small frame length that passes the size check.
Seen in 1 report
-
The code allocates a buffer based on one file-controlled count but then reads a different file-controlled size into it without checking that the read fits.
Seen in 1 report