Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-588:Attempt to Access Child of a Non-structure Pointer
Weakness ID:588
Version:v4.17
Weakness Name:Attempt to Access Child of a Non-structure Pointer
Vulnerability Mapping:Allowed
Abstraction:Variant
Structure:Simple
Status:Incomplete
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.

▼Extended Description

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfAllowed-with-ReviewC704Incorrect Type Conversion or Cast
ChildOfAllowed-with-ReviewC758Reliance on Undefined, Unspecified, or Implementation-Defined Behavior
Nature: ChildOf
Mapping: Allowed-with-Review
Type: Class
ID: 704
Name: Incorrect Type Conversion or Cast
Nature: ChildOf
Mapping: Allowed-with-Review
Type: Class
ID: 758
Name: Reliance on Undefined, Unspecified, or Implementation-Defined Behavior
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC971SFP Secondary Cluster: Faulty Pointer Use
MemberOfProhibitedC1416Comprehensive Categorization: Resource Lifecycle Management
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 971
Name: SFP Secondary Cluster: Faulty Pointer Use
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1416
Name: Comprehensive Categorization: Resource Lifecycle Management
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-324DoS: Crash, Exit, or Restart (impact)
MemberOfProhibitedBSBOSS-331Modify Memory (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-324
Name: DoS: Crash, Exit, or Restart (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-331
Name: Modify Memory (impact)
▼Relevant To View
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC971SFP Secondary Cluster: Faulty Pointer Use
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 971
Name: SFP Secondary Cluster: Faulty Pointer Use
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
IntegrityN/AModify Memory

Adjacent variables in memory may be corrupted by assignments performed on fields after the cast.

AvailabilityN/ADoS: Crash, Exit, or Restart

Execution may end due to a memory access error.

Scope: Integrity
Likelihood: N/A
Impact: Modify Memory
Note:

Adjacent variables in memory may be corrupted by assignments performed on fields after the cast.

Scope: Availability
Likelihood: N/A
Impact: DoS: Crash, Exit, or Restart
Note:

Execution may end due to a memory access error.

▼Potential Mitigations
Phase:Requirements
Mitigation ID:
Strategy:
Effectiveness:
Description:

The choice could be made to use a language that is not susceptible to these issues.

Note:


Phase:Implementation
Mitigation ID:
Strategy:
Effectiveness:
Description:

Review of type casting operations can identify locations where incompatible types are cast.

Note:

▼Modes Of Introduction
Phase: Implementation
Note:

N/A

▼Applicable Platforms
▼Demonstrative Examples
Example 1

The following example demonstrates the weakness.

Language: ( code)
N/A

Language: C(Bad code)
struct foo { int i; } ... int main(int argc, char **argv) { *foo = (struct foo *)main; foo->i = 2; return foo->i; }

▼Observed Examples
ReferenceDescription
CVE-2021-3510
JSON decoder accesses a C union using an invalid offset to an object
Reference: CVE-2021-3510
Description:
JSON decoder accesses a C union using an invalid offset to an object
▼Affected Resources
    ▼Functional Areas
      ▼Weakness Ordinalities
      OrdinalityDescription
      ▼Detection Methods
      ▼Vulnerability Mapping Notes
      Usage:Allowed
      Reason:Acceptable-Use
      Rationale:

      This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

      Comments:

      Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

      Suggestions:
      ▼Notes
      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      Software Fault PatternsSFP7N/AFaulty Pointer Use
      Taxonomy Name: Software Fault Patterns
      Entry ID: SFP7
      Fit: N/A
      Entry Name: Faulty Pointer Use
      ▼Related Attack Patterns
      IDName
      ▼References
      Details not found