Fuzzing Apache OpenOffice



Similar documents
Automating Security Testing. Mark Fallon Senior Release Manager Oracle

Peach Fuzzer Platform

The Hacker Strategy. Dave Aitel Security Research

How I Learned to Stop Fuzzing and Find More Bugs

Comparing the Effectiveness of Penetration Testing and Static Code Analysis

The Advantages of Block-Based Protocol Analysis for Security Testing

PHP on IBM i: What s New with Zend Server 5 for IBM i

Will Dormann: Sure. Fuzz testing is a way of testing an application in a way that you want to actually break the program.

Specific Simple Network Management Tools

Tools and Techniques to automate the discovery of Zero Day Vulnerabilities. A.K.A Fuzzing 101

Redis Cluster. a pragmatic approach to distribution

Ivan Medvedev Principal Security Development Lead Microsoft Corporation

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Format string exploitation on windows Using Immunity Debugger / Python. By Abysssec Inc

Physical Data Organization

Jonathan Worthington Scarborough Linux User Group

Dynamic Test Generation To Find Integer Bugs in x86 Binary Linux Programs

Hotpatching and the Rise of Third-Party Patches

Extending XSLT with Java and C#

Secure in 2010? Broken in 2011! Matias Madou, PhD Principal Security Researcher

A Practical Method to Diagnose Memory Leaks in Java Application Alan Yu

Using Process Monitor

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

ASL IT SECURITY XTREME XPLOIT DEVELOPMENT

What s Cool in the SAP JVM (CON3243)

GDB Tutorial. A Walkthrough with Examples. CMSC Spring Last modified March 22, GDB Tutorial

Designing with Exceptions. CSE219, Computer Science III Stony Brook University

Binary search tree with SIMD bandwidth optimization using SSE

Microsoft Modern ALM. Gilad Levy Baruch Frei

Lazy OpenCV installation and use with Visual Studio

Fuzzing in Microsoft and FuzzGuru framework

Attacking Obfuscated Code with IDA Pro. Chris Eagle

Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4)

Stack Overflows. Mitchell Adair

Critical Infrastructure Security: The Emerging Smart Grid. Cyber Security Lecture 5: Assurance, Evaluation, and Compliance Carl Hauser & Adam Hahn

IceWarp Server Upgrade

Software Vulnerabilities

NetBeans Profiler is an

Instrumentation Software Profiling

Solving the Software Quality Challenges of Agile Development

Page 18. Using Software To Make More Money With Surveys. Visit us on the web at:

Mobile Application Development Android

Penetration Testing Lessons Learned. Security Research

Oracle Solaris Studio Code Analyzer

protocol fuzzing past, present, future

Advanced IBM AIX Heap Exploitation. Tim Shelton V.P. Research & Development HAWK Network Defense, Inc. tshelton@hawkdefense.com

FTP Peach Pit Data Sheet

Bypassing Memory Protections: The Future of Exploitation

Lab Exercise SSL/TLS. Objective. Requirements. Step 1: Capture a Trace

TESSY Automated dynamic module/unit and. CTE Classification Tree Editor. integration testing of embedded applications. for test case specifications

Q Lately I've been hearing a lot about WS-Security. What is it, and how is it different from other security standards?

How to create PDF maps, pdf layer maps and pdf maps with attributes using ArcGIS. Lynne W Fielding, GISP Town of Westwood

A Link Layer Discovery Protocol Fuzzer

Crash Course in Java

Helping you avoid stack overflow crashes!

Installing Tri-Global Software

Taking full advantage of the medium does also mean that publications can be updated and the changes being visible to all online readers immediately.

W4118 Operating Systems. Junfeng Yang

Minimizing code defects to improve software quality and lower development costs.

3. Locate the different selections of Styles from the Home Tab, Styles Group

Lab Exercise SSL/TLS. Objective. Step 1: Open a Trace. Step 2: Inspect the Trace

TZWorks Windows Event Log Viewer (evtx_view) Users Guide

Downloading <Jumping PRO> from Page 2

Forouzan: Chapter 17. Domain Name System (DNS)

<Insert Picture Here> What's New in NetBeans IDE 7.2

CSC230 Getting Starting in C. Tyler Bletsch

Off-by-One exploitation tutorial

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

JBoss Seam Performance and Scalability on Dell PowerEdge 1855 Blade Servers

SNMP Peach Pit Data Sheet

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich

ACHILLES CERTIFICATION. SIS Module SLS 1508

ios Testing Tools David Lindner Director of Mobile and IoT Security

This document presents the new features available in ngklast release 4.4 and KServer 4.2.

ERNW Newsletter 51 / September 2015

*[Bug hunting ] Jose Miguel Esparza 7th November 2007 Pamplona S21sec

Acano solution. Security Considerations. August E

Using the CoreSight ITM for debug and testing in RTX applications

Secure Software Programming and Vulnerability Analysis

SECURITY B-SIDES: ATLANTA STRATEGIC PENETRATION TESTING. Presented by: Dave Kennedy Eric Smith

Source Code Review Using Static Analysis Tools

Live Event Count Issue

Automating Linux Malware Analysis Using Limon Sandbox Monnappa K A monnappa22@gmail.com

GUI Test Automation How-To Tips

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

Debugging and Bug Tracking. Slides provided by Prof. Andreas Zeller, Universität des Saarlands

IBM BPM V8.5 Standard Consistent Document Managment

Virtualization System Vulnerability Discovery Framework. Speaker: Qinghao Tang Title:360 Marvel Team Leader

Kernel Intrusion Detection System

Transcription:

Fuzzing Apache OpenOffice An Approach to Automated Black-box Security Testing Rob Weir April 7th, 2014

Who is Rob? 1) Rob Weir from Westford Massachusetts 2) rob@robweir.com, @rcweir, http://www.linkedin.com/in/rcweir 3) PMC member on Apache OpenOffice and Incubator 4) Senior Technical Staff Member at IBM

Talk Outline 1) 2) 3) 4) 5) 6) 7) Intro Fuzzing Theory Previous Fuzzing with OpenOffice.org Current Approach Results with AOO 4.1 Future Opportunities The End

What is fuzzing? Feeding a program random data in order to induce faults. Black box fuzzing assumes nothing about the expectations of the program. White box fuzzing knows about the underlying formats and protocols.

Theoretical Basis http://upload.wikimedia.org/wikipedia/commons/f/f1/monkey-typing.jpg

My first fuzzing In January 2000, with my Permutator tool, used to test the C++ port of Apache Xalan! Take input XSLT, make random changes, run Xalan in a process with custom debugger attached, catch runtime faults, repeat. Same basic idea has been elaborated on over the years, but that's essentially it.

Historically a strength of OpenOffice We have a good historical record of reducing the number of exploitable crashes. http://dankaminsky.com/2011/03/11/fuzzmark/

Toolset Bz-attachment-extract.py (custom) PeachMinset (from Peach Fuzzer) Failure Observation Engine 2.0 (from CERT) VMWare/Windows 7 64-bit/AOO 4.1 Beta

What we're looking for void foo() { byte x[9]; memcpy(x, 123456789XYZ ); } void main(int argc, char*argv[]) { foo(); } Stack in main immediately before call to foo: argv 4 bytes argc 4 bytes

What we're looking for void foo() { byte x[9]; memcpy(x, 123456789XYZ ); } void main(int argc, char*argv[]) { foo(); } Stack in foo immediately before call to memcpy: x[] 9 bytes ret=@main @main 4 bytes 4 bytes argv 4 bytes argc 4 bytes

What we're looking for void foo() { byte x[9]; memcpy(x, 123456789WXYZ ); } void main(int argc, char*argv[]) { foo(); } Stack in foo immediately after call to memcpy: x[] =123456789 @main ret = WXYZ 4 bytes argv 4 bytes argc 4 bytes Return address corrupted.

Ancient File Formats Record Type Record Length Often processed like: Data Record Type Record Length Data Switch on record type Malloc the specified size Cast to a pointer to appropriate struct based on type Repeat Very efficient... when the data is correct.

A Large State Space 1 2 3 4 5 5 byte file has 256^5 ~ 10^12 ways to mutate it But a typical document is 100KB or more in length ~ 10^2466037 combinations We need to be smart about this or we'll be here all night!

Not a very encouraging dynamic.

Defects found What we usually see in QA Tests executed

1/3^3 = 1/27 PPT XLS XLS Save 1/3^2 = 1/9 1/3^1 = 1/3 1/3^0 = 1 Open Print File start Edit Tools Functionality lower in the tree is exercised more frequently and the defects there are found faster.

A Key Insight We can mutate existing documents taken from our Bugzilla We have a large number of documents created over many years in many versions of OpenOffice Broad feature coverage Emphasizes documents that are in product areas that are currently or have been buggy. (Cockroach theory)

bz-attachment-extract https://svn.apache.org/repos/asf/openoffice/devtools/bz-tools/bzattachment-extract.py Hard-coded to use the AOO instance of BZ, but should be easily adaptable. Nice, pauses 15 seconds between each download. Works off a text file of issue ID's which you can easily get from exporting a CSV from a BZ query. Caches the issue's XML so repeated invocations will faster if hitting the same issue. But currently no check for staleness.

What did we get? 9,602 total files 1328 doc files 425 ppt files 369 xls files 11,211 binary image files Most were screenshots not problem images.

Second Insight Redundancy makes this inefficient Do we really want to test 10,000 JPG files but only 4 SVM image files? We could weight file extensions equally But that fails to account for different complexity of formats Solution is to maximize code coverage, pick the minimum set of test files that covers the same code as the entire set of files.

PeachMinSet Part of Peach Fuzzer: http://peachfuzzer.com/ Loads each file, doing an instruction trace and then post-processes the traces to tell you what the minimum file set is. A bit temperamental. Required some duct tape and WD40 to work with AOO. Contact me if you want the gory details.

Minset Results 225/1328 doc files = 17% 144/425 ppt files = 34% 46/369 xls files = 40% 234/11,211 binary image files = 2% Total 649 of 13,333 = 5%, so overall a 20x improvement

Failure Observation Engine Windows Fuzzing Framework from CERT http://www.cert.org/vulnerability-analysis/tools/foe.cfm A sister project for Linux, Basic Fuzzing Framework (BFF) is also available: http://www.cert.org/vulnerabilityanalysis/tools/bff.cfm

Basic FOE Workflow Take a seedfile and appply specified fuzzer to it Pass fuzzed file to AOO command line If a fault is detect then hook in debugger If crash is dupe then skip, else: Pass crash details onto Microsoft's!exploitable to classify the crash Write out crash dump plus the fuzzed and original file Optionally, try to minimize the fuzzed file to create a minimal test case. FOE learns which files and fuzzing parameters lead to the most crashes.

AOO 4.1 Beta Results 4 VMs ran for 1 week ~10 tests/minute for each VM 4*10*7*24*60 = ~ 400K tests Many crashes, over 70 classified as EXPLOITABLE by!exploitable. But only 4 root causes, which are fixed in the 4.1 GA release. I can provide more detail in Denver on the actual fuzzing results if AOO 4.1 is released by then.

One Approach of Many Fuzzing is only one approach, but is not a silver bullet. Static analysis, e.g., Coverity is another, complementary, tool. We might also consider retiring some of the rarely used binary formats to reduce exposure, or at least make them optional at install time.

Time Permitting: Random Observations

I assume this all makes sense to developers. But to users?

Fuzzing a Raster Image Header info It is like shooting a jellyfish!

Fuzzing XML Most random mutations of XML files cause the file to be rejected. We need to be clever to induce faults in processing of ODF and OOXML, e.g.: Replace numeric attribute values with 0, -1, 1, 2^16-1, -2^16, NaN, INF, -INF Replace string attribute values with, Interchange xml:id and idref's Interchange two subtrees Replace character data Schema-directed fuzzing?, a large string (16K)

Headless Execution Idea is to increase test execution rate Focus on parsing code, not layout code But maybe faults are in layout code also? Possibilities for unit-level fuzzing as well

The End