CWE-561
Weakness Allowed-with-ReviewDead Code
Abstraction: Base · Status: Draft
The product contains dead code, which can never be executed.
Technical nuance
As originally described in CWE before CWE 5.0, "dead code is code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed." This term might be defined differently by some users.
Mapping guidance
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities. However, the term "dead code" might have multiple interpretations.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Modes of introduction
Detection methods
Architecture or Design Review
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
Formal Methods / Correct-By-Construction
Cost effective for partial coverage:
Attack Modeling
Effectiveness: High
Automated Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Binary / Bytecode Quality Analysis
Compare binary / bytecode to application permission manifest
Effectiveness: High
Dynamic Analysis with Manual Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Automated Monitored Execution
Effectiveness: SOAR Partial
Automated Static Analysis
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Permission Manifest Analysis
Effectiveness: SOAR Partial
Automated Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Source Code Quality Analyzer
Cost effective for partial coverage:
Warning Flags
Source code Weakness Analyzer
Context-configured Source Code Weakness Analyzer
Effectiveness: High
Dynamic Analysis with Automated Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Web Application Scanner
Web Services Scanner
Database Scanners
Effectiveness: SOAR Partial
Manual Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Manual Source Code Review (not inspections)
Cost effective for partial coverage:
Focused Manual Spotcheck - Focused manual analysis of source
Effectiveness: High
Notes
Terminology
The CWE Team believes that there are multiple interpetations of "dead code" across stakeholders.
Maintenance · CWE 5.0 · 2026-10-28
After the release of CWE 5.0, the CWE Team plans to work with stakeholders to address the ambiguity of "dead code" phrase.
Content history
updated Potential_Mitigations, Time_of_Introduction
updated Description, Relationships, Other_Notes, Taxonomy_Mappings
updated Relationships, Taxonomy_Mappings
updated Demonstrative_Examples
updated Demonstrative_Examples
updated Common_Consequences, Other_Notes
updated Common_Consequences
updated Relationships, Taxonomy_Mappings
updated Common_Consequences, Relationships
updated Potential_Mitigations
updated Observed_Examples
updated Detection_Factors, Taxonomy_Mappings
updated Relationships, Taxonomy_Mappings
updated Common_Consequences, References, Relationships, Taxonomy_Mappings, Weakness_Ordinalities
updated Type
updated Applicable_Platforms, Observed_Examples, Relationships
updated Relationships
updated Relationships
updated Observed_Examples
updated Description
updated References, Relationships
updated Mapping_Notes
updated Demonstrative_Examples
updated Detection_Factors, References
updated Observed_Examples
updated Potential_Mitigations
updated Common_Consequences, Description, Mapping_Notes, References, Relationships, Technical_Nuance, Terminology_Notes
14 vulnerabilities reference this CWE, most recent first.
GHSA-783R-WG7H-79GM
Vulnerability from github – Published: 2024-04-16 09:30 – Updated: 2024-04-16 09:30In huge memory get unmapped area check, code can never be reached because of a logical contradiction.
{
"affected": [],
"aliases": [
"CVE-2024-32634"
],
"database_specific": {
"cwe_ids": [
"CWE-561"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-16T09:15:08Z",
"severity": "MODERATE"
},
"details": "In huge memory get unmapped area check, code can never be reached because of a logical contradiction. ",
"id": "GHSA-783r-wg7h-79gm",
"modified": "2024-04-16T09:30:33Z",
"published": "2024-04-16T09:30:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32634"
},
{
"type": "WEB",
"url": "https://www.asrmicro.com/en/goods/psirt?cid=38"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-GQ9R-PPV5-VM43
Vulnerability from github – Published: 2024-11-29 03:31 – Updated: 2024-12-06 06:30Dead Code vulnerability in ICONICS GENESIS64 Version 10.97.2, 10.97.2 CFR1, 10.97.2 CRF2 and 10.97.3 and Mitsubishi Electric GENESIS64 Version 10.97.2, 10.97.2 CFR1, 10.97.2 CRF2 and 10.97.3 allows a local authenticated attacker to execute a malicious code by tampering with a specially crafted DLL. This could lead to disclose, tamper with, destroy, or delete information in the affected products, or cause a denial of service (DoS) condition on the products.
{
"affected": [],
"aliases": [
"CVE-2024-8300"
],
"database_specific": {
"cwe_ids": [
"CWE-561"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-11-28T23:15:04Z",
"severity": "HIGH"
},
"details": "Dead Code vulnerability in ICONICS GENESIS64 Version 10.97.2, 10.97.2 CFR1, 10.97.2 CRF2 and 10.97.3 and Mitsubishi Electric GENESIS64 Version 10.97.2, 10.97.2 CFR1, 10.97.2 CRF2 and 10.97.3 allows a local authenticated attacker to execute a malicious code by tampering with a specially crafted DLL. This could lead to disclose, tamper with, destroy, or delete information in the affected products, or cause a denial of service (DoS) condition on the products.",
"id": "GHSA-gq9r-ppv5-vm43",
"modified": "2024-12-06T06:30:57Z",
"published": "2024-11-29T03:31:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-8300"
},
{
"type": "WEB",
"url": "https://jvn.jp/vu/JVNVU93891820"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/news-events/ics-advisories/icsa-24-338-04"
},
{
"type": "WEB",
"url": "https://www.mitsubishielectric.com/en/psirt/vulnerability/pdf/2024-010_en.pdf"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-QH57-GGQ7-34MF
Vulnerability from github – Published: 2025-09-19 21:31 – Updated: 2025-10-03 00:31Vasion Print (formerly PrinterLogic) Virtual Appliance Host versions prior to 22.0.843 and Application prior to 20.0.1923 (VA and SaaS deployments) contains dangerous PHP dead code present in multiple Docker-hosted PHP instances. A script named /var/www/app/resetroot.php (found in several containers) lacks authentication checks and, when executed, performs a SQL update that sets the database administrator username to 'root' and its password hash to the SHA-512 hash of the string 'password'. Separately, commented-out code in /var/www/app/lib/common/oses.php would unserialize session data (unserialize($_SESSION['osdata']))—a pattern that can enable remote code execution if re-enabled or reached with attacker-controlled serialized data. An attacker able to reach the resetroot.php endpoint can trivially reset the MySQL root password and obtain full database control; combined with deserialization issues this can lead to full remote code execution and system compromise.
{
"affected": [],
"aliases": [
"CVE-2025-34205"
],
"database_specific": {
"cwe_ids": [
"CWE-561"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-09-19T19:15:41Z",
"severity": "CRITICAL"
},
"details": "Vasion Print (formerly PrinterLogic) Virtual Appliance Host versions prior to 22.0.843 and\u00a0Application prior to 20.0.1923 (VA and SaaS deployments) contains dangerous PHP dead code present in multiple Docker-hosted PHP instances. A script named /var/www/app/resetroot.php (found in several containers) lacks authentication checks and, when executed, performs a SQL update that sets the database administrator username to \u0027root\u0027 and its password hash to the SHA-512 hash of the string \u0027password\u0027. Separately, commented-out code in /var/www/app/lib/common/oses.php would unserialize session data (unserialize($_SESSION[\u0027osdata\u0027]))\u2014a pattern that can enable remote code execution if re-enabled or reached with attacker-controlled serialized data. An attacker able to reach the resetroot.php endpoint can trivially reset the MySQL root password and obtain full database control; combined with deserialization issues this can lead to full remote code execution and system compromise.",
"id": "GHSA-qh57-ggq7-34mf",
"modified": "2025-10-03T00:31:01Z",
"published": "2025-09-19T21:31:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-34205"
},
{
"type": "WEB",
"url": "https://help.printerlogic.com/saas/Print/Security/Security-Bulletins.htm"
},
{
"type": "WEB",
"url": "https://help.printerlogic.com/va/Print/Security/Security-Bulletins.htm"
},
{
"type": "WEB",
"url": "https://pierrekim.github.io/blog/2025-04-08-vasion-printerlogic-83-vulnerabilities.html#va-dead-code"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/vasion-print-printerlogic-dangerous-php-dead-code-enables-rce"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-W95Q-JVF4-8FVP
Vulnerability from github – Published: 2026-05-21 09:32 – Updated: 2026-05-21 09:32A dead bounds check in the Spotlight RPC unmarshaller in Netatalk 3.0.0 through 4.4.2 results in an unreachable code path that provides no effective bounds protection, which may allow a remote authenticated attacker to obtain limited information via crafted Spotlight RPC requests.
{
"affected": [],
"aliases": [
"CVE-2026-44057"
],
"database_specific": {
"cwe_ids": [
"CWE-561"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-05-21T09:16:27Z",
"severity": "LOW"
},
"details": "A dead bounds check in the Spotlight RPC unmarshaller in Netatalk 3.0.0 through 4.4.2 results in an unreachable code path that provides no effective bounds protection, which may allow a remote authenticated attacker to obtain limited information via crafted Spotlight RPC requests.",
"id": "GHSA-w95q-jvf4-8fvp",
"modified": "2026-05-21T09:32:12Z",
"published": "2026-05-21T09:32:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44057"
},
{
"type": "WEB",
"url": "https://netatalk.io/security/CVE-2026-44057"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
Mitigation
Remove dead code before deploying the application.
No CAPEC attack patterns related to this CWE.