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

目标: 1000 元 · 已筹: 1336

100%

CWE-772 对已超过有效生命周期的资源丧失索引 类漏洞列表 65

CWE-772 对已超过有效生命周期的资源丧失索引 类弱点 65 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-772属于资源管理缺陷,指程序在资源不再需要时未正确释放。攻击者常通过频繁创建资源耗尽系统内存或句柄,导致拒绝服务或系统崩溃。开发者应确保在资源生命周期结束时执行清理操作,使用RAII机制或显式调用释放函数,并加强代码审查以预防资源泄漏,从而保障系统稳定性。

MITRE CWE 官方描述
CWE:CWE-772 Missing Release of Resource after Effective Lifetime(有效生命周期结束后未释放资源) 英文:The product does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
常见影响 (1)
AvailabilityDoS: Resource Consumption (Other), DoS: Resource Consumption (Memory), DoS: Resource Consumption (CPU)
An attacker that can influence the allocation of resources that are not properly released could deplete the available resource pool and prevent all other processes from accessing the same type of resource. Frequently-affected resources include memory, CPU, disk space, power or battery, etc.
缓解措施 (3)
RequirementsUse a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, languages such as Java, Ruby, and Lisp perform automatic garbage collection that releases memory for objects that have been deallocated.
ImplementationIt is good practice to be responsible for freeing all resources you allocate and to be consistent with how and where you free resources in a function. If you allocate resources that you intend to free upon completion of the function, you must be sure to free the resources at all exit points for that function including error conditions.
Operation, Architecture and DesignUse resource-limiting settings provided by the operating system or environment. For example, when managing system resources in POSIX, setrlimit() can be used to set limits for certain types of resources, and getrlimit() can determine how many resources are available. However, these functions are not available on all operating systems. When the current levels get close to the maximum that is define…
代码示例 (2)
The following method never closes the new file handle. Given enough time, the Finalize() method for BufferReader should eventually call Close(), but there is no guarantee as to how long this action will take. In fact, there is no guarantee that Finalize() will ever be invoked. In a busy environment, the Operating System could use up all of the available file handles before the Close() function is …
private void processFile(string fName) { BufferReader fil = new BufferReader(new FileReader(fName)); String line; while ((line = fil.ReadLine()) != null) { processLine(line); } }
Bad · Java
private void processFile(string fName) { BufferReader fil = new BufferReader(new FileReader(fName)); String line; while ((line = fil.ReadLine()) != null) { processLine(line); } fil.Close(); }
Good · Java
The following code attempts to open a new connection to a database, process the results returned by the database, and close the allocated SqlConnection object.
SqlConnection conn = new SqlConnection(connString); SqlCommand cmd = new SqlCommand(queryString); cmd.Connection = conn; conn.Open(); SqlDataReader rdr = cmd.ExecuteReader(); HarvestResults(rdr); conn.Connection.Close();
Bad · C#
CVE ID标题CVSS风险等级Published
CVE-2021-21002 Phoenix Contact FL COMSERVER UNI 安全漏洞 — FL COMSERVER 7.5 High2021-06-25
CVE-2020-27351 Python-apt 安全漏洞 — python-apt 2.0 Low2020-12-10
CVE-2020-14339 Red Hat libvirt 安全漏洞 — libvirt 8.8 -2020-12-03
CVE-2019-3883 Red Hat 389 Directory Server 缓冲区错误漏洞 — 389-ds-base 7.5 -2019-04-17
CVE-2019-3821 Red Hat ceph 资源管理错误漏洞 — ceph 7.5 -2019-03-27

CWE-772(对已超过有效生命周期的资源丧失索引) 是常见的弱点类别,本平台收录该类弱点关联的 65 条 CVE 漏洞。