CyberGlossary

Vulnerabilities

Use-After-Free

Also known as: UAF

Definition

A memory-safety bug where a program continues to use memory after it has been freed, often allowing attackers to control object state and hijack execution.

A use-after-free (UAF) happens when a pointer keeps referencing an object after free()/delete has released it. If the attacker can cause the same memory region to be reallocated as a different object, the dangling pointer effectively gives them a type confusion — perfect for overwriting virtual-function pointers, callback addresses, or sensitive state. UAFs dominate browser and kernel exploitation (CWE-416). Defences include disciplined ownership models (RAII, smart pointers), garbage-collected or memory-safe languages, hardened allocators (quarantine, isolation pools, GWP-ASan), and KASAN/Valgrind testing. Browsers also deploy MiraclePtr and PartitionAlloc-style guards.

Examples

  • CVE-2018-8174 (VBScript engine) — UAF exploited by APT actors.
  • CVE-2022-0609 (Chrome animation) — UAF, used as a zero-day.

Related terms