CWE-588 — Attempt to Access Child of a Non-structure Pointer
CWE-588: Attempt to Access Child of a Non-structure Pointer
MITRE CWE weakness
| Kind | Weakness |
| Abstraction | Variant |
| Status | Incomplete |
| Likelihood of exploit | — |
Description
Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.
Common consequences
- Integrity: Modify Memory
- Availability: DoS: Crash, Exit, or Restart
Mitigations
Requirements — The choice could be made to use a language that is not susceptible to these issues.
Implementation — Review of type casting operations can identify locations where incompatible types are cast.
References
- CWE page: https://cwe.mitre.org/data/definitions/588.html
- CWE list: https://cwe.mitre.org/data/index.html