CWE-1164: Irrelevant Code
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, such that removal of the code would have no impact to functionality or correctness.
Last updated
Overview
Irrelevant code could include dead code, initialization that is not used, empty blocks, code that could be entirely removed due to optimization, etc.
Real-world CVEs
2 recorded CVEs are caused by CWE-1164 (Irrelevant Code). The highest-severity and most recent are shown first. 1 new CWE-1164 CVE has been recorded so far in 2026 (1 in 2025).
Common consequences
What can happen when CWE-1164 is exploited.
Reduce Reliability
Affects: Other
Reduce Performance
Affects: Other
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to detect it
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.)
Code examples
MITRE examples of the weakness in code.
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.
Vulnerable example
String s = null;
s = "Yes";
Dead();The following code excerpt assigns to the variable r and then overwrites the value without using it.
Vulnerable example
r = getName();Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- 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.
Frequently asked questions
Common questions about CWE-1164.
- 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, such that removal of the code would have no impact to functionality or correctness.
- What CVEs are caused by CWE-1164?
- 2 recorded CVEs are attributed to CWE-1164, including CVE-2026-53356 and CVE-2025-40769.
- 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?
- 2 recorded CVEs are caused by CWE-1164; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-1164) (opens in a new tab)
- CWE-1164 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-1164 CVEs
Get an alert when a new CWE-1164 CVE affects your products, with AI-written analysis and remediation steps.