CWE-826: Premature Release of Resource During Expected Lifetime
The product releases a resource that is still intended to be used by itself or another actor.
Last updated
Overview
This weakness focuses on errors in which the product should not release a resource, but performs the release anyway. This is different than a weakness in which the product releases a resource at the appropriate time, but it maintains a reference to the resource, which it later accesses. For this weakness, the resource should still be valid upon the subsequent access. When a product releases a resource that is still being used, it is possible that operations will still be taken on this resource, which may have been repurposed in the meantime, leading to issues similar to CWE-825. Consequences may include denial of service, information exposure, or code execution.
Real-world CVEs
7 recorded CVEs are caused by CWE-826 (Premature Release of Resource During Expected Lifetime). The highest-severity and most recent are shown first. 3 new CWE-826 CVEs have been recorded so far in 2026 (2 in 2025).
- CVE-2026-31663
xfrm: hold dev ref until after transport_finish NF_HOOK
Critical · CVSS 9.2 · EPSS 11th2026-04-24 - CVE-2026-53322
vfio/pci: Clean up DMABUFs before disabling function
High · CVSS 8.8 · EPSS 8th2026-06-26 - CVE-2026-45984
gfs2: Fix use-after-free in iomap inline data write path
High · CVSS 7.8 · EPSS 23th2026-05-27 - CVE-2023-1297High · CVSS 7.5 · EPSS 51th2023-06-02
- CVE-2024-51727High · CVSS 7.1 · EPSS 40th2024-12-06
- CVE-2024-58249Low · CVSS 3.7 · EPSS 37th2025-04-16
- CVE-2025-24912Low · CVSS 3.7 · EPSS 50th2025-03-12
Common consequences
What can happen when CWE-826 is exploited.
Read Application Data, Read Memory
Affects: Confidentiality
If the released resource is subsequently reused or reallocated, then a read operation on the original resource might access sensitive data that is associated with a different user or entity.
DoS: Crash, Exit, or Restart
Affects: Availability
When the resource is released, the software might modify some of its structure, or close associated channels (such as a file descriptor). When the software later accesses the resource as if it is valid, the resource might not be in an expected state, leading to resultant errors that may lead to a crash.
Execute Unauthorized Code or Commands, Modify Application Data, Modify Memory
Affects: Integrity, Confidentiality, Availability
When the resource is released, the software might modify some of its structure. This might affect logic in the sections of code that still assume the resource is active. If the released resource is related to memory and is used in a function call, or points to unexpected data in a write operation, then code execution may be possible upon subsequent accesses.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2009-3547 — Chain: race condition (CWE-362) might allow resource to be released before operating on it, leading to NULL dereference (CWE-476)
Frequently asked questions
Common questions about CWE-826.
- What is CWE-826?
- The product releases a resource that is still intended to be used by itself or another actor.
- What CVEs are caused by CWE-826?
- 7 recorded CVEs are attributed to CWE-826, including CVE-2026-31663, CVE-2026-53322, CVE-2026-45984.
- How is CWE-826 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-826?
- Exploiting CWE-826 can lead to: Read Application Data, Read Memory, DoS: Crash, Exit, or Restart, Execute Unauthorized Code or Commands, Modify Application Data, Modify Memory.
- Is CWE-826 actively exploited?
- 7 recorded CVEs are caused by CWE-826; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-826) (opens in a new tab)
- CWE-826 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-826
Get alerted the moment a new CWE-826 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.