CWE-822 - Untrusted Pointer Dereference
- Abstraction:Base
- Structure:Simple
- Status:Incomplete
- Release Date:2010-09-27
- Latest Modification Date:2023-06-29
Weakness Name
Untrusted Pointer Dereference
Description
The product obtains a value from an untrusted source, converts this value to a pointer, and dereferences the resulting pointer.
An attacker can supply a pointer for memory locations that the product is not expecting. If the pointer is dereferenced for a write operation, the attack might allow modification of critical state variables, cause a crash, or execute code. If the dereferencing operation is for a read, then the attack might allow reading of sensitive data, cause a crash, or set a variable to an unexpected value (since the value will be read from an unexpected memory location). There are several variants of this weakness, including but not necessarily limited to:
Common Consequences
Scope: Confidentiality
Impact: Read Memory
Notes: If the untrusted pointer is used in a read operation, an attacker might be able to read sensitive portions of memory.
Scope: Availability
Impact: DoS: Crash, Exit, or Restart
Notes: If the untrusted pointer references a memory location that is not accessible to the product, or points to a location that is "malformed" or larger than expected by a read or write operation, the application may terminate unexpectedly.
Scope: Integrity, Confidentiality, Availability
Impact: Execute Unauthorized Code or Commands, Modify Memory
Notes: If the untrusted pointer is used in a function call, or points to unexpected data in a write operation, then code execution may be possible.
Related Weaknesses
CWE-119Improper Restriction of Operations within the Bounds of a Memory BufferHigh