This vulnerability occurs when software attempts to read from or write to a memory buffer using an index or pointer that points past the buffer's allocated boundary.
This flaw, often called a buffer over-read or over-write, happens when a program incorrectly calculates a memory position. It typically stems from a pointer being incremented too far, an index being miscalculated, or pointer arithmetic producing an invalid address that lands outside the intended buffer's range. The result is access to adjacent memory that doesn't belong to the buffer, which can corrupt data or expose sensitive information. For developers, this is a critical memory safety issue. It can lead to crashes, unpredictable behavior, or be exploited to leak confidential data or gain code execution. Common causes include off-by-one errors in loops, incorrect size calculations, or using untrusted input directly as an array index without proper bounds checking.
Impact: Read Memory
For an out-of-bounds read, the attacker may have access to sensitive information. If the sensitive information contains system details, such as the current buffer's position in memory, this knowledge can be used to craft further attacks, possibly with more severe consequences.
Impact: Modify MemoryDoS: Crash, Exit, or Restart
Out of bounds memory access will very likely result in the corruption of relevant memory, and perhaps instructions, possibly leading to a crash. Other attacks leading to lack of availability are possible, including putting the program into an infinite loop.
Impact: Modify MemoryExecute Unauthorized Code or Commands
If the memory accessible by the attacker can be effectively controlled, it may be possible to execute arbitrary code, as with a standard buffer overflow. If the attacker can overwrite a pointer's worth of memory (usually 32 or 64 bits), they can redirect a function pointer to their own malicious code. Even when the attacker can only modify a single byte arbitrary code execution can be possible. Sometimes this is because the same problem can be exploited repeatedly to the same effect. Other times it is because the attacker can overwrite security-critical application-specific data -- such as a flag indicating whether the user is an administrator.
c
/*routine that ensures user_supplied_addr is in the right format for conversion /
cc
/* if chunk info is valid, return the size of usable memory,*
c
c
/* encode to < / } else dst_buf[dst_index++] = user_supplied_string[i];} return dst_buf;}
c
// get message from socket and store into buffer*
c
c
// process message* success = processMessage(message);} return success;}