Falhas do tipo CWE-590
26 resultadosLiberação de memória não alocada no heap
Ocorre quando código tenta liberar (free, delete) memória que não foi alocada dinamicamente no heap, como variáveis locais na pilha ou ponteiros inválidos. Isso corrompe o gerenciador de memória e causa crashes ou comportamento indefinido.
Exemplo
Um programa aloca um buffer local na pilha (char buf[100]) e depois tenta fazer free(buf) como se fosse heap. Ou recebe um ponteiro de origem desconhecida e chama delete sem verificar se realmente veio de malloc/new.
Como mitigar
Rastreie a origem de cada ponteiro e libere apenas o que você mesmo alocou no heap. Use análise estática (Clang Static Analyzer, Valgrind) para detectar mismatches free/malloc. Em C++, prefira smart pointers (unique_ptr, shared_ptr) que gerenciam liberação automaticamente.
CVE-2021-39218MEDIUMOut-of-bounds read/write and invalid free with `externref`s and GC safepoints in WasmtimeEPSS 0.3%CVE-2025-42996MEDIUMMultiple vulnerabilities in SAP MDM ServerEPSS 0.2%CVE-2025-5899MEDIUMGNU PSPP pspp-convert.c parse_variables_option free of memory not on the heapEPSS 0.2%CVE-2026-89161HIGHIn PCRE2 before 10.48, pcre2_jit_match mishandles a previously copied subject being passed in as a context. An incorrect free operation can EPSS 0.1%CVE-2025-7006MEDIUMAvast antivirus use of stack memory after free when scanning a malformed PE fileEPSS 0.1%CVE-2026-47328MEDIUMInvalid pointer deallocation in Ubuntu Linux AppArmor notification handlingEPSS 0.1%