PScout: Analyzing the Android Permission Specification

Slides:



Advertisements
Similar presentations
Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Advertisements

Android OS : Core Concepts Dr. Jeyakesavan Veerasamy Sr. Lecturer University of Texas at Dallas
Code Injection Attacks on HTML5-based Mobile Apps: Characterization, Detection and Mitigation Xing Jin, Xunchao Hu, Kailiang Ying, Wenliang Du, Heng Yin,
Cosc 5/4730 Android Maps v2. Maps V1 and V2 In March 2013 google removed the ability to get a map key for version 1. Version 2 had been introduced in.
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Resource Containers: A new Facility for Resource Management in Server Systems G. Banga, P. Druschel,
Presented By Abhishek Singh Computer Science Department Kent state University WILLIAM ENCK, MACHIGAR ONGTANG, AND PATRICK MCDANIEL.
Software Modeling SWE5441 Lecture 3 Eng. Mohammed Timraz
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
Android Security. N-Degree of Separation Applications can be thought as composed by Main Functionality Several Non-functional Concerns Security is a non-functional.
Mobile Application Development
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Android Security Enforcement and Refinement. Android Applications --- Example Example of location-sensitive social networking application for mobile phones.
Case study 2 Android – Mobile OS.
William Enck, Machigar Ongtang, and Patrick McDaniel.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Understanding Android Security Yinshu Wu William Enck, Machigar Ongtang, and PatrickMcDaniel Pennsylvania State University.
A METHODOLOGY FOR EMPIRICAL ANALYSIS OF PERMISSION-BASED SECURITY MODELS AND ITS APPLICATION TO ANDROID.
Introducing the Sudoku Example
Lei Wu, Michael Grace, Yajin Zhou, Chiachih Wu, Xuxian Jiang Department of Computer Science North Carolina State University CCS 2013.
Detecting and Preventing Privilege- Escalation on Android Jiaojiao Fu 1.
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Introduction Overview Static analysis Memory analysis Kernel integrity checking Implementation and evaluation Limitations and future work Conclusions.
AMNESIA: Analysis and Monitoring for NEutralizing SQL- Injection Attacks Published by Wiliam Halfond and Alessandro Orso Presented by El Shibani Omar CS691.
Data Storage: Part 4 (Content Providers). Content Providers Content providers allow the sharing of data between applications. Inter-process communication.
DeepDroid: Dynamically Enforcing Enterprise Policy on Android Devices Fall 2015 Instructor: Kun Sun, Ph.D.
A NDROID P ERMISSIONS D EMYSTIFIED Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner University of California ACM CCS /09/20.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
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 Secure Mobile Applications for Android CS 595 James Zachary Howland.
Overview of Android Application Development
Leave Me Alone: App-level Protection Against
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Next-generation databases Active databases: when a particular event occurs and given conditions are satisfied then some actions are executed. An active.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
Android Security Model that Provide a Base Operating System Presented: Hayder Abdulhameed.
The Fail-Safe C to Java translator Yuhki Kamijima (Tohoku Univ.)
Mobile Application Security on Android Originally presented by Jesse Burns at Black Hat
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Software Design Chapter 11. Purposes of Design Design transforms the specification into a design. The end purpose of the design is to produce detail and.
Android Permissions Demystified
Streaming Big Data with Self-Adjusting Computation Umut A. Acar, Yan Chen DDFP January 2014 SNU IDB Lab. Namyoon Kim.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Power Guru: Implementing Smart Power Management on the Android Platform Written by Raef Mchaymech.
Race conditions and synchronization issues Exploiting UNIX.
Lecture 2: Android Concepts
Analyzing Input Validation vulnerabilities in Android System Services NAMJUN PARK (NPAR350)
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Item Based Recommender System SUPERVISED BY: DR. MANISH KUMAR BAJPAI TARUN BHATIA ( ) VAIBHAV JAISWAL( )
INFORMATION-FLOW ANALYSIS OF ANDROID APPLICATIONS IN DROIDSAFE JARED YOUNG.
ANDROID ACCESS CONTROL Presented by: Justin Williams Masters of Computer Science Candidate.
Why Learn Android? Largest installation base of any operating system Over 20,000 Android devices exist Businesses will likely move more to device-based.
More Security and Programming Language Work on SmartPhones
Android Mobile Application Development
Lecture 2: Android Concepts
Android 01: Fundamentals
Understanding Android Security
Android Runtime – Dalvik VM
Activities and Intents
Systematic Detection of capability leaks in stock android smartphones
Relations.
Relations for functions.
Activities and Intents
Objectives The student will be able to:
Understanding Android Security
Lecture 2: Android Concepts
Objectives The student will be able to:
Presentation transcript:

PScout: Analyzing the Android Permission Specification

Outline Key questions Android permission system PScout design and implementation Answer to key questions

Key Questions Are there any redundant permissions? Are undocumented APIs used? Undocumented APIs are APIs that are not listed in the Android API reference How complex is the Android specification? How are permission mappings interconnected? How has it evolved over time? They developed a tool called pscout which extracts the permissions specification from the android OS source code, by using the tool they try to answering these questions. Because the documentation of android’s permission system is incomplete and complete mapping not available due to incomplete documentation. An intent is exactly what it describes. It’s an “intention” to do an action. An intent is basically a message to say you did or want something to happened. Depending on the intent apps or the OS might be listening for it and will react accordingly. For example, you send a email to bunch of friends, in which you tell your friend John to do something, the other people will ignore the email, but John will react to it. One android process can call a routine in another android process, using binder to indentify the method to invoke and pass the arguments between processes.

Outline Key questions Android permission system PScout design and implementation Answer to key questions

Android Permission System API to permission mapping: Android.net.wifi.WifiManager.reassociate(); CHANGE_WIFI_STATE Android.telephony.TelephonyManager.getDeviceId(); READ_PHONE_STATE Complete mapping NOT available due to incomplete documentation

Outline Key questions Android permission system PScout design and implementation Answer to key questions

PScout Design and Implementation PScout produces a permission specification Set of mapping (set of API calls and set of permissions) Three Phases Permission Check Identification Call graph Generation Reachability Analysis Pscout produces a permission specification that is a set of mappings between elements in the set of API calls and the set of permissions that third party applications may request. The extraction of the permission specification from the android framework has three phases. First, Pscout identifies all the permission checks in the android framework and label them with the permission that is being checked. Then, it builds a call graph over the entire android framework including IPC and RPC. Finally, it performs a backwards reachability traversal over the graph to identify all API calls that could reach a particular permission check. In some case the reachability traversal may find additional permission checks that were missed in the first phase. As a result, the reachability analysis is repeated until the number of permission checks converges.

Permission Check Identification (1) Explicit Call Permission strings and App’s User ID -> checkPermission Intents Permission (send/receive) in AndroidManifest Permission (send/receive) expressed programmatically E.g. sendBroadcast E.g. registerReceiver Content Provider Parse the manifest file Android has three types of operations that will succeed or fail depending on the permissions held by an application, 1) an explicit call to checkPermission function that checks for the presence of a permission, 2) methods involving Intents and 3) methods involving content providers. They abstract each of these into a permission check that indicates that a certain permission must be held at that point by the application. Permissions in Android appear as string literals in the framework source code and values of the permissions strings are documented by Google. The strings are passed to the checkPermission function along with the application’s user ID(UID) and the function checks if an application with the UID holds the specified permission. The first step of identifying this type of permission check is to find all instances of permission string literals in the framework source. These permission string literals are passed directly to checkpermission function, which Pscout then abstracts as a permission check. Sending and receiving of Intents may require permissions. This requirement can be expressed ways. First, a requirement to hold a permission to send or receive an Intent can be specified in the Manifest file. Second, permission to send or receive an intent can be expressed programmatically when the method to send or receive an intent is called. For example, to send an intent, an application may call sendBroadcast with an optional permission string that specifies that the receiver of the intent must hold that permission. Similarly, to receive intents, an application may call registerReceiver with an optional permission string that specifies that the sender of the intent must hold that permission. By extracting information from the manifest file and invocations of sendBroadcast and registerReceiver, Pscout builds a global mapping between permissions and the Intent action strings. Since this mapping tells Pscout which Intent actions strings require permissions to send or receive, pscout abstracts any send or receive such an intent as a permission check. (the type of permission that is being checked is computed by translating the action string of the Intent being sent or received into android permission.) Methods that implicitly access a content provider protected by a permission are categorized as content provider permission checks. To access a content provider, an URI object designating the recipient content provider is passed to contentResolver class, which then provides a reference to the content provider targeted by the URI object. Each content provider declares the permissions required to read and write to it in its manifest file. So Pscout parse the manifest file to extract this information. Pscout constructs a mapping of content provider URIs to permissions.

Call Graph Generation (2) Entire Android framework Refined with RPC/IPC information RPC (remote procedure call) is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another process without the programmer explicitly coding the detail for this remote interaction.

Reachability: Starting Points Permission check definition: An execution point in the OS after which the calling application must have the required permission Three Type Explicit calls to checkPermission functions Sending/receiving of specific intents Accesses to specific content providers Finally, pscout performs a backward reachability analysis starting from the permission checks. Pscout creates a mapping for every method that can be reached via a path from a permission check. However, not every method is an API that can be called by a third party application, because permission protected resources typically reside in system services, which can only be reached by third party applications via an RPC or through IPCs using intents. Thus any path from a permission check that does not cross a process boundary is filtered from pscout’s specification. The backward reachability analysis continues until one of three stopping conditions is met.

Reachability: Stopping Conditions Method caller ID is temporary cleared Permission enforcement always pass when caller ID is cleared in system processes First, any calls to checkpermission and its wrappers always succeed if they are between calls to clearCallingIdentity and restorecallingidentity, because these functions temporarily set the UID to the system services. As a result, any call path that passes through a function called between these two functions will always pass a permission check. Thus it is not necessary to perform any reachability analysis beyond one of these points and any method called between the clearcallingidentity and restorecallingidentity function is a stopping point.

Reachability: Stopping Condition Reached content provider subclasses Second access to a content provider is made with a virtual call to the generic(类的) class. Pscout stops reachability traversal when it reaches a class or subclass of contentprovider. At this point, pscout infers the URI string of the content provider and associates that URI with the permission of permission check where the reachability analysis started. Thus access to the contentprovider found on the reachability path is abstracted to a content provider permission check and pscout iterates the reachability analysis until it converges.

Reachability: Stopping Conditions Reached generic parent classes of documented APIs Finally, documented APIs often have a generic parent class that is called by many other methods, as a result, once a documented API is reached, calls to its parent class methods are excluded from the analysis.

PScout Design and Implementation Time (33 hours) Environment Android 4.0 framework Intel Core 2 Duo 2.53 GHz CPU 4 GB memory Pscout extracts a permission specification from the Andorid 4.0 Framework on an Intel Core 2 Duo 2.53 GHz CPU with 4 GB memory in 33 hours. The vast majority of time is spent in two iterations of using Soot to extract information needed by Pscout from the bytecode. Since each bytecode file is analyzed independently, the total soot analysis time scales linearly with the number of classes and each file takes about 4 seconds to process. The rest of Pscount’s analysis completes within 30 minutes.

Outline Key questions Android permission system PScout design and implementation Answer to key questions Conclusion

Key Questions Are there any redundant permissions? Are undocumented APIs used? Undocumented APIs are APIs that are not listed in the Android API reference. How complex is the Android specification? How has it evolved over time? They run pscout on four version of andorid and summarized the results of the extracted permission specifications. They analyze the extracted specifications to try and answer the four main questions.

Q1: Redundancy in Permissions? Conditional Probability P(Y|X) = ? Given an API that checks for permission X, what is the probability that the same API also check for Permission Y? 79 permissions (Andorid 4.0) -> 6162 pairs of permissions To answer whether the permission are redundancy, they compute the conditional probability of all pairs of android permissions across their API mappings.

Q1: Redundancy in Permissions? Redundant Relationship Both permissions are always checked together P(Y|X) = 100% and P(X|Y) = 100% Only 1 pair found: KILL_BACKGROUND_PROCESSES and RESTART_PACKAGES RESTART_PACKAGES is a deprecated permission Only one of the permission pairs, kill_background_processes and restart_packages is truly redundant. Both permissions are checked by the same set of APIs. Which means that we can just request one permission, instead of two permissions. The android documentation indicates that the API requiring restart_packages has been deprecated and replaced with an API that requires kill_background_process.

Q1: Redundancy in Permissions? Implicative Relationship All APIs that check for permission X also checks for Permission Y P(Y|X) = 100% and P(X|Y) = ? Found 13 pairs Many write permissions imply read permissions for content providers E.g. WRITE_CONTACTS implies READ_CONTACTS They define two types of correlations between permissions: first one is implicative relationship that all APIs that check for permission X also check for the permission Y

Q1: Redundancy in Permissions? Reciprocative Relationship The checking of either permission by an API means the other permission is also likely checked P(Y|X)>90% and P(X|Y) >90% Found 1 pair: ACCESS_COARSE_LOCATION vs. ACCESS_FINE_LOCATION Another correlation between permissions is reciprocate relationship that the checking of either permission by an API means that the other permission will also be checked with a probability higher than 90%).

Q1: Redundancy in Permissions? 15/6162 all possible pairs of permission demonstrates to have close correlation. There is little redundancy in the Android permission system.

Q2: Undocumented API usage? 22-26% of the declared permissions are only checked through undocumented APIs Can be hidden from most developers E.g. SET_ALWAYS_FINISH, SET_DEBUG_APP are moved to system level permission in Android 4.1 3.7% applications use undocumented APIs Undocumented APIs are rarely used in real applications, some permissions can be hidden.

Q3: Specification complexity 75% of permission map to <20 API calls Permissions guards specific functionalities

Q3: Specification complexity >80% APIs require only 1 permission, few need more than 3 Sensitive APIs have relatively distinct functionality

Q3: Specification complexity Few overlaps in the permission mapping Android permission specification is simple.

Q4: Changes over time Permission checks grew proportionally with code size between 2.2 and 4.0 More sensitive functionality are exposed through documented APIs over time New APIs introduced with permissions Undocumented -> documented API mapping Existing APIs + new permission requirements

Q4: Changes over time Small changes can lead to permission changes No fundamental changes in API functionality

Q4: Changes over time Tradeoff between fine-grain permission and permission specification stability E.g. combining the BLUETOOTH and BLUETOOTH_ADMIN permission can prevent the permission change between 2.2 and 2.3 but reduces the least-privilege protection

Outline Key questions Android permission system PScout design and implementation Answer to key questions Conclusion

Conclusion PScout extracts the Android permission specifications of multiple Android versions using static analysis. Results show that the extracted specification is more complete than existing mappings Error from static analysis imprecision is small There is little redundancy in the Android permission systems. Few application developer use undocumented APIs which some permissions are only required through undocumented APIs. There is a tradeoff between fine-grain permission and permission specification stability.

Question?