In-depth lesson · Memory corruption
Typical fixes
Every point the Memory corruption reports back under this heading, best-backed first, each with the reports it is seen in.
-
Perform the beg plus len bounds check in a way that cannot overflow.
Seen in 1 report
-
Perform the bounds check before writing to the array.
Seen in 1 report
-
Perform the FAT sector count times sector size calculation in a width that cannot overflow, or check the result before allocating.
-
Perform the length calculation without a 32-bit multiply that can overflow, or reject inputs that would overflow.
Seen in 1 report
-
Perform the maximum message size check with unsigned or overflow-checked arithmetic.
Seen in 1 report
-
Perform the uniform packing limit sum with overflow-checked arithmetic.
Seen in 1 report
-
Pin or lock the cache entry across the size query and the data read.
Seen in 1 report
-
$5,000 Medium
-
-
Prevent stacking ecryptfs on procfs and add guard pages to kernel stacks.
Seen in 1 report
-
Propagate the procs restriction object to nested objects during SkPicture deserialisation.
Seen in 1 report
-
Properly validate and handle malformed networking packets received over the air.
Seen in 1 report
-
Protect map and unmap operations with the same lock so the backing page cannot be freed mid-operation.
Seen in 1 report
-
Protect processing methods with the same lock used when clearing handlers during teardown.
-
Publish a DMARC record so receivers can reject or quarantine unauthenticated mail.
Seen in 1 report
-
Publish technical detail with security advisories so hunters do not have to reverse patches.
Seen in 1 report
-
Randomise memory layout correctly so ASLR is effective.
Seen in 1 report
-
Rate limit submissions on the contact form and do not send mail to arbitrary addresses.
-
Re-check for infinity after the multiplication and guard the integer cast.
Seen in 1 report
-
Re-check that the request list is non-empty before indexing it in the delayed prompt callback.
Seen in 1 report
-
Re-check the anonymous content node after layout runs script and cycle collection.
Seen in 1 report
-
Re-check the condition pointer after navigation commit steps that can reentrantly erase it.
Seen in 1 report
-
$36,000 High
-
-
Re-validate the inspector pointer after JavaScript callbacks.
Seen in 1 report
-
$3,000 High
-
-
Read the annotation page number once under a lock and use the cached value for both the check and the use.
Seen in 1 report
-
Read the buffer size after the GL layer updates it and clear stale dirty flags on recycled buffers.
Seen in 1 report
-
Reallocate packet buffers when a negotiated block size changes.
Seen in 1 report
-
Critical
-
-
Recheck the map kind after updating a deprecated map instead of assuming it stays a fast map.
Seen in 1 report
-
$25,000 High
-
-
Reduce the recorded length when advancing the data pointer past skipped bytes.
Seen in 1 report
-
Refresh all cached buffer pointers, not only those for attributes active in the current shader.
Seen in 1 report
-
Refresh cached pointers in the upload progress callback after the hash table is re-decoded.
Seen in 1 report
-
Reject a second Init after the first has resolved and release the existing decoder session before replacing its pointer.
-
Reject all negative index values and use unsigned comparisons in the numbering loop.
-
Reject batch requests where a later operation references an anonymous set deleted earlier in the same batch.
Seen in 1 report
-
Reject dictionary size resets to zero after the context has been set up.
Seen in 1 report
-
Reject faces with out-of-range or negative vertex indices rather than skipping them.
Seen in 1 report
-
Reject JPEG2000 SIZ markers that declare zero components before allocating.
Seen in 1 report
-
Reject mixed advanced and standard blend equations across enabled draw buffers.
Seen in 1 report
-
Reject negative binding offsets and keep offsets unsigned through the decoder.
Seen in 1 report
-
Reject non-finite floating-point values during deserialisation before they are used as map keys.
Seen in 1 report
-
Reject non-finite values in the k-rate audio parameter path.
Seen in 1 report
-
Reject removal and cleanup of the internal admin easy handle.
-
Reject superblocks where block addresses and segment counts are all zero so areas cannot overlap.
Seen in 1 report
-
Reject variable definitions that appear after the end-of-definitions marker.
Seen in 1 report
-
Reload the instance cache when any memory is grown, not only when memory zero can grow.
Seen in 1 report
-
$17,000 High
-
-
Remove the dangling reference so freed memory is not used again.
-
Remove the pure annotation from getters that flush layout or dispatch events.
-
Remove the stale pointer from the document dictionary when a reference object is freed.
Seen in 1 report
-
Remove the vulnerable code in MediaRemote.
-
Remove the vulnerable code in IOKit.
-
Replace unchecked strcpy of launch arguments with bounded copying.
-
Require that all expected fields were parsed before treating the parse as successful.
Seen in 1 report
-
High
-
-
Reserve one more slot than the index that will be accessed in the bitmap vector.
Seen in 1 report