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

DEP

What is DEP?

DEPData Execution Prevention (also called NX or W^X) marks memory pages as non-executable so attackers cannot run shellcode injected into the stack or heap.


DEP, sometimes called NX (No-eXecute) or W^X (Write XOR Execute), enforces that any memory page is either writable or executable but never both. The CPU's NX bit blocks instruction fetches from data pages such as the stack and heap, defeating classic shellcode-injection attacks. AMD introduced the hardware bit in 2003 and Intel followed shortly after; software DEP was added to Windows XP SP2 and to Linux via PaX/grsecurity, then mainlined. Because DEP eliminates direct code execution from data, attackers shifted to code-reuse techniques like return-to-libc and ROP, which is why DEP is paired with ASLR, CFI, and shadow stacks.

Examples

  1. 01

    The stack being marked NX so an attacker's shellcode crashes instead of executing.

  2. 02

    Linux mmap rejecting PROT_WRITE | PROT_EXEC on hardened builds.

Frequently asked questions

What is DEP?

Data Execution Prevention (also called NX or W^X) marks memory pages as non-executable so attackers cannot run shellcode injected into the stack or heap. It belongs to the Application Security category of cybersecurity.

What does DEP mean?

Data Execution Prevention (also called NX or W^X) marks memory pages as non-executable so attackers cannot run shellcode injected into the stack or heap.

How does DEP work?

DEP, sometimes called NX (No-eXecute) or W^X (Write XOR Execute), enforces that any memory page is either writable or executable but never both. The CPU's NX bit blocks instruction fetches from data pages such as the stack and heap, defeating classic shellcode-injection attacks. AMD introduced the hardware bit in 2003 and Intel followed shortly after; software DEP was added to Windows XP SP2 and to Linux via PaX/grsecurity, then mainlined. Because DEP eliminates direct code execution from data, attackers shifted to code-reuse techniques like return-to-libc and ROP, which is why DEP is paired with ASLR, CFI, and shadow stacks.

How do you defend against DEP?

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

What are other names for DEP?

Common alternative names include: NX, No-Execute, W^X.

Related terms

See also