目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CWE-561 死代码 类漏洞列表 7

CWE-561 死代码 类弱点 7 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-561 指死代码漏洞,即程序中永远无法执行的代码段。虽然攻击者通常无法直接利用死代码进行远程攻击,但其存在会增加代码复杂度,可能掩盖恶意逻辑或导致维护混乱,间接影响系统安全性。开发者应通过静态分析工具定期扫描并移除未使用的代码,保持代码库精简,从而降低潜在的安全风险和维护成本。

MITRE CWE 官方描述
CWE:CWE-561 Dead Code(死代码) 英文:The product contains dead code, which can never be executed.(该产品包含死代码,这些代码永远无法被执行。) 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.(Dead Code(死代码)是指在运行中的程序里永远无法被执行的代码。周围的代码使得某段代码永远不可能被执行。)
常见影响 (2)
OtherQuality Degradation
Dead code that results from code that can never be executed is an indication of problems with the source code that needs to be fixed and is an indication of poor quality.
OtherReduce Maintainability
缓解措施 (1)
ImplementationRemove dead code before deploying the application.
代码示例 (2)
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.
String s = null; if (b) { s = "Yes"; return; } if (s != null) { Dead(); }
Bad · C++
In the following class, two private methods call each other, but since neither one is ever invoked from anywhere else, they are both dead code.
public class DoubleDead { private void doTweedledee() { doTweedledumb(); } private void doTweedledumb() { doTweedledee(); } public static void main(String[] args) { System.out.println("running DoubleDead"); } }
Bad · Java
CVE ID标题CVSS风险等级Published
CVE-2025-34205 Vasion Print和Vasion Print Virtual Appliance Host 安全漏洞 — Print Virtual Appliance Host 9.8 -2025-09-19
CVE-2024-8300 ICONICS GENESIS64 安全漏洞 — GENESIS64 7.0 High2024-11-28
CVE-2024-32634 Asrmicro ASR Series 安全漏洞 — Falcon 6.1 Medium2024-04-16
CVE-2022-33726 SAMSUNG Mobile devices 安全漏洞 — Samsung Mobile Devices 3.3 Low2022-08-05
CVE-2022-33685 SAMSUNG Mobile devices 安全漏洞 — Samsung Mobile Devices 4.0 Medium2022-07-11
CVE-2022-30748 Samsung Members 安全漏洞 — Samsung Members 4.0 Medium2022-06-07
CVE-2021-25398 Bixby Voice 安全漏洞 — Bixby Voice 3.3 -2021-06-11

CWE-561(死代码) 是常见的弱点类别,本平台收录该类弱点关联的 7 条 CVE 漏洞。