flowdroid: precise context, flow field, object...

22
FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE TAINT ANALYSIS FOR ANDROID APPS DANIEL BARTON

Upload: ngodan

Post on 06-Jul-2019

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

F L O W D R O I D : P R E C I S E C O N T E X T, F L O W F I E L D , O B J E C T- S E N S I T I V E A N D L I F E C Y C L E A W A R E TA I N T A N A LY S I S F O R A N D R O I D A P P S

D A N I E L B A R T O N

Page 2: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

PA P E R B A C K G R O U N D

• Authors: Steven Arzt, Siegfried Rastloser, Christian Fritz, Eric Bodden, et al. (Damien Octeau)

• ACM SIGPLAN conference on Programming Language Design and Implementation (18%).

Page 3: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

F L O W D R O I D O V E R V I E W

• Novel static taint-analysis system tailored for Android.

• Analyzes both app byte-code and configuration files.

• First context-, flow-, field-, object-sensitive taint analysis.

• On-demand alias analysis to support context and object sensitivities, based on Andromeda.

• Use cases: secure Android apps, identify Android Malware

Page 4: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

AT TA C K / T H R E AT M O D E L

• FlowDroid will detect tainted flows regardless of malice.

• Attacker supplies arbitrary byte-code.

• Goal: Leak private data.

• Attacker cannot circumvent Android security or use side channels.

• Conforms to standard malware.

Page 5: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

A N D R O I D O V E R V I E W

• Android app != Java program

• Multiple points of entry

• Components

• Activities - Screens

• Services - Background operations

• Content Providers - Database-like storage

• Broadcast Receivers - Global event listeners

Page 6: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE
Page 7: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

A N D R O I D C O N T R O L /D ATA F L O W G R A P H

Page 8: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

F L O W D R O I D M O D E L O F A P P L I F E C Y C L E

• Assumes components can execute in an arbitrary sequential order.

• Based on IFDS analysis, path insensitive.

• Solution: Generate dummy main method.

• Each path is possible, does not traverse all paths.

• Callbacks only analyzed during execution windows in parent component. Scans XML files, generates call graph per lifecycle method.

• Generates final call graph with dummy method as entry point.

Page 9: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

F L O W D R O I D TA I N T A N A LY S I S

• Combines forward taint analysis and on-demand backward aliasing.

Page 10: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

TA I N T A N A LY S I S

• Access paths

• x.f.g

• Configurable lengths (5 by default)

• Includes all possible paths (x.f = x.f.g, x.f.h)

• Transfer Function

• Taints left side if the operands on right are tainted.

Page 11: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

O N - D E M A N D A L I A S A N A LY S I S

• When a tainted value is assigned to the heap, search backward for aliases and taint them as well.

• Perform forward taint propagation for each found alias.

• Problem: Produces unrealizable paths along conflicting contexts when used together (i.e. context insensitive results).

• Solution: Inject forward analysis context into backward analysis.

Page 12: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE
Page 13: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

O N - D E M A N D A L I A S A N A LY S I S ( C O N T. )

• Problem: Forward/backward combination lead to flow insensitive results.

• Solution: Augment access path with statement that spawns the backward alias, the activation statement.

• Activation statements are used to look up call trees in which they occur.

Page 14: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

W H Y P R E S E R V E A L L T H E S E S E N S I T I V I T I E S ?

• Model lifecycle accurately to reduce false negatives.

• Field sensitivity allows for reduced false positives.

• Object sensitivity to automatically dismiss false positives (i.e. when different objects hit the same code).

• Context sensitivity to eliminate unrealized paths, and reduce false positives.

Page 15: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

F L O W D R O I D A R C H I T E C T U R E

• Unzip .akp

• Search byte-code and layout XML files for life cycle methods, callbacks, sources, and sinks.

• Generate dummy main method from list of life cycle methods and call backs.

• Generate call graph and inter-procedural control flow graph (ICFG).

• Perform taint analysis on sources in ICFG.

Page 16: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

L I M I TAT I O N S

• Resolves reflective calls only if their arguments are string constants.

• Could miss callbacks (native methods that are not recognized as callbacks).

• Does not account for multiple threads.

Page 17: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

E VA L U AT I O N

• Addressed 4 research questions:

• How does FlowDroid compare to commercial taint-analysis tools for android in terms of precision and real?

• Can FlowDroid find all privacy leaks in InsecureBank, and app specifically designed by others to challenge vulnerability detection tools for android, and what is its performance?

• Can FlowDroid find leaks in real world apps and how fast?

• How well does FlowDroid perform when analyzing Java programs?

Page 18: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

E X P E R I M E N TA L S E T U P

• DroidBench

• 39 hand-crafted Android apps.

• Crafted to challenge static analysis problems (different sensitivities, etc.) and Android specific challenges (modeling lifecycle).

• First Android specific benchmark suite.

Page 19: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE
Page 20: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

E VA L U AT I O N R E S U LT S

• Q2: 31 seconds to complete with a stock laptop, finds all vulnerabilities without false positives or false negatives.

• Q3: ran FlowDroid on 500 Google Play apps. Nothing malicious. Ran again on 1000 known malware. Averaged 2 data leaks.

• Q4: ran FlowDroid on Stanford SecuriBench (J2EE benchmark).

Page 21: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE
Page 22: FLOWDROID: PRECISE CONTEXT, FLOW FIELD, OBJECT …people.cs.vt.edu/~ryder/6304/lectures/10-ArztEtAl-FlowDroid-PLDI2014-DanBarton.pdf · FIELD, OBJECT-SENSITIVE AND LIFECYCLE AWARE

C O N C L U S I O N S

• FlowDroid - Novel and highly precise static analysis tool for Android apps.

• Accurately models Android lifecycle and callbacks.

• On-demand taint analysis algorithms allow for strong sensitivities with acceptable performance.

• DroidBench - Benchmark suite of Android apps for security benchmarking.