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 parser copied profile data into a fixed-size buffer without validating the length or size fields first.
-
The parser copied user-supplied data into a fixed-length stack buffer without validating its length.
-
The parser copied user-supplied data into fixed-length buffers without checking the length.
-
The parser copies user data into a stack buffer without checking its length.
-
The parser copies user-controlled data into a fixed-size heap buffer without checking the length.
-
The parser copies user-supplied data into a fixed-length stack buffer without validating its length.
-
The parser copies user-supplied data into a fixed-size heap buffer without checking its length.
-
The parser dereferenced an object after freeing it because it did not check the object still existed.
-
The parser dereferences an object after it has been freed because it never checks that the object still exists.
-
The parser did not check that an object still existed before using it.
-
The parser does not check that a value from the file is a valid pointer before dereferencing it.
-
The parser does not check that an object still exists before using it, leading to use-after-free.
-
The parser does not check the length of user-supplied data before copying it into a fixed-length heap buffer.
-
The parser does not properly validate user-supplied data.
-
The parser does not validate the size or structure of user-supplied data.
-
The parser operated on an object without confirming it still existed, leading to use-after-free.
-
The parser treated one kind of data as another because it did not validate the data type it read.
-
The parser trusts the type of data in the file without validating it before use.
-
The parser used objects without checking they still existed and copied data into fixed-length stack buffers without length checks.
-
The PDF parser does not validate the length of user-supplied data before copying it into a fixed-size heap buffer.
-
The plugin fails to validate the length of user-supplied data before copying it into a heap buffer.
-
The promising builtin fails to set the register holding the API function reference before calling the wasm-to-js wrapper, leaving instance data in its place.
Seen in 2 reports
-
The record size read from the file controls a copy loop without being checked against the fixed buffer size.
Seen in 2 reports
-
The reset clears the list in the set struct but not the duplicate pointer in the state struct.
-
The same memory freed twice.
-
The same memory is freed more than once, allowing corruption.
-
The same memory is freed twice, corrupting allocator state.
-
The service does not properly validate the size or content of user-supplied data in messages.
-
The service trusts the length or structure of network input and reads beyond the allocated buffer.
-
The setjmp checkpoint lives in a helper function that returns before the decode calls, so a later longjmp resumes in a dead stack frame.
-
The shared IPv4 options object is freed with plain kfree instead of kfree_rcu while another CPU may still read it in an RCU read-side section.
-
The size calculation for an argument buffer does not account for characters copied when escaping is bypassed by a trailing backslash.
-
The size check subtracts the payload length from the maximum before comparing, so an oversized length underflows to a large positive value and passes.
-
The size or content of user-supplied data is not validated before it is used to allocate memory.
-
The sizing pass uses a fresh engine that does not inherit the argument-mode flag from the execution engine.
Seen in 2 reports
-
The SKP parser did not verify an object still existed before performing operations on it.
-
The software does not check that a Collab object still exists before operating on it.
-
The software does not check whether a Doc object still exists before performing operations on it.
-
The software fails to check the length of data from a file before copying it into a fixed-size stack buffer.
-
The Text Services Framework interacts with the browser in a way that mishandles objects in memory.
Seen in 2 reports
-
The tree builder indexes its open-element stack with a negative or stale position after re-entrant document.write and close calls.
-
The upcasing loop bounds-checked only one output byte while a single input character could expand to two, overflowing the output buffer.
-
The upload progress callback caches raw pointers into a hash table that is freed and re-decoded, and the pointers are never refreshed.
-
The validator cached a raw pointer to the ArrayBuffer contents and then called back into JavaScript before finishing its reads, without re-checking the buffer was still attached.
Seen in 2 reports
-
The verifier does not properly validate user-supplied eBPF programs before execution.
-
Transfer teardown frees the handle before queued data is flushed, leaving a dangling pointer.
Seen in 2 reports
-
Two escape-sequence branches lack the output-buffer bounds check the first branch has, and the output buffer is only slightly larger than the input.
-
Unbounded string copies and unbounded parsing place user input into fixed stack buffers with no length limit and no stack cookie.
Seen in 2 reports
-
Unbounded string copy functions are used with user-controlled input and fixed-size buffers.
Seen in 2 reports
-
Unbounded string reads write into fixed-size stack buffers without limiting the number of characters.
Seen in 2 reports