Sticky Banner Visual Mobile 5

Lock in premium privacy for less: 2 years + 4 months at a special price.

Lock in 2 years + 4 months at a special price. Claim now!

Claim Now!
Sticky Banner Visual Mobile 3

Spring deal: Save up to 78% — Offer ends in

Spring Deal: Save up to 78%

Claim Now!

Expressvpn Glossary

Data execution prevention (DEP)

Data execution prevention (DEP)

What is data execution prevention?

Data execution prevention (DEP) is a security feature that helps prevent malicious code from running in protected areas of computer memory. It also helps protect systems from exploits that rely on running injected code through memory corruption vulnerabilities.

How does DEP work?

DEP works by marking specific areas of memory as non-executable. When a program attempts to execute code from memory regions marked as non-executable, the processor raises an access-violation exception. Unless the exception is handled, the operating system terminates the affected process.

Types of data execution prevention

DEP can generally be implemented in two main ways:A comparison table highlighting the differences between hardware-enforced DEP and software-enforced DEP.

  • Hardware-enforced DEP: Uses processor features such as the NX (No-Execute) or XD (Execute Disable) bit to mark memory pages as executable or non-executable. This approach provides stronger protection and is widely used in modern systems.
  • Software-enforced DEP: Relies on operating system checks to detect unsafe execution behavior, particularly in older hardware environments that lack processor-level support or as an additional layer of exploit mitigation.

DEP implementation across platforms and environments

DEP is supported across most modern operating systems:

  • Windows: DEP is built into modern Windows systems and is enabled by default in most configurations, helping protect applications and system processes from memory-based exploits.
  • Linux and UNIX-like systems: Modern Linux kernels support non-executable memory protections using processor features such as the NX bit, which are enabled by default on most 64-bit systems. BSD and other Unix-like systems implement similar kernel-level protections by default.
  • macOS (OS X): macOS enforces memory execution restrictions for applications and system components, preventing writable memory regions such as the stack and heap from executing code.
  • Mobile (Android and iOS): Both Android and iOS enforce DEP at the kernel level; Android through Linux kernel memory protections, and iOS through ARM's Execute Never (XN) feature.

Risks and limitations

While data execution prevention improves protection against memory-based exploits, it is not a complete security solution.

  • Limited protection scope: Some exploitation techniques, such as code-reuse attacks, can avoid DEP by using existing executable instructions instead of injecting new code.
  • Reduced coverage through exceptions: Application exemptions or system configuration changes may disable DEP in certain cases.
  • Compatibility tradeoffs: Some legacy software that relies on dynamic code execution may not function correctly when DEP is enforced.

Further Reading

FAQ

Is DEP the same as the NX/XD bit?

At the hardware level, the CPU feature that marks memory pages as non-executable goes by different names depending on the processor: Intel calls it eXecute Disable (XD), and AMD calls it No-eXecute (NX).

On Windows, the operating system feature that uses this hardware support is called Data Execution Prevention (DEP). On Linux, the equivalent OS-level feature is also called NX bit. So, depending on the platform and context, DEP, NX, and XD may refer to the same underlying protection implemented at different levels.

How do I check whether DEP is enabled?

On Windows, Data Execution Prevention (DEP) status can be checked at the system level via PowerShell or through boot configuration options. To check whether DEP is enabled for a specific executable, tools like dumpbin /loadconfig or the PowerShell module PESecurity can inspect the NX Compatibility flag in the file's Portable Executable headers. On modern systems, finding DEP disabled at either level is rare.

Can attackers bypass DEP, and how?

Attackers can work around it with techniques like return-oriented programming (ROP), which chains together small pieces of legitimate code already present in memory to redirect execution without injecting anything new.

What’s the difference between DEP and ASLR?

Data Execution Prevention (DEP) prevents code from executing in memory regions that are not intended to run instructions, while Address Space Layout Randomization (ASLR) randomizes memory locations so attackers cannot reliably predict where code or data is stored.

Does a VPN offer protection against memory exploits?

No. A virtual private network (VPN) protects data in transit by encrypting network traffic, while memory exploits target vulnerabilities in software running on a device.
Get Started