CWE-772: Missing Release of Resource after Effective Lifetime
BaseLikelihood of exploit: High
The product does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
Consequences
- Availability: DoS: Resource Consumption (Other), DoS: Resource Consumption (Memory), DoS: Resource Consumption (CPU)
How to prevent it
- Requirements: Use 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.
- Implementation: It 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 Design: Use 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 defined for the application (see CWE-770), then limit the allocation of further resources to privileged users; alternately, begin releasing resources for less-privileged users. While this mitigation may protect the system from attack, it will not necessarily stop attackers from adversely impacting other users. Ensure that the application performs the appropriate error checks and error handling in case resources become unavailable (CWE-703).
Recent advisories
- PYSEC-2026-4007 — vLLM through 0.29.0 contains a resource exhaustion vulnerability in MooncakeConnector where rejected prefill requests create ownerless transfer placeholders…
- GHSA-pmjh-fq2x-6v4x — undici vulnerable to Denial of Service via orphaned RetryHandler response body
- GHSA-3p27-qvp9-27qf — Wasmtime has a leak in WASIp1 `fd_renumber` implementation
- GHSA-fw38-pc54-jvx9 — Klever-Go KVM: Throttler slot leak in trie account-data sync causes epoch bootstrap / state sync DoS
- GHSA-vgwf-h737-ff37 — golang.org/x/crypto: Invoking client can cause server deadlock on unexpected responses
- GHSA-xxh7-fcf3-rj7f — The Eclipse Jetty Server Artifact has a Gzip request memory leak
- GHSA-xw98-5q62-jx94 — Traefik: tcp router clears read deadlines before tls forwarding, enabling stalled handshakes (Slowloris DOS)
- GHSA-9fm9-hp7p-53mf — Hackney fails to properly release HTTP connections to the pool
- GHSA-27mf-ghqm-j3j8 — aiohttp has a memory leak when middleware is enabled when requesting a resource with a non-allowed method
- CVE-2024-20481 — A vulnerability in the Remote Access VPN (RAVPN) service of Cisco Adaptive Security Appliance (ASA) Software and Cisco Firepower Threat Defense (FTD) Software…
- GHSA-8g85-whqh-cr2f — Traefik vulnerable to potential DDoS via ACME HTTPChallenge
- GHSA-69ch-w2m2-3vjp — golang.org/x/text/language Denial of service via crafted Accept-Language header
- GHSA-2632-h32j-6rg9 — Missing Release of Resource after Effective Lifetime in Jenkins
- GHSA-4822-jvwx-w47h — Uncontrolled Resource Consumption in Matrix Synapse
- GHSA-cg3q-j54f-5p7p — Uncontrolled Resource Consumption in promhttp
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor