JIT spraying is a class of computer security exploit that circumvents the protection of address space layout randomization (ASLR) and data execution prevention (DEP) by exploiting the behavior of just-in-time compilation. It has been used to exploit PDF format and Adobe Flash. To produce exploit code from JIT, an idea from Dion Blazakis is used. The input program, typically JavaScript or ActionScript, typically contains numerous constant values that can be erroneously executed as code. For example, the XOR operation could be used: var a = (0x11223344^0x44332211^0x44332211^ ...);

Property Value
dbo:abstract
  • JIT spraying is a class of computer security exploit that circumvents the protection of address space layout randomization (ASLR) and data execution prevention (DEP) by exploiting the behavior of just-in-time compilation. It has been used to exploit PDF format and Adobe Flash. A just-in-time compiler (JIT) by definition produces code as its data. Since the purpose is to produce executable data, a JIT compiler is one of the few types of programs that can not be run in a no-executable-data environment. Because of this, JIT compilers are normally exempt from data execution prevention. A JIT spray attack does heap spraying with the generated code. To produce exploit code from JIT, an idea from Dion Blazakis is used. The input program, typically JavaScript or ActionScript, typically contains numerous constant values that can be erroneously executed as code. For example, the XOR operation could be used: var a = (0x11223344^0x44332211^0x44332211^ ...); JIT then will transform bytecode to native x86 code like: 0: b8 44 33 22 11 <span class="nf">mov</span> <span class="no">$0x11223344</span><span class="p">,</span><span class="nv">%eax</span> <span class="nf">mov</span> <span class="nb">eax</span><span class="p">,</span><span class="mh">0x11223344</span>5: 35 11 22 33 44 <span class="nf">xor</span> <span class="no">$0x44332211</span><span class="p">,</span><span class="nv">%eax</span> <span class="nf">xor</span> <span class="nb">eax</span><span class="p">,</span><span class="mh">0x44332211</span>a: 35 11 22 33 44 <span class="nf">xor</span> <span class="no">$0x44332211</span><span class="p">,</span><span class="nv">%eax</span> <span class="nf">xor</span> <span class="nb">eax</span><span class="p">,</span><span class="mh">0x44332211</span> The attacker then uses a suitable bug to redirect code execution into the newly generated code. For example, a buffer overflow or use after free bug could allow the attack to modify a function pointer or return address. This causes the CPU to execute instructions in a way that was unintended by the JIT authors. The attacker is usually not even limited to the expected instruction boundaries; it is possible to jump into the middle of an intended instruction to have the CPU interpret it as something else. As with non-JIT ROP attacks, this may be enough operations to usefully take control of the computer. Continuing the above example, jumping to the second byte of the "mov" instruction results in an "inc" instruction: 1: 44 <span class="nf">inc</span> <span class="nv">%esp</span> <span class="nf">inc</span> <span class="nb">esp</span>2: 33 22 <span class="nf">xor</span> <span class="p">(</span><span class="nv">%edx</span><span class="p">),</span><span class="nv">%esp</span> <span class="nf">xor</span> <span class="nb">esp</span><span class="p">,</span><span class="kt">DWORD</span> <span class="nv">PTR</span> <span class="p">[</span><span class="nb">edx</span><span class="p">]</span>4: 11 35 11 22 33 44 <span class="nf">adc</span> <span class="nv">%esi</span><span class="p">,</span><span class="mi">0x44332211</span> <span class="nf">adc</span> <span class="kt">DWORD</span> <span class="nv">PTR</span> <span class="nb">ds</span><span class="p">:</span><span class="mh">0x44332211</span><span class="p">,</span><span class="nb">esi</span>a: 35 11 22 33 44 <span class="nf">xor</span> <span class="no">$0x44332211</span><span class="p">,</span><span class="nv">%eax</span> <span class="nf">xor</span> <span class="nb">eax</span><span class="p">,</span><span class="mh">0x44332211</span> Computer hardware that allows jumping into the middle of an instruction includes x86, x86-64, and ARM. Although especially effective on this type of hardware, JIT spraying works on other systems as well. To protect against JIT spraying, the JIT code can be disabled or made less predictable for the attacker. (en)
dbo:wikiPageID
  • 30581850 (xsd:integer)
dbo:wikiPageRevisionID
  • 735661103 (xsd:integer)
dct:subject
http://purl.org/linguistics/gold/hypernym
rdf:type
rdfs:comment
  • JIT spraying is a class of computer security exploit that circumvents the protection of address space layout randomization (ASLR) and data execution prevention (DEP) by exploiting the behavior of just-in-time compilation. It has been used to exploit PDF format and Adobe Flash. To produce exploit code from JIT, an idea from Dion Blazakis is used. The input program, typically JavaScript or ActionScript, typically contains numerous constant values that can be erroneously executed as code. For example, the XOR operation could be used: var a = (0x11223344^0x44332211^0x44332211^ ...); (en)
rdfs:label
  • JIT spraying (en)
owl:sameAs
prov:wasDerivedFrom
foaf:isPrimaryTopicOf
is dbo:wikiPageDisambiguates of
is dbo:wikiPageRedirects of
is foaf:primaryTopic of