CWEweakness
CWE-416 Use After Free
High
Official page ↗
- Alternate terms
- Dangling pointer, UAF, Use-After-Free
- Abstraction
- Variant
- Structure
- Simple
- Status
- Stable
- Likelihood of exploit
- High
- Languages
- C, C++, Memory-Unsafe
- CWE version
- 5.0
Description
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Common consequences
• Integrity: Modify Memory — The use of previously freed memory may corrupt valid data, if the memory area in question has been allocated and used properly elsewhere.
• Availability: DoS: Crash, Exit, or Restart — If chunk consolidation occurs after the use of previously freed data, the process may crash when invalid data is used as chunk information.
• Confidentiality: Read Memory — Read operations on freed memory can sometimes leak sensitive information instead of causing a crash
• Integrity, Confidentiality, Availability: Execute Unauthorized Code or Commands — If malicious data is entered before chunk consolidation can take place, it may be possible to take advantage of a write-what-where primitive to execute arbitrary code. If the newly allocated data happens to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.
Potential mitigations
• [Architecture and Design] Choose a language that provides automatic memory management.
• [Implementation] 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.
Detection methods
• Fuzzing: Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.
• 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++ [REF-1518].
Observed examples
• CVE-2023-38160: TCP/IP code for an OS has a use-after-free that can leak heap memory contents
• CVE-2023-5447: Chain: missing lock check (CWE-414) leads to Use-After-Free (CWE-416)
• CVE-2022-20141: Chain: an operating system kernel has insufficient resource locking (CWE-413) leading to a use after free (CWE-416).
• CVE-2022-2621: Chain: two threads in a web browser use the same resource (CWE-366), but one of those threads can destroy the resource before the other has completed (CWE-416).
• CVE-2021-0920: Chain: mobile platform race condition (CWE-362) leading to use-after-free (CWE-416), as exploited in the wild per CISA KEV.
• CVE-2020-6819: Chain: race condition (CWE-362) leads to use-after-free (CWE-416), as exploited in the wild per CISA KEV.
• CVE-2010-4168: Use-after-free triggered by closing a connection while data is still being transmitted.
• CVE-2010-2941: Improper allocation for invalid data leads to use-after-free.
• CVE-2010-2547: certificate with a large number of Subject Alternate Names not properly handled in realloc, leading to use-after-free
• CVE-2010-1772: Timers are not disabled when a related object is deleted
• CVE-2010-1437: Access to a "dead" object that is being cleaned up
• CVE-2010-1208: object is deleted even with a non-zero reference count, and later accessed
• CVE-2010-0629: use-after-free involving request containing an invalid version number
• CVE-2010-0378: unload of an object that is currently being accessed by other functionality
• CVE-2010-0302: incorrectly tracking a reference count leads to use-after-free
• CVE-2010-0249: use-after-free related to use of uninitialized memory
• CVE-2010-0050: HTML document with incorrectly-nested tags
• CVE-2009-3658: Use after free in ActiveX object by providing a malformed argument to a method
• CVE-2009-3616: use-after-free by disconnecting during data transfer, or a message containing incorrect data types
• CVE-2009-3553: disconnect during a large data transfer causes incorrect reference count, leading to use-after-free
• CVE-2009-2416: use-after-free found by fuzzing
• CVE-2009-1837: Chain: race condition (CWE-362) from improper handling of a page transition in web client while an applet is loading (CWE-368) leads to use after free (CWE-416)
• CVE-2009-0749: realloc generates new buffer and pointer, but previous pointer is still retained, leading to use after free
• CVE-2010-3328: Use-after-free in web browser, probably resultant from not initializing memory.
• CVE-2008-5038: use-after-free when one thread accessed memory that was freed by another thread
• CVE-2008-0077: assignment of malformed values to certain properties triggers use after free
• CVE-2006-4434: mail server does not properly handle a long header.
• CVE-2010-2753: Chain: integer overflow leads to use-after-free
• CVE-2006-4997: freed pointer dereference
• CVE-2003-0813: Chain: A multi-threaded race condition (CWE-367) allows attackers to cause two threads to process the same RPC request, which causes a use-after-free (CWE-416) in one thread
Related
Observed example · CVE (30)
- CVE-2023-5447 Missing lock check in SynHsaService may create a use-after-free condition which causes abnormal termination of the service, resulting in… vulnerability
- CVE-2023-38160 Windows TCP/IP Information Disclosure Vulnerability vulnerability
- CVE-2022-2621 Use after free in Extensions in Google Chrome prior to 104.0.5112.79 allowed an attacker who convinced a user to install a malicious… vulnerability
- CVE-2022-20141 In ip_check_mc_rcu of igmp.c, there is a possible use after free due to improper locking. vulnerability
- CVE-2021-0920 In unix_scm_to_skb of af_unix.c, there is a possible use after free bug due to a race condition. vulnerability
- CVE-2020-6819 Under certain conditions, when running the nsDocShell destructor, a race condition can cause a use-after-free. vulnerability
- CVE-2010-4168 Multiple use-after-free vulnerabilities in OpenTTD 1.0.x before 1.0.5 allow (1) remote attackers to cause a denial of service (invalid… vulnerability
- CVE-2010-2941 ipp.c in cupsd in CUPS 1.4.4 and earlier does not properly allocate memory for attribute values with invalid string data types, which… vulnerability
- CVE-2010-3328 Use-after-free vulnerability in the CAttrArray::PrivateFind function in mshtml.dll in Microsoft Internet Explorer 6 through 8 allows remote… vulnerability
- CVE-2010-1772 Use-after-free vulnerability in page/Geolocation.cpp in WebCore in WebKit before r59859, as used in Google Chrome before 5.0.375.70, allows… vulnerability
- CVE-2010-2547 Use-after-free vulnerability in kbx/keybox-blob.c in GPGSM in GnuPG 2.x through 2.0.16 allows remote attackers to cause a denial of service… vulnerability
- CVE-2010-1208 Use-after-free vulnerability in the attribute-cloning functionality in the DOM implementation in Mozilla Firefox 3.5.x before 3.5.11 and… vulnerability
- CVE-2010-2753 Integer overflow in Mozilla Firefox 3.5.x before 3.5.11 and 3.6.x before 3.6.7, Thunderbird 3.0.x before 3.0.6 and 3.1.x before 3.1.1, and… vulnerability
- CVE-2010-1437 Race condition in the find_keyring_by_name function in security/keys/keyring.c in the Linux kernel 2.6.34-rc5 and earlier allows local… vulnerability
- CVE-2010-0629 Use-after-free vulnerability in kadmin/server/server_stubs.c in kadmind in MIT Kerberos 5 (aka krb5) 1.5 through 1.6.3 allows remote… vulnerability
- CVE-2010-0050 Use-after-free vulnerability in WebKit in Apple Safari before 4.0.5 allows remote attackers to execute arbitrary code or cause a denial of… vulnerability
- CVE-2010-0302 Use-after-free vulnerability in the abstract file-descriptor handling interface in the cupsdDoSelect function in scheduler/select.c in the… vulnerability
- CVE-2010-0378 Use-after-free vulnerability in Adobe Flash Player 6.0.79, as distributed in Microsoft Windows XP SP2 and SP3, allows remote attackers to… vulnerability
- CVE-2010-0249 Use-after-free vulnerability in Microsoft Internet Explorer 6, 6 SP1, 7, and 8 on Windows 2000 SP4; Windows XP SP2 and SP3; Windows Server… vulnerability
- CVE-2009-3553 Use-after-free vulnerability in the abstract file-descriptor handling interface in the cupsdDoSelect function in scheduler/select.c in the… vulnerability
- CVE-2009-3616 Multiple use-after-free vulnerabilities in vnc.c in the VNC server in QEMU 0.10.6 and earlier might allow guest OS users to execute… vulnerability
- CVE-2009-3658 Use-after-free vulnerability in the Sb.SuperBuddy.1 ActiveX control (sb.dll) in America Online (AOL) 9.5.0.1 allows remote attackers to… vulnerability
- CVE-2009-2416 Multiple use-after-free vulnerabilities in libxml2 2.5.10, 2.6.16, 2.6.26, 2.6.27, and 2.6.32, and libxml 1.8.17, allow context-dependent… vulnerability
- CVE-2009-1837 Race condition in the NPObjWrapper_NewResolve function in modules/plugin/base/src/nsJSNPRuntime.cpp in xul.dll in Mozilla Firefox 3 before… vulnerability
- CVE-2009-0749 Use-after-free vulnerability in the GIFReadNextExtension function in lib/pngxtern/gif/gifread.c in OptiPNG 0.6.2 and earlier allows… vulnerability
- CVE-2008-5038 Use-after-free vulnerability in the NetWare Core Protocol (NCP) feature in Novell eDirectory 8.7.3 SP10 before 8.7.3 SP10 FTF1 and 8.8 SP2… vulnerability
- CVE-2008-0077 Use-after-free vulnerability in Microsoft Internet Explorer 6 SP1, 6 SP2, and and 7 allows remote attackers to execute arbitrary code by… vulnerability
- CVE-2006-4997 The clip_mkip function in net/atm/clip.c of the ATM subsystem in Linux kernel allows remote attackers to cause a denial of service (panic)… vulnerability
- CVE-2006-4434 Use-after-free vulnerability in Sendmail before 8.13.8 allows remote attackers to cause a denial of service (crash) via a long "header… vulnerability
- CVE-2003-0813 A multi-threaded race condition in the Windows RPC DCOM functionality with the MS03-039 patch installed allows remote attackers to cause a… vulnerability
Can precede · CWE (2)
Child of · CWE (2)
Referenced by CVE · weakness (9,591)
- CVE-2026-85899 Use after free in Microsoft Edge (Chromium-based) allows an authorized attacker to elevate privileges over a network. vulnerability
- CVE-2026-96192 Use after free in Microsoft Edge for iOS allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-96203 Use after free in Microsoft Edge (Chromium-based) allows an unauthorized attacker to elevate privileges over a network. vulnerability
- CVE-2026-93515 A use-after-free in present_clear_window_notifies() in the X.org X Server before 21.1.25 and X Wayland before 24.1.14 could be used by… vulnerability
- CVE-2026-93516 A use-after-free caused by lack of lifecycle management when adding / removing XInput master devices in X.org X Server before 21.1.25 and… vulnerability
- CVE-2026-108333 Tanium addressed a use-after-free vulnerability in Threat Response Client Extension. vulnerability
- CVE-2026-118307 Use after free in Paint in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to potentially execute arbitrary code inside the… vulnerability
- CVE-2026-118308 Use after free in SVG in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to potentially execute arbitrary code outside the… vulnerability
- CVE-2026-118313 Use after free in Video in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the sandbox via… vulnerability
- CVE-2026-118330 Use after free in Browser in Google Chrome on on Windows prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside… vulnerability
- CVE-2026-118334 Use after free in ImageCapture in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the… vulnerability
- CVE-2026-118338 Use after free in Animation in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to potentially execute arbitrary code inside… vulnerability
- CVE-2026-118339 Use after free in Animation in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the sandbox… vulnerability
- CVE-2026-118341 Use after free in Modularization in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the… vulnerability
- CVE-2026-118344 Use after free in Layout in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the sandbox via… vulnerability
- CVE-2026-118345 Use after free in PDFium in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to potentially execute arbitrary code inside the… vulnerability
- CVE-2026-118346 Use after free in Compositing in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to potentially execute arbitrary code… vulnerability
- CVE-2026-118347 Use after free in FileSystem in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the sandbox… vulnerability
- CVE-2026-118350 Use after free in Turbolev in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the sandbox… vulnerability
- CVE-2026-118353 Use after free in Paint in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the sandbox via… vulnerability
- CVE-2026-118356 Use after free in WTF in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to execute arbitrary code inside the sandbox via a… vulnerability
- CVE-2026-118357 Use after free in FileSystem in Google Chrome prior to 156.0.8078.73 allowed a remote attacker to potentially execute arbitrary code inside… vulnerability
- CVE-2026-112623 A use-after-free issue was addressed with improved memory management. vulnerability
- CVE-2026-112626 A use-after-free issue was addressed with improved memory management. vulnerability
- CVE-2026-112637 A use-after-free issue was addressed with improved memory management. vulnerability
- CVE-2026-112651 A use-after-free issue was addressed with improved memory management. vulnerability
- CVE-2026-112655 A use-after-free issue was addressed with improved memory management. vulnerability
- CVE-2026-116540 netty-tcnative 2.0.66.Final before 2.0.84.Final built against OpenSSL 3.x contains a use-after-free vulnerability in… vulnerability
- CVE-2026-57187 Asterisk is an open source private branch exchange and telephony toolkit. vulnerability
- CVE-2026-82388 bt_hfp_hf_connect() in subsys/bluetooth/host/classic/hfp_hf.c allocates the per-connection HFP Hands-Free object with hfp_hf_create(),… vulnerability
Referenced by CWE · can precede (4)
Referenced by CWE · has member (7)
- CWE-1200 Weaknesses in the 2019 CWE Top 25 Most Dangerous Software Errors view
- CWE-1337 Weaknesses in the 2021 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1350 Weaknesses in the 2020 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1387 Weaknesses in the 2022 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1425 Weaknesses in the 2023 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1430 Weaknesses in the 2024 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1435 Weaknesses in the 2025 CWE Top 25 Most Dangerous Software Weaknesses view
Referenced by CWE · peer of (1)
- CWE-415 Double Free weakness