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

JIT Spray

What is JIT Spray?

JIT SprayAn exploit technique that abuses just-in-time compilers to plant attacker-chosen executable bytes inside legitimately generated, executable memory pages.


JIT spray is a memory-corruption exploit technique used against runtimes with just-in-time compilers — JavaScript engines such as V8, SpiderMonkey, and JSC, the .NET CLR, the JVM, ActionScript, or eBPF. The attacker crafts a high-level program whose JIT-compiled output, when viewed as raw bytes, decodes into desired native instructions, allowing payload smuggling into RWX pages produced by the JIT. Combined with a memory-corruption bug that hijacks control flow, the attacker can pivot into the sprayed gadgets, bypassing data-execution protections because the memory is legitimately marked executable. Modern mitigations include constant blinding, randomized code regions, W^X JIT writeable/executable separation, ASLR, and CFI.

Examples

  1. 01

    Spraying many JavaScript multiplications whose immediate constants embed shellcode bytes.

  2. 02

    Using ActionScript JIT to plant a NOP sled and shellcode inside Flash Player's JIT region.

Frequently asked questions

What is JIT Spray?

An exploit technique that abuses just-in-time compilers to plant attacker-chosen executable bytes inside legitimately generated, executable memory pages. It belongs to the Application Security category of cybersecurity.

What does JIT Spray mean?

An exploit technique that abuses just-in-time compilers to plant attacker-chosen executable bytes inside legitimately generated, executable memory pages.

How does JIT Spray work?

JIT spray is a memory-corruption exploit technique used against runtimes with just-in-time compilers — JavaScript engines such as V8, SpiderMonkey, and JSC, the .NET CLR, the JVM, ActionScript, or eBPF. The attacker crafts a high-level program whose JIT-compiled output, when viewed as raw bytes, decodes into desired native instructions, allowing payload smuggling into RWX pages produced by the JIT. Combined with a memory-corruption bug that hijacks control flow, the attacker can pivot into the sprayed gadgets, bypassing data-execution protections because the memory is legitimately marked executable. Modern mitigations include constant blinding, randomized code regions, W^X JIT writeable/executable separation, ASLR, and CFI.

How do you defend against JIT Spray?

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

What are other names for JIT Spray?

Common alternative names include: Just-in-time spray.

Related terms