Authorization / Use After Free

CWE Top 25 (2022)Web and API


Use After Free (UAF) is a type of software bug related to dynamic memory allocation and deallocation. It occurs when a program attempts to access a memory address which has already been freed, causing a segmentation fault or other system failure. UAF vulnerabilities are listed in the CWE Top 25 (2022) in the category Authorization and in the Web and API category of the OWASP Testing Guide.


UAF vulnerabilities can have serious security implications. An attacker could use a UAF bug to gain access to sensitive data, modify code execution, or cause a denial of service. A risk assessment should be conducted to determine the severity of the vulnerability and appropriate mitigation strategies.


To prevent UAF vulnerabilities, proper memory management and allocation practices should be followed. Developers should be aware of the lifecycle of allocated memory, and use safe coding practices such as using memory pools, reference counting, and boundary checks.


The below code example (CVE-2020-2030) demonstrates a UAF vulnerability in which a memory block is freed and then used again without re-allocating it.

int main() {
    int* pointer;
    pointer = malloc(sizeof(int));
    *pointer = 1;
    return 0;

Curious? Convinced? Interested?

Arrange a no-obligation consultation with one of our product experts today.