CWE-825: Expired Pointer Dereference
Also known as: Dangling pointer
The product dereferences a pointer that contains a location for memory that was previously valid, but is no longer valid.
Last updated
Overview
When a product releases memory, but it maintains a pointer to that memory, then the memory might be re-allocated at a later time. If the original pointer is accessed to read or write data, then this could cause the product to read or modify data that is in use by a different function or process. Depending on how the newly-allocated memory is used, this could lead to a denial of service, information exposure, or code execution.
Real-world CVEs
59 recorded CVEs are caused by CWE-825 (Expired Pointer Dereference). The highest-severity and most recent are shown first. 39 new CWE-825 CVEs have been recorded so far in 2026 (9 in 2025).
- CVE-2026-53175
inet: frags: fix use-after-free caused by the fqdir_pre_exit() flush
Critical · CVSS 9.8 · EPSS 24th2026-06-25 - CVE-2026-53006
ipv6: fix possible UAF in icmpv6_rcv()
Critical · CVSS 9.8 · EPSS 34th2026-06-24 - CVE-2026-52924
sctp: purge outqueue on stale COOKIE-ECHO handling
Critical · CVSS 9.8 · EPSS 52th2026-06-24 - CVE-2026-45972
smb: client: fix potential UAF and double free in smb2_open_file()
Critical · CVSS 9.8 · EPSS 26th2026-05-27 - CVE-2024-23310Critical · CVSS 9.8 · EPSS 77th2024-02-20
- CVE-2023-48698
Azure RTOS USBX Remote Code Execution Vulnerability
Critical · CVSS 9.8 · EPSS 61th2023-12-05 - CVE-2023-48697
Azure RTOS USBX Remote Code Execution Vulnerability
Critical · CVSS 9.8 · EPSS 68th2023-12-05 - CVE-2025-49794
Libxml: heap use after free (uaf) leads to denial of service (dos)
Critical · CVSS 9.1 · EPSS 58th2025-06-16 - CVE-2026-58592
Ladybird - Web-Reachable Code Execution via Dangling FunctionType Reference in WebAssembly ESM Integration
High · CVSS 8.9 · EPSS 46th2026-07-01 - CVE-2026-52952
iommu: Fix WARN_ON in __iommu_group_set_domain_nofail() due to reset
High · CVSS 8.8 · EPSS 7th2026-06-24 - CVE-2026-46166
wifi: mac80211: use safe list iteration in radar detect work
High · CVSS 8.8 · EPSS 10th2026-05-28 - CVE-2026-46125
wifi: mac80211: remove station if connection prep fails
High · CVSS 8.8 · EPSS 23th2026-05-28
Showing 12 of 59 recorded CWE-825 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsCommon consequences
What can happen when CWE-825 is exploited.
Read Memory
Affects: Confidentiality
If the expired pointer is used in a read operation, an attacker might be able to control data read in by the application.
DoS: Crash, Exit, or Restart
Affects: Availability
If the expired pointer references a memory location that is not accessible to the product, or points to a location that is "malformed" (such as NULL) or larger than expected by a read or write operation, then a crash may occur.
Execute Unauthorized Code or Commands
Affects: Integrity, Confidentiality, Availability
If the expired pointer is used in a function call, or points to unexpected data in a write operation, then code execution may be possible.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages
How to prevent it
Practical mitigations for CWE-825, grouped by where in the lifecycle they apply.
Choose a language that provides automatic memory management.
When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.
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.)
Automated Dynamic Analysis
Use tools that are integrated during compilation to insert runtime error-checking mechanisms related to memory safety errors, such as AddressSanitizer (ASan) for C/C++ [1].
Effectiveness: Moderate
Code examples
MITRE examples of the weakness in code.
The following code shows a simple example of a use after free error:
Vulnerable example
char* ptr = (char*)malloc (SIZE);
abrt = 1;
logError("operation aborted before commit", ptr);When an error occurs, the pointer is immediately freed. However, this pointer is later incorrectly used in the logError function.
The following code shows a simple example of a double free error:
Vulnerable example
char* ptr = (char*)malloc (SIZE);
free(ptr);Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2023-26463 — Chain: IPSec VPN product uses the same variable for multiple purposes in the same function (CWE-1109), leading to incorrect access control (CWE-284) and expired pointer dereference (CWE-825)
- CVE-2008-5013 — access of expired memory address leads to arbitrary code execution
- CVE-2010-3257 — stale pointer issue leads to denial of service and possibly other consequences
- CVE-2008-0062 — Chain: a message having an unknown message type may cause a reference to uninitialized memory resulting in a null pointer dereference (CWE-476) or dangling pointer (CWE-825), possibly crashing the system or causing heap corruption.
- CVE-2007-1211 — read of value at an offset into a structure after the offset is no longer valid
Terminology & mappings
Alternate terms
- Dangling pointer
Frequently asked questions
Common questions about CWE-825.
- What is CWE-825?
- The product dereferences a pointer that contains a location for memory that was previously valid, but is no longer valid.
- What CVEs are caused by CWE-825?
- 59 recorded CVEs are attributed to CWE-825, including CVE-2026-53175, CVE-2026-53006 and CVE-2026-52924.
- How do you prevent CWE-825?
- Choose a language that provides automatic memory management.
- How is CWE-825 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-825?
- Exploiting CWE-825 can lead to: Read Memory, DoS: Crash, Exit, or Restart, Execute Unauthorized Code or Commands.
- Is CWE-825 actively exploited?
- 59 recorded CVEs are caused by CWE-825; none are currently in CISA's KEV catalog of actively exploited flaws.
Sources
References
- MITRE CWE definition (CWE-825) (opens in a new tab)
- CWE-825 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.
Track CWE-825 CVEs
Get an alert when a new CWE-825 CVE affects your products, with AI-written analysis and remediation steps.