A double free vulnerability occurs when a program mistakenly calls the 'free()' function twice on the same block of memory.

This happens when a developer loses track of which pointers reference already-freed memory. The first free() call returns the memory to the system's pool for reuse, but the second call targets the same now-invalid address. This corrupts the memory manager's internal data structures, which can immediately crash the program or, more dangerously, create an opening for attackers to execute arbitrary code. Preventing double frees requires disciplined pointer management, such as setting pointers to NULL immediately after freeing them. While SAST tools can catch this pattern, Plexicus uses AI to suggest the actual code fix—like inserting that null assignment—saving hours of manual review and helping to secure your application's memory handling.
Impact: Modify MemoryExecute 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.
ccHigh