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 size or length field taken from the file is trusted and written without checking it fits the allocated buffer.
-
A size or length is not validated before writing into a heap buffer.
-
A size or length value taken from the font file is used in arithmetic that overflows before memory is read.
-
A size query and a data read are separate cache lookups with no pinning, so the entry can change between them.
Seen in 1 report
-
$5,000 Medium
-
-
A size to int truncation of frame strides combined with modular signed arithmetic makes the plane size wrap to a small positive value and pass the bounds check.
Seen in 1 report
-
A size value computed from shader bytecode is truncated to 32 bits, so allocation and memset go out of bounds.
Seen in 1 report
-
A size value derived from the file header was trusted when decompressing the colour map.
Seen in 1 report
-
A size value is truncated with a signed cast, wrapping negative when it exceeds the integer maximum, and used in pointer arithmetic without validation.
Seen in 1 report
-
$2,000 Medium
-
-
A size value was passed to a function taking a signed integer, so a very large length truncated to a negative value and later became a huge copy length.
Seen in 1 report
-
A size_t depth was stored into a uint16_t field, silently truncating values above 65535 while the getter returned size_t and hid it.
Seen in 1 report
-
A size_t multiplication is truncated to a signed int before allocation.
Seen in 1 report
-
A skip routine advanced the cursor by an attacker-controlled block size without comparing it to the remaining bytes, and the signed remaining counter went negative while guards cast it to unsigned.
-
A small lookup array was indexed with an unchecked value, and the resulting out-of-bounds read was used as a loop count without validation.
Seen in 1 report
-
A sort uses the total cookie count rather than the number of filled entries, so uninitialised slots are compared.
Seen in 1 report
-
A sorted table was searched before it was initialised.
Seen in 1 report
-
A span is held across a point of synchronous script execution, so the underlying buffer can be detached before the span is written.
Seen in 1 report
-
A span over the attribute vector was refreshed only after the inner loop, not after each call that could reallocate it.
Seen in 1 report
-
A stack buffer overflow in 4D point arithmetic.
Seen in 1 report
-
A stack buffer overflow when a document-supplied style is applied during macro recording.
Seen in 1 report
-
A stack buffer overflow when parsing a crafted document.
Seen in 1 report
-
A stack handling bug around method_missing leaves the context stack inconsistent, so the garbage collector dereferences a bad pointer.
Seen in 1 report
-
A stack struct is declared without zero-initialisation and only one specific error is handled, leaving stack residue in use.
Seen in 1 report
-
A stack-allocated array is assigned to a bignum pointer field, and a later reallocation routine tries to free that stack pointer.
Seen in 1 report
-
A stack-allocated frame stayed linked after an exception unwound it, so later code dereferenced a stale pointer.
-
A stack-allocated state guard was used across a synchronous callout that could run nested tasks and destroy the object, and the smart pointer did not quarantine the memory.
Seen in 1 report
-
A stale frame or style context reference is used after the presentation shell's arena is freed during a script-triggered reload.
Seen in 1 report
-
A stale or mismatched frame property lookup during absolute-position reflow read past the end of a frame-properties array.
Seen in 1 report
-
A stale pointer was used after the instruction buffer was reallocated during code generation.
Seen in 1 report
-
A stale reference to an object freed when a method failed was reused during document close cleanup.
Seen in 1 report
-
A state update calls a bounds-change handler without a liveness check and keeps using the this pointer and state reference after an observer destroys the host.
Seen in 1 report
-
A static cast downcasts a base pointer to a derived class without checking the actual type, which is invalid for a sibling class.
Seen in 1 report
-
A static cast without verifying the object type treated any JavaScript object as an audio worklet processor.
Seen in 1 report
-
A statistics collector was shared between encoder callbacks on different threads without a lock, so a configuration change could destroy the histogram another thread was using.
Seen in 1 report
-
A stored value is read into a stack buffer smaller than the maximum the setting allows.
Seen in 1 report
-
A stream read method passing a larger count than the caller requested to the underlying stream.
Seen in 1 report
-
A string assignment relies on null termination instead of the known clipboard buffer size.
Seen in 1 report
-
A string buffer used while building an error message is freed by the garbage collector during a nested allocation, and the stale pointer is used in a copy.
Seen in 1 report
-
A string copy into a fixed stack buffer without checking the destination size.
-
A string copy into a fixed-size buffer at an offset did not check the source length against the remaining space.
-
A string copy without a length limit into a fixed buffer.
Seen in 1 report
-
A string duplication helper stopped at the first NUL byte but the code then wrote a fixed number of NUL bytes based on the original length.
Seen in 1 report
-
A string is freed and then used in a failure log message.
Seen in 1 report
-
A string view is built from an untrusted filename length field without checking it fits the remaining bytes of the notification buffer.
Seen in 1 report
-
A structure allocated for a soft hyphen ActualText is smaller than expected, and later code accesses it as a larger structure.
-
A style declaration block is freed while still referenced during rule node transition.
Seen in 1 report
-
A style update frees the graphics context but the code later accesses a gradient from it without revalidating.
Seen in 1 report
-
A style-level count field is not validated against its maximum before an out-of-bounds write.
-
A success callback does not reset the stored descriptor or invalidate the cookie.
Seen in 1 report
-
A parser accessed memory that had not been initialised.
-
A parser deletes an element that failed validation and passes the pointer back, so it is deleted again.
Seen in 1 report