---
title: "CWE-228: Improper Handling of Syntactically Invalid Structure"
url: https://radicalnotion.ai/cwe/cwe-228
type: cwe
description: "The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-228: Improper Handling of Syntactically Invalid Structure

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

## Description

The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity, Availability | Unexpected State, DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU) | If an input is syntactically invalid, then processing the input could place the system in an unexpected state that could lead to a crash, consume available system resources or other unintended behaviors. |

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

Effectiveness: High

## Demonstrative examples

### Example 1

This Android application has registered to handle a URL when sent an intent:

Bad code:

```java
...
IntentFilter filter = new IntentFilter("com.example.URLHandler.openURL");
MyReceiver receiver = new MyReceiver();
registerReceiver(receiver, filter);
...

public class UrlHandlerReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if("com.example.URLHandler.openURL".equals(intent.getAction())) {
            String URL = intent.getStringExtra("URLToOpen");
            int length = URL.length();

        ...
        }
    }
}
```

The application assumes the URL will always be included in the intent. When the URL is not present, the call to getStringExtra() will return null, thus causing a null pointer exception when length() is called.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2004-0270 | Anti-virus product has an assertion error when the line length is non-numeric. |

## Real CVEs with this weakness (sample of 12 of 25)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-87986 | - | critical | 10.0 | - | No | 2026-09-11 |
| CVE-2024-55594 | - | critical | 9.8 | - | No | 2025-03-14 |
| CVE-2023-42784 | - | critical | 9.8 | - | No | 2025-03-11 |
| CVE-2021-38443 | Eclipse CycloneDDS Improper Handling of Syntactically Invalid Structure | critical | 9.8 | - | No | 2022-05-05 |
| CVE-2020-27847 | Authentication Bypass in dex | critical | 9.8 | - | No | 2021-05-28 |
| CVE-2026-20125 | Cisco IOS Software and IOS XE Software Release 3E HTTP Server Denial of Service Vulnerability | high | 7.7 | - | No | 2026-03-25 |
| CVE-2026-34232 | Firebird: DoS via \`op\_response\` packet from client | high | 7.5 | - | No | 2026-04-17 |
| CVE-2025-22865 | ParsePKCS1PrivateKey panic with partial keys in crypto/x509 | high | 7.5 | - | No | 2025-01-28 |
| CVE-2025-0343 | CVE-2025-0343: Swift ASN.1 can crash when parsing maliciously formed BER/DER | high | 7.5 | - | No | 2025-01-15 |
| CVE-2024-6382 | Adversarial unsanitized input may cause MongoDB Rust Driver to issue unintended commands. | high | 7.5 | - | No | 2024-07-02 |
| CVE-2024-21612 | Junos OS Evolved: Specific TCP traffic causes OFP core and restart of RE | high | 7.5 | - | No | 2024-01-12 |
| CVE-2019-10691 | dovecot: Mishandling invalid UTF-8 characters by JSON encoder leading to possible DoS attack. | high | 7.5 | - | No | 2019-04-24 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-703](https://radicalnotion.ai/cwe/cwe-703) | Improper Check or Handling of Exceptional Conditions |
| Parent | [CWE-707](https://radicalnotion.ai/cwe/cwe-707) | Improper Neutralization |
| Child | [CWE-166](https://radicalnotion.ai/cwe/cwe-166) | Improper Handling of Missing Special Element |
| Child | [CWE-167](https://radicalnotion.ai/cwe/cwe-167) | Improper Handling of Additional Special Element |
| Child | [CWE-168](https://radicalnotion.ai/cwe/cwe-168) | Improper Handling of Inconsistent Special Elements |
| Child | [CWE-229](https://radicalnotion.ai/cwe/cwe-229) | Improper Handling of Values |
| Child | [CWE-233](https://radicalnotion.ai/cwe/cwe-233) | Improper Handling of Parameters |
| Child | [CWE-237](https://radicalnotion.ai/cwe/cwe-237) | Improper Handling of Structural Elements |
| Child | [CWE-241](https://radicalnotion.ai/cwe/cwe-241) | Improper Handling of Unexpected Data Type |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Structure and Validity Problems | - | - |
| OWASP Top Ten 2004 | Improper Error Handling | A7 | CWE More Specific |

## Frequently asked questions

### What is CWE-228?

The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification.

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

25 recorded CVEs are attributed to CWE-228, including CVE-2026-87986, CVE-2024-55594 and CVE-2023-42784.

### Is CWE-228 part of the OWASP Top 10?

CWE-228 maps to OWASP Top Ten 2004: Improper Error Handling (A7) in the OWASP security taxonomy.

### How is CWE-228 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-228?

Exploiting CWE-228 can lead to: Unexpected State, DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU).

### Is CWE-228 actively exploited?

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

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

---

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