CWE-468: Incorrect Pointer Scaling
Description
In C and C++, one may often accidentally refer to the wrong memory due to the semantics of when math operations are implicitly scaled.
- Abstraction
- BaseA weakness specific enough to point to detection and prevention methods.
- Likelihood of exploit
- Medium
- Status
- Incomplete
Common consequences
- ConfidentialityIntegrity
Read Memory; Modify Memory
Incorrect pointer scaling will often result in buffer overflow conditions. Confidentiality can be compromised if the weakness is in the context of a buffer over-read or under-read.
Potential mitigations
- Architecture and Design
Use a platform with high-level memory abstractions.
- Implementation
Always use array indexing instead of direct pointer manipulation.
- Architecture and Design
Use technologies for preventing buffer overflows.
Related weaknesses
Parent weaknesses
CAPEC attack patterns that exploit it
CWE 4.20 links no CAPEC attack pattern to this weakness.