Skip to content
OpenAdvisories

Weakness (CWE)

CWE-590: Free of Memory not on the Heap

Variant Incomplete

The product calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or realloc().

How to prevent it (4 mitigations)
  1. Implementation

    Only free pointers that you have called malloc on previously. This is the recommended solution. Keep track of which pointers point at the beginning of valid chunks and free them only once.

  2. Implementation

    Before freeing a pointer, the programmer should make sure that the pointer was previously allocated on the heap and that the memory belongs to the programmer. Freeing an unallocated pointer will cause undefined behavior in the program.

  3. Architecture and Design

    Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

    For example, glibc in Linux provides protection against free of invalid pointers.

  4. Architecture and Design

    Use a language that provides abstractions for memory allocation and deallocation.

Source: MITRE CWE-590

12 results · Clear filters · Feed

  • High 7.4

    In PCRE2 before 10.48, pcre2_jit_match mishandles a previously copied subject being passed in as a context. An incorrec…

  • High 7.8

    Windows Ancillary Function Driver for WinSock Elevation of Privilege Vulnerability

    Free of memory not on the heap in Windows Ancillary Function Driver for WinSock allows an authorized attacker to elevate privileges locally.

  • High 7.8

    Microsoft Excel Remote Code Execution Vulnerability

    Free of memory not on the heap in Microsoft Office Excel allows an unauthorized attacker to execute code locally.

  • High 7.5

    Multiple vulnerabilities in SAP MDM Server

    SAP MDM Server Read function allows an attacker to send specially crafted packets which could trigger a memory read access violation in the server process that would then fail and exit unexpectedly causing high impact on availability with no impact on confide…

  • High 7.5

    Multiple vulnerabilities in SAP MDM Server

    SAP MDM Server ReadString function allows an attacker to send specially crafted packets which could trigger a memory read access violation in the server process that would then fail and exit unexpectedly causing high impact on availability with no impact on c…

  • High 8.6

    Malformed DATA submessage leads to bad-free error in Fast-DDS

    Fast DDS is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). In affected versions specific DATA submessages can be sent to a discovery locator which may trigger a free error. This can remotely crash an…

  • High 7.8

    yasm v1.3.0 was discovered to contain a use after free via the function expand_mmac_params at /nasm/nasm-pp.c. Note: Mu…

  • High 7.0

    An invalid free vulnerability exists in the Frame stream parser functionality of Ichitaro 2022 1.0.1.57600. A specially…

  • High 7.5

    GSS-NTLMSSP vulnerable to incorrect free when decoding target information

    GSS-NTLMSSP is a mechglue plugin for the GSSAPI library that implements NTLM authentication. Prior to version 1.2.0, an incorrect free when decoding target information can trigger a denial of service. The error condition incorrectly assumes the `cb` and `sh` …

  • High 7.7

    Heap buffer overflow in finfo_buffer

    In PHP versions 8.1.x below 8.1.8, when fileinfo functions, such as finfo_buffer, due to incorrect patch applied to the third party code from libmagic, incorrect function may be used to free allocated memory, which may lead to heap corruption.

  • High 8.1

    Freeing unallocated memory in php_pgsql_free_params()

    In PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7, when using Postgres database extension, supplying invalid parameters to the parametrized query may lead to PHP attempting to free memory using uninitialized data as pointers. This …

  • High 7.8

    Free of static data in accountsservice

    Ubuntu-specific modifications to accountsservice (in patch file debian/patches/0010-set-language.patch) caused the fallback_locale variable, pointing to static storage, to be freed, in the user_change_language_authorized_cb function. This is reachable via the…