This vulnerability occurs when software incorrectly writes data outside the boundaries of its allocated memory buffer, either beyond the end or before the beginning.

An out-of-bounds write happens when a program fails to properly validate the target location for a write operation, such as copying data, assigning a value, or modifying memory. This can corrupt adjacent data structures, crash the application, or alter critical program logic, often leading to unpredictable behavior. It's a fundamental memory safety flaw commonly arising from incorrect pointer arithmetic, off-by-one errors, or using unsafe functions that don't check buffer sizes. Attackers frequently exploit this weakness to execute arbitrary code, escalate privileges, or cause denial-of-service. To prevent it, developers should use secure, bounds-checked functions, employ modern safe languages or libraries, and rigorously validate all indices and offsets before performing write operations. Static and dynamic analysis tools are also essential for catching these dangerous errors before deployment.
Impact: Modify MemoryExecute Unauthorized Code or Commands
Write operations could cause memory corruption. In some cases, an adversary can modify control data such as return addresses in order to execute unexpected code.
Impact: DoS: Crash, Exit, or Restart
Attempting to access out-of-range, invalid, or unauthorized memory could cause the product to crash.
Impact: Unexpected State
Subsequent write operations can produce undefined or unexpected results.
Strategy: Language Selection
Strategy: Libraries or Frameworks
Strategy: Environment Hardening
Effectiveness: Defense in Depth
Strategy: Environment Hardening
Effectiveness: Defense in Depth
Strategy: Environment Hardening
Effectiveness: Defense in Depth
Effectiveness: Moderate
cc
/* if chunk info is valid, return the size of usable memory,*
c
c
/*routine that ensures user_supplied_addr is in the right format for conversion /
cc
/* encode to < / } else dst_buf[dst_index++] = user_supplied_string[i];} return dst_buf;}
c
// copy input string to a temporary string* char message[length+1]; int index; for (index = 0; index < length; index++) { ``` message[index] = strMessage[index]; } message[index] = '\0';
c
// return string without trailing whitespace* retMessage = message; return retMessage;}
ccHigh