Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.
View on MITREAdjacent variables in memory may be corrupted by assignments performed on fields after the cast.
Execution may end due to a memory access error.
The choice could be made to use a language that is not susceptible to these issues.
Review of type casting operations can identify locations where incompatible types are cast.
No detection method information available for this CWE.
The following example demonstrates the weakness.
No relationship information available for this CWE.
CWE-588: Attempt to Access Child of a Non-structure Pointer is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.
If exploited, CWE-588 (Attempt to Access Child of a Non-structure Pointer) it can compromise Integrity and Availability, leading to outcomes such as Modify Memory and DoS: Crash, Exit, or Restart.
Recommended mitigations for CWE-588 include: The choice could be made to use a language that is not susceptible to these issues. Review of type casting operations can identify locations where incompatible types are cast.
MITRE documents real CVEs mapped to CWE-588, including CVE-2021-3510. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.
A CWE (Common Weakness Enumeration) like CWE-588 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.