thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Application & OT Security · Advanced

Use-After-Free (UAF)

Using a pointer to memory after it has been freed, which may now hold attacker-controlled data.

Definition

UAF bugs are common in browsers and kernels and can lead to code execution. Mitigations include setting pointers to null after free, smart pointers and ownership models, hardened allocators, and memory-safe languages such as Rust. Tracked as CWE-416.

Example

A browser frees a DOM object during an event handler but later calls a method through a stale pointer.

Exam tip

Rust's ownership model prevents UAF at compile time.

Related terms