Skip to main content
QUICK REVIEW

[Paper Review] JIT Spraying and Mitigations

Piotr Bania|arXiv (Cornell University)|Sep 6, 2010
Security and Verification in ComputingComputer Science3 references11 citations
TL;DR

This paper presents a novel, high-performance mitigation against JIT spraying attacks— a technique that bypasses DEP and ASLR by injecting shellcode into executable memory regions generated by Just-In-Time compilers, particularly in ActionScript environments. The authors propose a detection mechanism that identifies malicious code by scanning for sequences of instructions using 32-bit immediate operands, combined with validation of short jump chains, achieving effective detection with no false positives and minimal performance overhead on Windows systems.

ABSTRACT

With the discovery of new exploit techniques, novel protection mechanisms are needed as well. Mitigations like DEP (Data Execution Prevention) or ASLR (Address Space Layout Randomization) created a significantly more difficult environment for exploitation. Attackers, however, have recently researched new exploitation methods which are capable of bypassing the operating system's memory mitigations. One of the newest and most popular exploitation techniques to bypass both of the aforementioned security protections is JIT memory spraying, introduced by Dion Blazakis. In this article we will present a short overview of the JIT spraying technique and also novel mitigation methods against this innovative class of attacks. An anti-JIT spraying library was created as part of our shellcode execution prevention system.

Motivation & Objective

  • To address the growing threat of JIT spraying attacks that bypass traditional memory protections like DEP and ASLR.
  • To detect and prevent shellcode injection in JIT-generated executable memory regions, particularly in ActionScript environments.
  • To design a mitigation that operates efficiently without degrading application performance.
  • To reduce false positives in detection while maintaining strong protection against sophisticated evasion techniques.

Proposed method

  • The method detects JIT spraying by scanning for sequences of instructions that use 32-bit immediate operands as sources, which are characteristic of attacker-controlled shellcode.
  • It starts disassembly from the first 'mov reg, IMM32' instruction and counts 'bad' instructions (those with 32-bit immediates) until a terminator (e.g., CALL, RET, JMP) is encountered.
  • A threshold-based alert is triggered if the number of such 'bad' instructions exceeds a predefined maximum, signaling potential shellcode.
  • The system also validates short jump chains (JMP, JCC) by checking if their immediate targets point to valid, consecutive jump instructions, preventing evasion via jump linking.
  • The detection occurs in real time before JIT-generated code is executed, ensuring protection at the point of code generation.
  • The mitigation is implemented as a library integrated into the application runtime, with no changes to the OS or browser.

Experimental results

Research questions

  • RQ1How can JIT spraying attacks be detected in real time without significant performance overhead?
  • RQ2What characteristics of JIT-generated code can be used to reliably distinguish malicious shellcode from benign code?
  • RQ3Can a detection mechanism based on 32-bit immediate operand usage effectively prevent evasion via jump chaining?
  • RQ4How can false positives be minimized in environments with heavy use of JIT-compiled ActionScript?

Key findings

  • The anti-JIT spraying library detected all known JIT shellcode samples without generating any false positives during testing on Flash 10c.
  • The detection mechanism achieved low performance overhead, with no noticeable impact on application performance during browsing of typical Flash-heavy websites.
  • The method successfully detected shellcode even when attackers attempted to evade detection by using multiple short jumps to link code fragments.
  • The threshold-based counting of 32-bit immediate operands proved effective in identifying malicious code blocks before execution.
  • The combination of immediate operand scanning and jump chain validation significantly increased the difficulty of bypassing the mitigation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.