CWEweakness
CWE-415 Double Free
High
Official page ↗
- Alternate terms
- Double-free
- Abstraction
- Variant
- Structure
- Simple
- Status
- Draft
- Likelihood of exploit
- High
- Languages
- C, C++, Memory-Unsafe
- CWE version
- 5.0
Description
The product calls free() twice on the same memory address.
Common consequences
• Integrity, Confidentiality, Availability: Modify Memory, Execute Unauthorized Code or Commands — When a program calls free() twice with the same argument, the program's memory management data structures may become corrupted, potentially leading to the reading or modification of unexpected memory addresses. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
Doubly freeing memory may result in a write-what-where condition, allowing an attacker to execute arbitrary code.
Potential mitigations
• [Architecture and Design] Choose a language that provides automatic memory management.
• [Implementation] Ensure that each allocation is freed only once. After freeing a chunk, set the pointer to NULL to ensure the pointer cannot be freed again. In complicated error conditions, be sure that clean-up routines respect the state of allocation properly. If the language is object oriented, ensure that object destructors delete each chunk of memory only once.
• [Implementation] Use a static analysis tool to find double free instances.
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-2006-5051: Chain: Signal handler contains too much functionality (CWE-828), introducing a race condition (CWE-362) that leads to a double free (CWE-415).
• CVE-2004-0642: Double free resultant from certain error conditions.
• CVE-2004-0772: Double free resultant from certain error conditions.
• CVE-2005-1689: Double free resultant from certain error conditions.
• CVE-2003-0545: Double free from invalid ASN.1 encoding.
• CVE-2003-1048: Double free from malformed GIF.
• CVE-2005-0891: Double free from malformed GIF.
• CVE-2002-0059: Double free from malformed compressed data.
Related
Observed example · CVE (8)
- CVE-2006-5051 Signal handler race condition in OpenSSH before 4.4 allows remote attackers to cause a denial of service (crash), and possibly execute… vulnerability
- CVE-2005-1689 Double free vulnerability in the krb5_recvauth function in MIT Kerberos 5 (krb5) 1.4.1 and earlier allows remote attackers to execute… vulnerability
- CVE-2005-0891 Double free vulnerability in gtk 2 (gtk2) before 2.2.4 allows remote attackers to cause a denial of service (crash) via a crafted BMP image. vulnerability
- CVE-2004-0772 Double free vulnerabilities in error handling code in krb524d for MIT Kerberos 5 (krb5) 1.2.8 and earlier may allow remote attackers to… vulnerability
- CVE-2004-0642 Double free vulnerabilities in the error handling code for ASN.1 decoders in the (1) Key Distribution Center (KDC) library and (2) client… vulnerability
- CVE-2003-1048 Double free vulnerability in mshtml.dll for certain versions of Internet Explorer 6.x allows remote attackers to cause a denial of service… vulnerability
- CVE-2003-0545 Double free vulnerability in OpenSSL 0.9.7 allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code… vulnerability
- CVE-2002-0059 The decompression algorithm in zlib 1.1.3 and earlier, as used in many different utilities and packages, causes inflateEnd to release… vulnerability
Child of · CWE (4)
Referenced by CVE · weakness (949)
- CVE-2026-85890 Double free in Microsoft Edge (Chromium-based) allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-83831 Double free in Microsoft Edge (Chromium-based) allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-88812 A double free in XKB SetGeometryin X.Org X Server before 21.1.25 and X Wayland before 24.1.14 could be used by attached clients to cause a… vulnerability
- CVE-2026-112457 A double free issue was addressed with improved memory management. vulnerability
- CVE-2026-116260 A weakness has been identified in libimobiledevice up to 1.4.0. vulnerability
- CVE-2026-116743 libyal libmsiecf through 20260525 contains a double free vulnerability in libmsiecf_url_values_read_data() that allows attackers to corrupt… vulnerability
- CVE-2026-78116 The Broadcom AFBR-S50 time-of-flight sensor driver double-completes an RTIO submission when sensor data evaluation fails. vulnerability
- CVE-2026-94300 Replaying GSS-TSIG signed UDP messages can result in memory corruption in "`named`". vulnerability
- CVE-2026-86962 A double free issue was addressed with improved memory management. vulnerability
- CVE-2026-112036 A vulnerability was detected in Artifex MuPDF up to 1.28.5. vulnerability
- CVE-2026-57446 libIEC61850 is an open-source implementation of IEC 61850 client and server protocols including MMS, GOOSE, Sampled Values, and R-Session. vulnerability
- CVE-2026-110599 L-SMASH through 2.14.5 contains a double free vulnerability in hevc_setup_first_summary() and h264_setup_first_summary() in… vulnerability
- CVE-2026-94370 A defect in the Qt for MCUs core string handling causes heap memory corruption. vulnerability
- CVE-2026-104192 Dragonfly is an in-memory data store built for modern application workloads. vulnerability
- CVE-2026-106175 A Double Free vulnerability [CWE-415] vulnerability in Fortinet FortiOS 7.6.0 through 7.6.8, FortiOS 7.4 all versions, FortiOS 7.2 all… vulnerability
- CVE-2026-108132 Double free in Windows Kerberos allows an authorized attacker to elevate privileges locally. vulnerability
- CVE-2026-109943 FreeRDP 3.29.0 before 3.32.0 contains a double free in the client's async-update message proxy, which shallow-copies the parser-owned… vulnerability
- CVE-2026-70062 Double free in Windows Libarchive allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-70158 Remote Code Execution in Windows Routing and Remote Access Service (RRAS) allows attacker to gain an unauthorized access to victim's machine vulnerability
- CVE-2026-83634 Double free in Windows BitLocker allows an authorized attacker to elevate privileges locally. vulnerability
- CVE-2026-83842 Double free in Windows TCP/IP allows an authorized attacker to elevate privileges locally. vulnerability
- CVE-2026-83916 Double free in Windows Error Reporting allows an authorized attacker to execute code locally. vulnerability
- CVE-2026-84012 Double free in Remote Desktop Gateway Service allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-85829 Double free in Windows Wired AutoConfig Service allows an authorized attacker to elevate privileges locally. vulnerability
- CVE-2026-85904 Concurrent execution using shared resource with improper synchronization ('race condition') in Windows Device Association Service allows an… vulnerability
- CVE-2026-85936 Double free in Windows Shell allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-88071 Double free in Windows Hyper-V allows an authorized attacker to elevate privileges locally. vulnerability
- CVE-2026-88149 Double free in Windows Ancillary Function Driver for WinSock allows an authorized attacker to elevate privileges locally. vulnerability
- CVE-2026-88171 Double free in Windows DHCP Server allows an unauthorized attacker to execute code over a network. vulnerability
- CVE-2026-95635 Photoshop Desktop is affected by a Double Free vulnerability that could result in arbitrary code execution in the context of the current… vulnerability
Referenced by CWE · can precede (1)
- CWE-364 Signal Handler Race Condition weakness