Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 842

Null Pointer Dereference

Reviewed byCybersecurity entrepreneur & security researcher

What is Null Pointer Dereference?

Null Pointer DereferenceA bug in which a program reads or writes through a pointer whose value is null (or otherwise invalid), typically causing a crash and sometimes enabling exploitation.


Null pointer dereferences (CWE-476) occur when code follows a pointer that is NULL — never initialised, zeroed after a free, or returned by a function whose failure the caller ignored. On modern systems there is no valid mapping at address zero, so the access raises a fault and the process (or kernel) dies, which at minimum is a denial-of-service bug.

Historically some null derefs were far worse. CVE-2009-2692 — found by Tavis Ormandy and Julien Tinnes of Google's security team — exploited the Linux kernel's sock_sendpage path: the kernel called an uninitialised proto_ops function pointer that defaulted to NULL. Where a local user could map page zero (older kernels with a permissive or zero mmap_min_addr), they placed shellcode there and the kernel jumped to it, yielding local privilege escalation to root (CVSS 7.2). The class also matters in JIT compilers and MMU-less embedded systems where low addresses are usable.

Defences layer up: strict null checks and early returns; language guarantees such as Rust references, Optional/Maybe types, and Kotlin/Swift non-nullable types; static analysis and -fsanitize (UBSan/ASan) in testing; and OS hardening such as a non-zero mmap_min_addr plus SMAP/SMEP, which stop the kernel reading or executing user pages. Fuzzing readily surfaces crash-on-null inputs before release.

flowchart TD
  A[Function returns NULL / pointer uninitialised] --> B[Code dereferences the pointer]
  B --> C{Is address 0 mapped?}
  C -->|No - modern OS| D[Segfault / kernel oops = denial of service]
  C -->|Yes - low mmap_min_addr| E[Attacker-controlled code at page zero]
  E --> F[Kernel jumps to shellcode = privilege escalation]

● Examples

  1. 01

    A web server that crashes when an optional header is missing.

  2. 02

    Historical Linux kernel null-deref bugs exploitable when mmap_min_addr was 0.

● Frequently asked questions

What is Null Pointer Dereference?

A bug in which a program reads or writes through a pointer whose value is null (or otherwise invalid), typically causing a crash and sometimes enabling exploitation. It belongs to the Vulnerabilities category of cybersecurity.

What does Null Pointer Dereference mean?

A bug in which a program reads or writes through a pointer whose value is null (or otherwise invalid), typically causing a crash and sometimes enabling exploitation.

How do you defend against Null Pointer Dereference?

Defences for Null Pointer Dereference typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Null Pointer Dereference?

Common alternative names include: Null deref.

● Related terms