ClassDraft

CWE-404Improper Resource Shutdown or Release

Category: logic

Description

The product does not release or incorrectly releases a resource before it is made available for re-use. 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.

Common consequences· 2

  • Availability / Other — DoS: Resource Consumption (Other), Varies by Context
    Most unreleased resource issues result in general software reliability problems, but if an attacker can intentionally trigger a resource leak, the attacker might be able to launch a denial of service attack by depleting the resource pool.
  • Confidentiality — Read Application Data
    When a resource containing sensitive information is not correctly shutdown, it may expose the sensitive data in a subsequent allocation.

Potential mitigations· 4

  • [Requirements]
  • [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.
  • [Implementation]Memory should be allocated/freed using matching functions such as malloc/free, new/delete, and new[]/delete[].
  • [Implementation]When releasing a complex object or structure, ensure that you properly dispose of all of its member components, not just the object itself.

Related CAPEC attack patterns· 7

CAPEC-125CAPEC-130CAPEC-131CAPEC-494CAPEC-495CAPEC-496CAPEC-666

References

  1. https://cwe.mitre.org/data/definitions/404.html

Exploits (incoming)7

TypeTargetConfidenceTier
AttackPatternExcessive Allocationcapec-130100%live
AttackPatternResource Leak Exposurecapec-131100%live
AttackPatternICMP Fragmentationcapec-496100%live
AttackPatternTCP Fragmentationcapec-494100%live
AttackPatternUDP Fragmentationcapec-495100%live
AttackPatternBlueSmackingcapec-666100%live
AttackPatternFloodingcapec-125100%live

Compliance frameworks addressing this (incoming)1

TypeTargetConfidenceTier
ComplianceControlnist_csf-rc100%live

(incoming)9

TypeTargetConfidenceTier
VulnerabilityCVE-2025-5867cve-2025-58670%live
VulnerabilityCVE-2026-1173cve-2026-11730%live
VulnerabilityCVE-2026-2957cve-2026-29570%live
KEVEntryMicrosoft Win32k Privilege Escalation Vulnerabilitykev-cve-2018-81200%live
KEVEntryMicrosoft DirectX Graphics Kernel Privilege Escalation Vulnerabilitykev-cve-2018-84050%live
KEVEntryMicrosoft DirectX Graphics Kernel Privilege Escalation Vulnerabilitykev-cve-2018-84060%live
KEVEntryMicrosoft Win32k Privilege Escalation Vulnerabilitykev-cve-2018-84530%live
KEVEntryMicrosoft Windows Kernel Privilege Escalation Vulnerabilitykev-cve-2018-86110%live
KEVEntryMicrosoft Windows Win32k Improper Resource Shutdown or Release Vulnerabilitykev-cve-2018-86390%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Operation on a Resource after Expiration or Release
CWE
Missing Release of Resource after Effective Lifetime
CWE
Missing Release of Memory after Effective Lifetime
CWE
Missing Reference to Active Allocated Resource
CWE
Improper Locking
CWE
Improper Control of a Resource Through its Lifetime
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.