Skip to content
OpenAdvisories

Weakness (CWE)

CWE-772: Missing Release of Resource after Effective Lifetime

Base Draft

The product does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.

How to prevent it (3 mitigations)
  1. 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.

  2. 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.

  3. 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).

Source: MITRE CWE-772

12 results · Clear filters · Feed

  • Low 3.3

    Podman: goroutine/file-descriptor leak in storage/pkg/archive.applylayer and applyuncompressedlayer on malformed layers

    storage/pkg/archive.ApplyLayer and ApplyUncompressedLayer may, when processing corrupt or malicious inputs, leak a file descriptor; unbounded repeated calls can exhaust the process’ file descriptor limit

  • Low 3.7

    Denial of Service via sending bogus X.509 certificates

    Libreswan in FIPS mode has a vulnerability where badly formed received certificates are rejected, but not deleted from the NSS cache. As a result, any real certificates with the same serial number are rejected as well. This can be abused to lock out legitimat…

  • Low 3.7

    Socket file-descriptor leak in UpdateHub OTA client start_coap_client() leading to resource-exhaustion DoS

    The UpdateHub over-the-air update client's start_coap_client() in subsys/mgmt/updatehub/updatehub.c leaks the CoAP/DTLS socket descriptor on its connection-setup failure paths. The shared error: cleanup gated socket closing on a ret > 0 flag, but ret was set …

  • Low 3.7

    Degradation of resolution service from improperly accounted client-terminated DNS-over-QUIC queries

    In NLnet Labs Unbound 1.22.0 up to and including 1.25.1, client terminated DNS-over-QUIC (DoQ) queries are not accounted properly by Unbound resulting in low-cost inflation of the waiting number of replies for already in-flight resolution queries. This result…

  • Low 2.3

    Wasmtime: Leak in WASIp1 `fd_renumber` implementation

    Wasmtime is a runtime for WebAssembly. All versions prior to 24.0.10; versions 25.0.0 through those before 36.0.11; versions 37.0.0 through those before 44.0.3; and versions 45.0.0 and 45.0.1 contain a native implementation of WASIp1 which suffers from a leak…

  • Low 2.1

    OpenTelemetry-Go's Schema ParseFile leaks file descriptors on each parse

    OpenTelemetry-Go is the Go implementation of OpenTelemetry. Prior to version 0.0.17, `go.opentelemetry.io/otel/schema/v1.0` and `go.opentelemetry.io/otel/schema/v1.1` leaks one file descriptor on each successful `ParseFile` call. `ParseFile` opens the schema …

  • Low 2.4

    Missing Release of Resource after Effective Lifetime (CWE-772) in the T21 Reader allows an attacker with physical acces…

  • Low 1.0

    Wasmtime has memory leak in C API with `externref` and `anyref` types

    Wasmtime is a runtime for WebAssembly. Wasmtime 37.0.0 and 37.0.1 have memory leaks in the C/C++ API when using bindings for the `anyref` or `externref` WebAssembly values. This is caused by a regression introduced during the development of 37.0.0 and all pri…

  • Low 3.2

    In AMD Versal Adaptive SoC devices, the incorrect configuration of the SSS during runtime (post-boot) cryptographic ope…

  • Low 2.3

    Connection pool exhaustion in hackney

    Hackney fails to properly release HTTP connections to the pool after handling 307 Temporary Redirect responses. Remote attackers can exploit this to exhaust connection pools, causing denial of service in applications using the library. Fix for this issue has …

  • Low 2.9

    Liteos-A has a missing release of resource vulnerability

    in OpenHarmony v3.2.2 and prior versions allow a local attacker cause DOS through occupy all resources

  • Low 2.0

    Various memory and file descriptor leaks in apt-python

    Various memory and file descriptor leaks were found in apt-python files python/arfile.cc, python/tag.cc, python/tarfile.cc, aka GHSL-2020-170. This issue affects: python-apt 1.1.0~beta1 versions prior to 1.1.0~beta1ubuntu0.16.04.10; 1.6.5ubuntu0 versions prio…