---
title: "CWE-588: Attempt to Access Child of a Non-structure Pointer"
url: https://radicalnotion.ai/cwe/cwe-588
type: cwe
description: "The product casts a non-structure type to a structure type, then accesses a field within the structure."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-588: Attempt to Access Child of a Non-structure Pointer

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 3
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product casts a non-structure type to a structure type, then accesses a field within the structure.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Languages:** C (Undetermined), C++ (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity | Modify Memory | Adjacent variables in memory may be corrupted by assignments performed on fields after the cast, leading to data corruption. |
| Availability | DoS: Crash, Exit, or Restart | Execution may end due to a memory access error. |

## Potential 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.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## Demonstrative examples

### Example 1

The following example demonstrates the weakness.

Bad code:

```c
struct foo
{
    int i;
}
...
int main(int argc, char **argv)
{
    *foo = (struct foo *)main;
    foo->i = 2;
    return foo->i;
}
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2021-3510 | JSON decoder accesses a C union using an invalid offset to an object |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2021-3510 | Zephyr JSON decoder incorrectly decodes array of array | high | 7.5 | - | No | 2021-10-05 |
| CVE-2024-50178 | cpufreq: loongson3: Use raw\_smp\_processor\_id() in do\_service\_request() | medium | 5.5 | - | No | 2024-11-08 |
| CVE-2022-48638 | cgroup: cgroup\_get\_from\_id() must check the looked-up kn is a directory | medium | 5.3 | - | No | 2024-04-28 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-704](https://radicalnotion.ai/cwe/cwe-704) | Incorrect Type Conversion or Cast |
| Parent | [CWE-758](https://radicalnotion.ai/cwe/cwe-758) | Reliance on Undefined, Unspecified, or Implementation-Defined Behavior |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Faulty Pointer Use | SFP7 | - |

## Frequently asked questions

### What is CWE-588?

The product casts a non-structure type to a structure type, then accesses a field within the structure.

### What CVEs are caused by CWE-588?

3 recorded CVEs are attributed to CWE-588, including CVE-2021-3510, CVE-2024-50178 and CVE-2022-48638.

### How do you prevent CWE-588?

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

### How is CWE-588 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-588?

Exploiting CWE-588 can lead to: Modify Memory, DoS: Crash, Exit, or Restart.

### Is CWE-588 actively exploited?

3 recorded CVEs are caused by CWE-588; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/588.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-588). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
