Lecture 14
Android Permissions Demystified Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner
Advanced Operating Systems
9 January, 2013
SOA/OS Lecture No, Android Permissions Demystified 1/41
Lecture 14 Android Permissions Demystified Adrienne Porter Felt, - - PowerPoint PPT Presentation
Lecture 14 Android Permissions Demystified Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner Advanced Operating Systems 9 January, 2013 SOA/OS Lecture No, Android Permissions Demystified 1/41 Introduction Android
SOA/OS Lecture No, Android Permissions Demystified 1/41
SOA/OS Lecture No, Android Permissions Demystified 2/41
SOA/OS Lecture No, Android Permissions Demystified 3/41
SOA/OS Lecture No, Android Permissions Demystified 4/41
◮ Linux process, address space ◮ VM (Dalvik Virtual Machine) for each application ◮ unique Linux user ID ◮ direct access only to its own data ◮ API-based access to other apps’ resources
SOA/OS Lecture No, Android Permissions Demystified 5/41
◮ low memory consumption ◮ Dex results in smaller binaries than JAR
SOA/OS Lecture No, Android Permissions Demystified 6/41
SOA/OS Lecture No, Android Permissions Demystified 7/41
SOA/OS Lecture No, Android Permissions Demystified 8/41
◮ active (running) ◮ paused ◮ stopped - still resides in memory ◮ killed - removed from memory
SOA/OS Lecture No, Android Permissions Demystified 9/41
SOA/OS Lecture No, Android Permissions Demystified 10/41
SOA/OS Lecture No, Android Permissions Demystified 11/41
SOA/OS Lecture No, Android Permissions Demystified 12/41
◮ Used for inter-component signaling, extend Intent class ◮ Used for starting activities, services and broadcast messages ◮ Contain actions to be performed and data for these actions ◮ Specified in the AndroidManifest file
SOA/OS Lecture No, Android Permissions Demystified 13/41
◮ application’s name, icon, labels ◮ linked libraries ◮ application components: <activity>, <service>,
◮ Activity shown at launch time ◮ Intent filters ◮ Permissions
SOA/OS Lecture No, Android Permissions Demystified 14/41
SOA/OS Lecture No, Android Permissions Demystified 15/41
SOA/OS Lecture No, Android Permissions Demystified 16/41
◮ declared in the AndroidManifest file ◮ can not be changed after installation ◮ 4 protection levels ◮ normal - always granted ◮ dangerous - requires user approval ◮ signature - matching certificate ◮ signature or system - matching certificate with system image
SOA/OS Lecture No, Android Permissions Demystified 17/41
◮ e.g API for access to phone’s hardware
◮ name conflicts may appear ◮ current research on Android permissions doesn’t take them
1http://developer.android.com/reference/android/Manifest.permission.html
SOA/OS Lecture No, Android Permissions Demystified 18/41
◮ restricts access to the activity ◮ checked when starting activity ◮ throw SecurityException if caller does not have required
◮ restricts who can start, stop or bind to the service
◮ restricts who can send broadcasts to the BroadcastReceiver ◮ checked at delivery, after broadcast was sent ◮ does not throw exception in case of permission failure
◮ restrict who can access the data ◮ read and write permissions ◮ checked when performing operations(e.g. query, insert)
SOA/OS Lecture No, Android Permissions Demystified 19/41
◮ permission label as parameter to the sending method
◮ checkPermission methods ◮ check against PID, package name
◮ Provide finer control over content sharing ◮ Record level delegation ◮ Set flags in the Intent that allow access ◮ example: view mail attachments
SOA/OS Lecture No, Android Permissions Demystified 20/41
SOA/OS Lecture No, Android Permissions Demystified 21/41
SOA/OS Lecture No, Android Permissions Demystified 22/41
SOA/OS Lecture No, Android Permissions Demystified 23/41
SOA/OS Lecture No, Android Permissions Demystified 24/41
◮ Randoop unit test generator ◮ full coverage of the test space ◮ use return values as parameters for other methods ◮ limitations
◮ custom tool for building methods unit tests ◮ allows manual adjustments of test sequences - order,
SOA/OS Lecture No, Android Permissions Demystified 25/41
◮ solves inconsistencies ◮ argument-dependent permission requirment ◮ API calls order-dependent ◮ test cases with and without permissions ◮ identified methods that require INTERNET permission ◮ tests run until no security exceptions appeared
SOA/OS Lecture No, Android Permissions Demystified 26/41
◮ collected all URIs ◮ test operations: query, insert, update, delete ◮ run test with and without permissions ◮ tests run until no security exceptions appeared
SOA/OS Lecture No, Android Permissions Demystified 27/41
◮ 1259 API calls with permission checks ◮ only 78 methods with permission requirments in the
◮ documentation for 6 API calls is incorrect
◮ system permissions, hierarchical permissions, unused
◮ number of checks, permissions granularity
SOA/OS Lecture No, Android Permissions Demystified 28/41
SOA/OS Lecture No, Android Permissions Demystified 29/41
◮ easy to parse method calls
SOA/OS Lecture No, Android Permissions Demystified 30/41
◮ Java Reflection ◮ use heuristics ◮ Internet and External Storage permissions ◮ enforced by the kernel not the middleware checker ◮ Stowaway parses the app’s XML files
SOA/OS Lecture No, Android Permissions Demystified 31/41
◮ detects strings with ”content://” ◮ detects URI API constants
SOA/OS Lecture No, Android Permissions Demystified 32/41
◮ permission to send Intent ◮ permission to receive Intent 2developed by the same authors - http://www.comdroid.org/
SOA/OS Lecture No, Android Permissions Demystified 33/41
◮ 40 apps - Stowaway vs manual analysis ◮ 900 apps - automated analysis
◮ 56% declare one extra permission ◮ 94% have 4 or fewer extra permissions
SOA/OS Lecture No, Android Permissions Demystified 34/41
SOA/OS Lecture No, Android Permissions Demystified 35/41
◮ request permissions in pairs when only one is required
◮ the deputy app requires the permission ◮ the sender app doesn’t need to declare the permission ◮ e.g. INSTALL PACKAGES - Google Play app installs packages
SOA/OS Lecture No, Android Permissions Demystified 36/41
◮ app uses only getters but declares the WRITE ... permission
◮ ACCESS MOCK LOCATION
SOA/OS Lecture No, Android Permissions Demystified 37/41
SOA/OS Lecture No, Android Permissions Demystified 38/41
SOA/OS Lecture No, Android Permissions Demystified 39/41
SOA/OS Lecture No, Android Permissions Demystified 40/41
SOA/OS Lecture No, Android Permissions Demystified 41/41