Skip to content
OpenAdvisories

Weakness (CWE)

CWE-404: Improper Resource Shutdown or Release

Class Draft

The product does not release or incorrectly releases a resource before it is made available for re-use.

More detail

When a resource is created or allocated, the developer is responsible for properly releasing the resource as well as accounting for all potential paths of expiration or invalidation, such as a set period of time or revocation.

How to prevent it (4 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 memory in a function. If you allocate memory that you intend to free upon completion of the function, you must be sure to free the memory at all exit points for that function including error conditions.

  3. Implementation

    Memory should be allocated/freed using matching functions such as malloc/free, new/delete, and new[]/delete[].

  4. Implementation

    When releasing a complex object or structure, ensure that you properly dispose of all of its member components, not just the object itself.

Source: MITRE CWE-404

4 results · Clear filters · Feed

  • Critical 9.1

    Apache Nutch: Unauthenticated forced shutdown and job interruption in Nutch Server (Nutch REST API)

    Missing Authorization, Improper Resource Shutdown and Job Interruption vulnerability in Apache Nutch Server (Nutch REST API). This issue affects Apache Nutch: from 1.10 through 1.22. Users are recommended to upgrade to version 1.23, which removes the Nutch Se…

  • Critical 9.8

    sctp: close UDP tunnel sockets during netns teardown

    In the Linux kernel, the following vulnerability has been resolved: sctp: close UDP tunnel sockets during netns teardown proc_sctp_do_udp_port() starts per-net SCTP UDP tunneling sockets when net.sctp.udp_port is set, and stops/restarts them when the sysctl v…

  • Critical 9.1

    SeaCMS 12.9 has a file deletion vulnerability via admin_template.php.

  • Critical 9.8

    Session fixation vulnerability in Jenkins OpenID Plugin

    Jenkins OpenID Plugin 2.4 and earlier does not invalidate the previous session on login.