CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerability Chao Shi CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Syracuse University, New York, USA
PScout: Analyzing the Android Permission Specification
Code Injection Attacks on HTML5-based Mobile Apps: Characterization, Detection and Mitigation Xing Jin, Xunchao Hu, Kailiang Ying, Wenliang Du, Heng Yin,
2014 Network and Distributed System Security Symposium AppSealer: Automatic Generation of Vulnerability-Specific Patches for Preventing Component Hijecking.
Policy Weaving for Mobile Devices Drew Davidson. Smartphone security is critical – 1200 to 1400 US Army troops to be equipped with Android smartphones.
Program Representations. Representing programs Goals.
Android Security. N-Degree of Separation Applications can be thought as composed by Main Functionality Several Non-functional Concerns Security is a non-functional.
Long Lu, Zhichun Li, Zhenyu Wu, Wenke Lee and Guofei Jiang CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerability.
Introduction to push technology © 2009 Research In Motion Limited.
1 Software Testing and Quality Assurance Lecture 30 – Testing Systems.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
Security of Mobile Applications Vitaly Shmatikov CS 6431.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Android Security Enforcement and Refinement. Android Applications --- Example Example of location-sensitive social networking application for mobile phones.
CS 153 Design of Operating Systems Spring 2015 Lecture 24: Android OS.
Understanding Android Security Yinshu Wu William Enck, Machigar Ongtang, and PatrickMcDaniel Pennsylvania State University.
박 종 혁 컴퓨터 보안 및 운영체제 연구실 MobiSys '11 Proceedings of the 9th international conference on Mobile systems, applications,
Lei Wu, Michael Grace, Yajin Zhou, Chiachih Wu, Xuxian Jiang Department of Computer Science North Carolina State University CCS 2013.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
APKInspector -Static Analysis of Android Applications Student: Yuan Tian Mentor: Cong Zheng Backup Mentor: Anthony Kara Jianwei 08/22/2012.
SUPOR : Precise and Scalable Sensitive User Input Detection for Android Apps Jianjun Huang, Zhichun Li, Xusheng Xiao, Zhenyu Wu, Kangjie Lu, Xiangyu Zhang,
Presented by: Tom Staley. Introduction Rising security concerns in the smartphone app community Use of private data: Passwords Financial records GPS locations.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 5 “Database and Cloud Security”.
Networking: Part 2 (Accessing the Internet). The UI Thread When an application is launched, the system creates a “main” UI thread responsible for handling.
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
Erika Chin Adrienne Porter Felt Kate Greenwood David Wagner University of California Berkeley MobiSys 2011.
CS378 - Mobile Computing Intents.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
Developing Security Mobile Applications for Android Presenter, Joel Elixson Author, Jesse Burns of iSEC Partners.
Android for Java Developers Denver Java Users Group Jan 11, Mike
University of Central Florida TaintDroid: An Information-Flow Tracking System for Realtime Privacy Monitoring on Smartphones Written by Enck, Gilbert,
CSC-682 Cryptography & Computer Security Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Pompi Rotaru Based on an article.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
NMD202 Web Scripting Week3. What we will cover today Includes Exercises PHP Forms Exercises Server side validation Exercises.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
ANDROID L. Grewe Components  Java Standard Development Kit (JDK) (download) (latest version)  AndroidStudio.
Android Security Model that Provide a Base Operating System Presented: Hayder Abdulhameed.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Checking More Alerting Less PRESENTED BY: AMIN ROIS SINUNG NUGROHO.
Mobile Application Security on Android Originally presented by Jesse Burns at Black Hat
Android System Security Xinming Ou. Android System Basics An open-source operating system for mobile devices (AOSP, led by Google) – Consists of a base.
Testing in Android. Methods Unit Testing Integration Testing System Testing Regression Testing Compatibility Testing Black Box (Functional) White Box.
Android Permissions Demystified
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
AFS/OSD Project R.Belloni, L.Giammarino, A.Maslennikov, G.Palumbo, H.Reuter, R.Toebbicke.
Lecture 2: Android Concepts
Nguyen Thi Thanh Nha HMCL by Roelof Kemp, Nicholas Palmer, Thilo Kielmann, and Henri Bal MOBICASE 2010, LNICST 2012 Cuckoo: A Computation Offloading Framework.
START Application Spencer Johnson Jonathan Barella Cohner Marker.
Analyzing Input Validation vulnerabilities in Android System Services NAMJUN PARK (NPAR350)
Java & The Android Stack: A Security Analysis Pragati Ogal Rai Mobile Technology Evangelist PayPal, eBay Java.
AppAudit Effective Real-time Android Application Auditing Andrew Jeong
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
INFORMATION-FLOW ANALYSIS OF ANDROID APPLICATIONS IN DROIDSAFE JARED YOUNG.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Authors: William Enck & Patrick McDaniel In collaboration with: Duke University and Intel Labs Presentation: Ed Novak 1.
More Security and Programming Language Work on SmartPhones
Security and Programming Language Work on SmartPhones
Understanding Android Security
Reactive Android Development
Android System Security
Android.
Harvesting Runtime Values in Android Applications That Feature Anti-Analysis Techniques Presented by Vikraman Mohan.
Presented by Xiaohui (Amy) Lin
MobiSys 2017 Symbolic Execution of Android Framework with Applications to Vulnerability Discovery and Exploit Generation Qiang Zeng joint work with Lannan.
Binder Attack Surface in Android
PHP / MySQL Introduction
Systematic Detection of capability leaks in stock android smartphones
Understanding Android Security
Presentation transcript:

CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerability Chao Shi CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 1 Scribed from

Systematic Detection of Capability Leaks in Stock Android Smartphones Jacob Sherin CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 2

Component Hijacking Vulnerability CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 3

Vetting vulnerable apps in large scale  High volume of app submissions  Inexperienced developers  Large number of vulnerable apps CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 4 4 Component hijacking vulnerability Accurate and scalable app vetting methods

Components in Android Apps  Type  Activity  Service  Broadcast Receiver  Content Provider  Mutually independent yet interactive  Secure interaction mechanism exists  People ignorance  Export Component  The component is publicly available CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 5 5 App1App2 Android Framework

Component hijacking attacks CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 6 6 A class of attacks that seek to gain unauthorized access (read/write or combined) to protected or private resources through exported components in vulnerable apps. Vulnerable apps exist on target devices The attacking app is already installed

Component hijacking attacks CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 7 7 Contact Manager App EnumeratorService Enumerator Service Returns the address book upon request Accepts unauthorized requests READ Contacts Android Framework Unauthorized access to protected resources

Component hijacking attacks CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 8 8 Setting Update Receiver Accepts external updates App Internal DB is not permission protected Write to critical area Unauthorized access to private resources Contact Manager App Android Framework Setting Update Receiver Private Storage KeyValue VoIP_Prefix“1234” Is_App_Lisence d false

Code Example CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 9 9 Malicious app: Ibinder binder; /* Connect to the service */ … /* Send message to the service */ Messenger mMessenger = new Messenger(binder) mMessenger.send(msg); Component Hijacking vulnerable app

Data flow view CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 10 GetLastLocation (Sensitive Source) Message (Input Source) currLoc (GV) SendParams (Transit sink) params (Transit Source) HTTPClient Execute (critical sink)

Chain of components.  A data-flow perspective  Component hijacking  read/write protected or private data via exported components  Detecting component hijacking  finding “hijack-enabling flows” CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 11 App Android Framework Private Protected

App entry points  Points where transfers the control to the app.  Start point  Callbacks CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 12 App launch points Component lifecycle callbacks UI event handlers Asynchronou s constructs Others Definition: App entry points are the methods that are defined by the app and intended to be called only by the framework.

Challenges  Reliably discovering all types of entry points (or event handlers) in their completeness  Soundly modeling the asynchronous invocations of entry points for analysis.  Assess the collective side-effects of individual data flows and identifying the converged flow of interest  Tracking data flows across splits and components (different thread, do in the background) CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 13

More complex view CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 14 GetLastLocation (Sensitive Source) Message (Input Source) currLoc (GV) SendParams (Transit sink) params (Transit Source) HTTPClient Execute (critical sink) currLoc (GV) Entry Point Handle Message Background, New thread

Capability Leak 15

Capability Leaks Capability Leak: A situation where an app can gain access to a restricted API without requesting proper permission Explicit Capability Leak: Broadening access to a restricted API by exposing it via another API Implicit Capability Leak: Inheriting permissions from other applications

Explicit Capability Leaks

Implicit Capability Leaks Applications don't have permissions, user identifiers (UIDs) do.

CHEX Design CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 19

Related Work Limitations  Only protected resources being checked.  No completeness in entry point discovery.  No in-depth analysis. Simply checking the usage of exported methods in the component.  No scalability methods  Only test on small set of apps. CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 20

Major Contributions  Designed a sound method which automatically discovers all types of app entry points with low false rate.  Designed a method to model the interleaved execution of the multiple entry points and track data flow between them.  Build CHEX, a in-depth, scalable, context-sensitive, flow-sensitive static app vetting tool for component hijacking vulnerabilities and tested on large set of apps. CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 21

Dalysis: Dalvik Analysis Framework  Consumes off-the-shelf Android app package (.apk)  Generates SSA IR (adopted from WALA)  Supports extensible backend for multiple types analysis tasks CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 22 Class hierarchy Instructions Meta data Constants Parse manifest Disassemble bytecode (DexLib) Instruction translation Abstract interpretation SSA conversion SSA IR Frontend Backend Point-to analysis Call graph builder SDG builder …

Entry point discovery Observation: only two ways to “register” entry points  Declaring them in the manifest file (parse manifest)  Overriding/implementing the designated interfaces CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 23 Unused methods overriding framework Entry points Dead code  How to distinguish?  Containing class is instantiated  Original interface is never called by app

Entry point discovery CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 24 Unused methods overriding framework Entry points Unused methods overriding framework Entry points

App splitting  Modeling app execution by permuting split executions in all feasible orders  Why reasonable?  Most splits cannot be interleaved  Efficient pruning techniques CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 25 App Android Framework Definition: A split is a subset of the app code that is reachable from an entry point.

SDS and PDS Permutation Data-flow Summary (PDS)  Linking two adjacent SDSs in a feasible permutation CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 26 G1 Src1 G1 Sink1 Src1 G1 Sink1 Split Data-flow Summary (SDS)  Intra-split data-flows that start and end at heap variables, sources, or sinks. When permutation ends, all possible data-flows have been enumerated.

Example CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 27

Identifying “hijack-enabling flows”  Using descriptive policies to specify flows of interests CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 28 … Sensitive source Public Sink … Input Critical Sink … Input Sensitive Source Input- specified sink Critical Sink

Performance  Median processing time: 37sec  22% apps took >5min Accuracy  254/5,486 flagged as vulnerable  True positive rate: 81%  254/5,486 flagged as vulnerable  True positive rate: 81% Evaluations CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 29  5,486 apps from the official and alternative markets  Hardware spec: Intel Core i7-970 with 12GB RAM Insights  50 entry points of 44 types per app  99.7% apps contain inter-split data-flows

Vulnerabilities found CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 30 Attack Class Representative cases Data TheftSending GPS data to URL specified by input string Capability Leak Input string used as hostname for socket connection Code Injection Input string used for raw SQL query statement Input string used as shell command Intent ProxyObject embedded in input used to start Activity Data tamperingInput string submitted to server as game score

False positives  Sophisticated request validations  Infeasible split permutations False negatives  Control-flow driven hijacks Discussions CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 31

Capability Leaks CHEX: Statically Vetting Android Apps for Component Hijacking Vulnerabilities 32

Detecting Capability Leaks Android SDK gives us no tools! Function composition Capability leak: g(x) = f(x) + some other stuff Intuitive Algorithm 1. Find interesting (dangerous) APIs (f(x)) 2. Find new API definitions (g(x)) 3. Link them!

System Overview

Possible Path Identification 1. Construct a control-flow graph 1. Find all paths from an IPC entry point to an API of interest

Possible Path Identification: Challenges Object references Class hierarchy used to conservatively resolve references Extensive use of callbacks Use framework knowledge to stitch together callbacks

Infeasible Path Pruning Many potential paths exist Most are either impossible or uninteresting Must prune these uninteresting paths Branch conditions need an understanding of program data-flow Explicit permission checks are “infeasible paths” Approach: Symbolic Path Simulation

Symbolic Path Simulation

Results

Case Studies Explicit Capability Leaks (Without Arguments) Explicit Capability Leaks (With Arguments) Implicit Capability Leaks

Explicit Capability Leaks (Without Arguments) Samsung Epic 4G Pre-loaded app, com.sec.android.app.Selective-Reset  Displays reset confirmation screen SelectiveResetReceiver class  Listens for Android.intent.action.SELECTIVE_RESET Intent, then waits for confirmation  Starts SelectiveResetService, then listens for android.intent.action.SELECTIVE_RESET_DONE  This calls CheckInService.masterClear()

Explicit Capability Leaks (With Arguments) HTC capability leaks SEND_SMS CALL_PHONE RECORD_AUDIO Similar formats Exercised capability takes a number of arguments, certain components can be passed in Intent.

Explicit Capability Leaks (With Arguments)

Implicit Capability Leaks HTC Wildfire S Built-in MessageTab app, com.android.MessageTab  CALL_PRIVILEGED capability  It is used to manage phone's SMS messages, but for convenience allows the user to dial contacts directly through a “contact details” screen  Does not request CALL_PHONE or CALL_PRIVILEGED in its manifest  BUT! It does declare a sharedUserId attribute android.uid.shared  Shared with several core Android apps, including com.android.htcdialer, which has both phone-dialing permissions

Future Work and Improvement Handle native code in addition to Dalvik bytecode Expand permission set, only 13 now Chained capability leaks App-defined permissions Expand to include third-party user apps