This vulnerability occurs when code explicitly assigns a hardcoded memory address to a pointer, instead of using a dynamic or null value.
Assigning a fixed memory address, like 0xDEADBEEF, creates code that is inherently non-portable. The address is only meaningful within a specific execution environment, memory layout, or platform. When the software runs on a different operating system, hardware, or even after a system update, that exact memory location will likely be invalid or contain unrelated data, leading to crashes or undefined behavior. This practice bypasses the operating system's memory management and can severely hinder code reuse and security. Developers should always rely on safe memory allocation functions or system APIs to obtain valid pointers, ensuring the application functions correctly across different environments and remains maintainable.
Impact: Execute Unauthorized Code or Commands
If one executes code at a known location, an attacker might be able to inject code there beforehand.
Impact: DoS: Crash, Exit, or RestartReduce MaintainabilityReduce Reliability
If the code is ported to another platform or environment, the pointer is likely to be invalid and cause a crash.
Impact: Read MemoryModify Memory
The data at a known pointer location can be easily read or influenced by an attacker.
c
// Here we can inject code to execute.*