Nytro Posted January 19, 2015 Report Posted January 19, 2015 Michalis AthanasakisFORTH, Greecemichath@ics.forth.grElias AthanasopoulosFORTH, Greeceelathan@ics.forth.grMichalis PolychronakisStony Brook Universitymikepo@cs.stonybrook.eduGeorgios PortokalidisStevens Institute of Tech.gportoka@stevens.eduSotiris IoannidisFORTH, Greecesotiris@ics.forth.grAbstract—Return-oriented programming (ROP) has becomethe dominant form of vulnerability exploitation in both userand kernel space. Many defenses against ROP exploits exist,which can significantly raise the bar against attackers. Althoughprotecting existing code, such as applications and the kernel,might be possible, taking countermeasures against dynamic code,i.e., code that is generated only at run-time, is much harder.Attackers have already started exploiting Just-in-Time (JIT)engines, available in all modern browsers, to introduce their(shell)code (either native code or re-usable gadgets) during JITcompilation, and then taking advantage of it.Recognizing this immediate threat, browser vendors startedemploying defenses for hardening their JIT engines. In this paper,we show that—no matter the employed defenses—JIT engines arestill exploitable using solely dynamically generated gadgets. Wedemonstrate that dynamic ROP payload construction is possiblein two modern web browsers without using any of the availablegadgets contained in the browser binary or linked libraries. First,we exploit an open source JIT engine (Mozilla Firefox) by feedingit malicious JavaScript, which once processed generates all requiredgadgets for running any shellcode successfully. Second, weexploit a proprietary JIT engine, the one in the 64-bit MicrosoftInternet Explorer, which employs many undocumented, speciallycrafted defenses against JIT exploitation. We manage to bypassall of them and create the required gadgets for running anyshellcode successfully. All defensive techniques are documentedin this paper to assist other researchers. Furthermore, besidesshowing how to construct ROP gadgets on-the-fly, we also showhow to discover them on-the-fly, rendering current randomizationschemes ineffective. Finally, we perform an analysis of the mostimportant defense currently employed, namely constant blinding,which shields all three-byte or larger immediate values in theJIT buffer for hindering the construction of ROP gadgets.Our analysis suggests that extending constant blinding to allimmediate values (i.e., shielding 1-byte and 2-byte constants)dramatically decreases the JIT engine’s performance, introducingup to 80% additional instructions.Download: http://users.ics.forth.gr/~elathan/papers/ndss15.pdf Quote