Abusing the Reader’s embedded XFA engine for reliable Exploitation

1 Abusing the Reader’s embedded XFA engine for reliable E...
Author: Gloria Wells
0 downloads 0 Views

1 Abusing the Reader’s embedded XFA engine for reliable ExploitationPwning Adobe Reader Abusing the Reader’s embedded XFA engine for reliable Exploitation Sebastian Apelt 2016/04/08

2 Agenda whoami Motivation (Short!) Introduction to XFA XFA InternalsXFA Objects jfCacheManager Exploiting the Reader Demo Conclusion Q&A

3 whoami Sebastian Apelt (@bitshifter123) Co-Founder of siberas in 2009IT-Security Consulting (Pentests, Code Audits, etc.) Research Low-level addict Reverse Engineering, Bughunting, Exploitation > 100 CVEs in all kinds of Products Pwn2Own 2014 (IE11 on Win8.1 x64)

4 Motivation

5 Motivation Fuzzing at siberas Let‘s pwn the Reader @ Pwn2Own 2016!!Unfortunately, no love for Reader this time  In 2015: XFA fuzzing on 128 cores Fuzz run yielded thousands of crashes So far ~ 20 Bugs identified as unique (upcoming) Analysis took ages… Let‘s take a look at a typical Reader crash!

6 Motivation (72fc.72ec): Access violation - code c (!!! second chance !!!) eax=69572c30 ebx= ecx=07b2f3cc edx=05658af8 esi=0549e538 edi=07b2f3cc eip=20a29654 esp=0031d8c4 ebp= iopl= nv up ei pl nz na cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl= AcroForm!DllUnregisterServer+0x2f73ce: 20a mov edx,dword ptr [eax] ds:002b:69572c30=???????? Awesome, we have a crash! But no useful function name (DllUnregisterServer??) 0:000> !heap -p -a ecx address 07b2f3cc found in 11a0000 HEAP_ENTRY Size Prev Flags UserPtr UserSize - state 07b24eb0 199c [00] 07b24eb8 0ccd (busy) Offset 0xa514 !? The object holding the bad reference is located in the middle of a huge buffer => Page Heap useless 0:000> kc AcroForm!DllUnregisterServer+0x2f73ce AcroForm!DllUnregisterServer+0x2f7212 AcroForm!DllUnregisterServer+0x2f7504 AcroForm!DllUnregisterServer+0x35f3ae AcroForm!DllUnregisterServer+0x358f50 Stacktrace also not helpful

7 Motivation Adobe Reader => No symbols / RTTI infos!No function names No object / vtable information No meaningful stacktraces Page Heap useless Root cause analysis is very hard without context Complicates crash triaging during fuzz runs

8 Motivation How do we ANALYZE crashes in XFA?How do we EXPLOIT these crashes? Obvious: We need context! We need symbols! No in-depth research about XFA internals so far: Most useful: Writeups about XFA exploit from 2013 (David and Enrique of Immunity Inc, Matthieu Bonetti of Portcullis Labs) Good technical analysis, but only scratching the surface

9 Motivation Write tools to recover contextual information Facilitate:Lower the bar for other researchers! Check https://github.com/siberas in the next days Facilitate: Vulnerability discovery and root cause analysis Crash triaging during fuzz runs Deliver XFA-specific background for exploitation

10 (Short!) Introduction to XFA

11 (Short!) Introduction to XFAXFA: „XML Forms Architecture“ Specification developed by JetForm, later Accelio (acquired by Adobe in 2002) – not a standard Latest version: 3.3 (01/2012): Easy read of 1584 pages. Brings dynamic behavior to the static PDF world: Forms that can dynamically change their layout! Dynamic nature of XFA is powered by Javascript (Spidermonkey 24 since AR DC) XFA not supported by many PDF Readers, yet (Chrome/Chromium, Firefox, Windows,...)

12 (Short!) Introduction to XFAXFA form data itself is an XML-structure embedded in the PDF, a so-called XDP-Packet Javascript embedded in this XDP Executed upon events (e.g. document is fully loaded, user clicks on button, etc.) A practical example…

13 (Short!) Introduction to XFA […]