---
title: "CWE-1164: Irrelevant Code"
url: https://radicalnotion.ai/cwe/cwe-1164
type: cwe
description: "The product contains code that is not essential for execution, i.e., makes no state changes and has no side effects that alter data or control flow - or is unreachable under any circumstances - such that removal of the code would have no impact to intended functionality or correctness."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1164: Irrelevant Code

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

## Description

The product contains code that is not essential for execution, i.e., makes no state changes and has no side effects that alter data or control flow - or is unreachable under any circumstances - such that removal of the code would have no impact to intended functionality or correctness.

Irrelevant code could include dead code, initialization that is not used, empty blocks, code that could be entirely removed due to optimization, etc.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Reduce Reliability | - |
| Other | Reduce Performance | - |

## 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 condition for the second if statement is impossible to satisfy. It requires that the variables be non-null. However, on the only path where s can be assigned a non-null value, there is a return statement.

Bad code:

```c++
String s = null;
if (b) {
    s = "Yes";
    return;
}

if (s != null) {
    Dead();
}
```

### Example 2

The following code excerpt assigns to the variable r and then overwrites the value without using it.

Bad code:

```c
r = getName();
r = getNewBuffer(buf);
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2014-1266 | Chain: incorrect "goto" in Apple SSL product bypasses certificate validation, allowing Adversary-in-the-Middle (AITM) attack (Apple "goto fail" bug). CWE-705 (Incorrect Control Flow Scoping) -\> CWE-561 (Dead Code) -\> CWE-295 (Improper Certificate Validation) -\> CWE-393 (Return of Wrong Status Code) -\> CWE-300 (Channel Accessible by Non-Endpoint). The code's whitespace indentation did not reflect the actual control flow (CWE-1114) and did not explicitly delimit the block (CWE-483), which could have made it more difficult for human code auditors to detect the vulnerability. |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-38620 | Bluetooth: HCI: Remove HCI\_AMP support | high | 8.8 | - | No | 2024-06-20 |
| CVE-2026-53356 | drm/i915/gem: Fix phys BO pread/pwrite with offset | high | 7.8 | - | No | 2026-07-01 |
| CVE-2023-52656 | io\_uring: drop any code related to SCM\_RIGHTS | high | 7.8 | - | No | 2024-05-13 |
| CVE-2025-40769 | The affected application uses a Content Security Policy that allows unsafe script execution methods. This could allow an attacker to execute unauthorized scripts, potentially leading to cross-site scripting attacks. | high | 7.5 | - | No | 2025-08-12 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-710](https://radicalnotion.ai/cwe/cwe-710) | Improper Adherence to Coding Standards |
| Child | [CWE-110](https://radicalnotion.ai/cwe/cwe-110) | Struts: Validator Without Form Field |
| Child | [CWE-561](https://radicalnotion.ai/cwe/cwe-561) | Dead Code |
| Child | [CWE-563](https://radicalnotion.ai/cwe/cwe-563) | Assignment to Variable without Use |
| Child | [CWE-1071](https://radicalnotion.ai/cwe/cwe-1071) | Empty Code Block |

## Frequently asked questions

### What is CWE-1164?

The product contains code that is not essential for execution, i.e., makes no state changes and has no side effects that alter data or control flow - or is unreachable under any circumstances - such that removal of the code would have no impact to intended functionality or correctness.

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

4 recorded CVEs are attributed to CWE-1164, including CVE-2024-38620, CVE-2026-53356 and CVE-2023-52656.

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

Exploiting CWE-1164 can lead to: Reduce Reliability, Reduce Performance.

### Is CWE-1164 actively exploited?

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

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

---

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