ie memory protection null meet april 2015

17
Internet Explorer Memory Protection A Brief Overview

Upload: nu-the-open-security-community

Post on 20-Jul-2015

78 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: IE memory protection Null meet april 2015

Internet ExplorerMemory Protection

A Brief Overview

Page 2: IE memory protection Null meet april 2015

Agenda

• Introduction to Use-After-Free (UaF) vulnerabilities

• Exploiting UaF vulnerabilities

• UaF exploit mitigation through MemoryProtector

Page 3: IE memory protection Null meet april 2015

Why Focus on UaF ?

http://blog.tempest.com.br/breno-cunha/perspectives-on-exploit-development-and-cyber-attacks.html

Page 4: IE memory protection Null meet april 2015

UaF: An Example

Dangling Pointer Dereference

B1 B2

Object

Page 5: IE memory protection Null meet april 2015

UaF: An Example

Vftable Intact

Page 6: IE memory protection Null meet april 2015

UaF: A Browser Example

MS13-080

Page 7: IE memory protection Null meet april 2015

UaF: A Browser Example

Light Page Heap overwrites free’d chunks with 0xf0

https://msdn.microsoft.com/en-us/library/ms220938%28v=vs.90%29.aspx

Page 8: IE memory protection Null meet april 2015

UaF: Exploitation

Page 9: IE memory protection Null meet april 2015

UaF: Exploitation

Page 10: IE memory protection Null meet april 2015

UaF: Exploitation – Object Re-use

ObjectB1B2

Function 1

Function 2

Function …

Vftable

Objectdelete b1 [Object Freed]

0x414141fill(16) [Re-use memory block]

0x414141B2

b2->hello()

Page 11: IE memory protection Null meet april 2015

UaF: Exploitation - Browser

Page 12: IE memory protection Null meet april 2015

Fundamental Mitigations

• Non-executable Data Pages [NX]

– PageExec [PaX/Grsecurity]

– DEP [Windows]

– W ^ X [OpenBSD]

– […]

• Address Space Layout Randomization (ASLR)

Page 13: IE memory protection Null meet april 2015

Environment Specific Mitigations

• Windows– SafeSEH, SEHOP– Stack Protection– Vftable Guard– Control Flow Guard– […]

• Internet Explorer– Enhanced Protected Mode (EPM)– Nozzle & Bubble– Isolated Heap– Memory Protector– […]

Page 14: IE memory protection Null meet april 2015

Internet Explorer: Memory Protector

• Manage De-allocation / Free of important DOM objects

– Overwrite the free’d object with NULL content

– Queue for “free” in a per-thread list instead of immediate free at heap manager level.

– Real/Heap free is executed during certain conditions.

– Ensure no reference to object in stack before actual free at heap manager level

This prevents immediate re-use of free’d objects

Page 15: IE memory protection Null meet april 2015

Internet Explorer: Memory Protector

• MemoryProtection::CMemoryProtector

– ProtectedFree

– MarkBlocks

– ReclaimUnmarkedBlocks

Application Free

HeapFree

Application Free

CMemoryProtector::ProtectedFree

HeapFree

BeforeWith MemoryProtector

Page 16: IE memory protection Null meet april 2015

Questions ?

http://www.twitter.com/abh1sekhttp://www.3slabs.com

https://github.com/abhisek/RandomCode/tree/master/Misc/ie_memprotector_nullblr

Page 17: IE memory protection Null meet april 2015

References

• http://h30499.www3.hp.com/t5/HP-Security-Research-Blog/Efficacy-of-MemoryProtection-against-use-after-free/ba-p/6556134#.VSeGDxOUenD

• https://www.corelan.be/index.php/2011/12/31/exploit-writing-tutorial-part-11-heap-spraying-demystified/

• https://msdn.microsoft.com/en-us/library/ms220938%28v=vs.90%29.aspx

• http://securityintelligence.com/understanding-ies-new-exploit-mitigations-the-memory-protector-and-the-isolated-heap/#.VS-JRxOUenA