---
title: "CWE-237: Improper Handling of Structural Elements"
url: https://radicalnotion.ai/cwe/cwe-237
type: cwe
description: "The product does not handle or incorrectly handles inputs that are related to complex structures."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-237: Improper Handling of Structural Elements

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

## Description

The product does not handle or incorrectly handles inputs that are related to complex structures.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity | Unexpected State | - |

## Demonstrative examples

### Example 1

In the following C/C++ example, the method processMessageFromSocket() will get a message from a socket, save the message into a buffer, and place the contents of the buffer into a structure that contains the message length and the message body. Then a for loop is used to copy the message body into a local character string, which will be passed to another method for processing.

Bad code:

```c
int processMessageFromSocket(int socket) {
    // initialize variable to represent the failure case by default
    int success = -1;
    char buffer[BUFFER_SIZE];
    char message[MESSAGE_SIZE];

    // get message from socket and store into buffer
    // for clarity of this example, ignore the possibility that buffer > BUFFER_SIZE
    if (getMessage(socket, buffer, BUFFER_SIZE) > 0) {

        // place contents of the buffer into message structure
        ExMessage *msg = recastBuffer(buffer);

        // copy message body into string for processing
        int index;
        for (index = 0; index < msg->msgLength; index++) {
            message[index] = msg->msgBody[index];
        }
        message[index] = '\0';
        // process message
        success = processMessage(message);
    }
    return success;
}
```

However, the message length variable (msgLength) from the structure is used as the condition for ending the for loop without validating that msgLength accurately reflects the actual length of the message body (CWE-606). If msgLength indicates a length that is longer than the size of a message body (CWE-130), then this can result in a buffer over-read by reading past the end of the buffer (CWE-126).

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2019-1000007 | Depth counting error in guard() leading to multiple potential security issues in aioxmpp | high | 8.3 | - | No | 2019-02-04 |
| CVE-2022-50286 | ext4: fix delayed allocation bug in ext4\_clu\_mapped for bigalloc + inline | high | 7.8 | - | No | 2025-09-15 |
| CVE-2023-34429 | Weintek Weincloud Improper Handling of Structural Elements | high | 7.5 | - | No | 2023-07-19 |
| CVE-2022-50627 | wifi: ath11k: fix monitor mode bringup crash | medium | 5.5 | - | No | 2025-12-08 |
| CVE-2025-21708 | net: usb: rtl8150: enable basic endpoint checking | medium | 5.5 | - | No | 2025-02-27 |
| CVE-2024-56723 | mfd: intel\_soc\_pmic\_bxtwc: Use IRQ domain for PMIC devices | medium | 5.5 | - | No | 2024-12-29 |
| CVE-2023-6110 | Openstack: deleting a non existing access rule deletes another existing access rule in it's scope | medium | 5.5 | - | No | 2024-11-17 |
| CVE-2026-119069 | Routinator may keep some data from a rejected publication point. | medium | 5.3 | - | No | 2026-11-23 |
| CVE-2025-47914 | Malformed constraint may cause denial of service in golang.org/x/crypto/ssh/agent | medium | 5.3 | - | No | 2025-11-19 |
| CVE-2026-120386 | Effekseer improperly validates input data | medium | 5.1 | - | No | 2026-11-09 |
| CVE-2025-24336 | SXF Common Library vulnerable to improper input data handling | low | 3.3 | - | No | 2025-01-31 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-228](https://radicalnotion.ai/cwe/cwe-228) | Improper Handling of Syntactically Invalid Structure |
| Child | [CWE-238](https://radicalnotion.ai/cwe/cwe-238) | Improper Handling of Incomplete Structural Elements |
| Child | [CWE-239](https://radicalnotion.ai/cwe/cwe-239) | Failure to Handle Incomplete Element |
| Child | [CWE-240](https://radicalnotion.ai/cwe/cwe-240) | Improper Handling of Inconsistent Structural Elements |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Element Problems | - | - |

## Frequently asked questions

### What is CWE-237?

The product does not handle or incorrectly handles inputs that are related to complex structures.

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

11 recorded CVEs are attributed to CWE-237, including CVE-2019-1000007, CVE-2022-50286 and CVE-2023-34429.

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

Exploiting CWE-237 can lead to: Unexpected State.

### Is CWE-237 actively exploited?

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

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

---

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