dr android and mr hide
play

Dr. Android and Mr. Hide: Fine-grained Permissions in Android - PowerPoint PPT Presentation

Dr. Android and Mr. Hide: Fine-grained Permissions in Android Applications Jinseong Jeon * , Kristopher K. Micinski * , Jeffrey A. Vaughan # , Ari Fogel + , Nikhilesh Reddy + , Jeffrey S. Foster * , and Todd Millstein + . * University of Maryland,


  1. Dr. Android and Mr. Hide: Fine-grained Permissions in Android Applications Jinseong Jeon * , Kristopher K. Micinski * , Jeffrey A. Vaughan # , Ari Fogel + , Nikhilesh Reddy + , Jeffrey S. Foster * , and Todd Millstein + . * University of Maryland, College Park # LogicBlox (work performed while the author was at UCLA) + University of California, Los Angeles

  2. Permissions on Android ¤ Permissions associated with resources and OS features ¤ Internet, GPS, telephony, … ¤ Permissions granted at install time ¤ once granted, apps can use such permissions any way they want ¤ Example: GasBuddy app ¤ Internet ¤ to access to gasbuddy.com ¤ Location ¤ to find cheapest gas near users ¤ Phone state ¤ to access phone’s unique ID 2

  3. Proposal: Finer-grained Permissions ¤ Hypothesis: permissions are too broad ¤ GasBuddy has access to entire Internet ¤ But, only needs access to gasbuddy.com ¤ Our goal: add finer-grained permissions ¤ Help app developers ¤ improve apps’ robustness against security exploits ¤ attest to apps’ proper usage of permissions ¤ Help users ¤ understand how apps use permissions ¤ Add permissions without changing platform 3

  4. Example Finer-grained Permissions ¤ Internet è InternetURL ( d ) ¤ InternetURL(gasbuddy_com) ¤ GPS è LocationBlock ¤ 150m resolution (city block) ¤ Phone state è PhoneState(p) ¤ PhoneState(UniqueID) 4

  5. Our Tool Chain org.apk install time runtime Mr. Hide Dr. Android services enh.apk Process boundary RefineDroid ¤ RefineDroid infers how permissions are used in the app ¤ Dr. Android retrofits the app with fine-grained permissions ¤ Mr. Hide enforces fine-grained permissions at runtime 5

  6. Fine-grained Permissions in Mr. Hide Android Full Fine-grained… …in Mr. Hide Permissions Capabilities INTERNET any sites particular domains InternetURL(d) LOCATION exact location block resolution LocationBlock READ_PHONE_STATE all kinds only (e.g.) IMEI ReadPhoneState(p) READ_CONTACT all records specific fields ContactCol(c) WRITE_SETTINGS all kinds only (e.g.) ringtone WriteSettings(s) 6

  7. RefineDroid ¤ infers how permissions are used ¤ string analysis to search URL-like strings ¤ constant propagation analysis to determine key parameters to privileged APIs ¤ e.g. for system settings: Uri uri = Uri.parse (‘‘ my ringtone.mp3’’); RingtoneManager.setActualDefaultRingtoneUri( this , RingtoneManager.TYPE ALARM, uri); String path = uri. toString (); Settings .System.putString( getContentResolver (), Settings .System.RINGTONE, path); 7

  8. Permission Usage in the Wild ¤ 750 apps: 24 free apps in each Google Play category ¤ some (e.g. 44 for write settings) apps are over-privileged ¤ use far narrower capabilities than available ¤ a few popular items are used frequently Settings popularity ♬ 40 15 App count 30 10 20 5 10 0 0 0 5 10 15 20 0 2 4 6 8 10 ith most popular settings Settings used 8

  9. Mr. Hide Process boundary app Mr. Hide services System.Settings.putString(…) hidelib.Settings.putString(…) System.Settings.putString(…) hidelib Kernel boundary Sensitive Android APIs ¤ the Hide interface to the droid environment ¤ services ¤ interact with a client app and resources ¤ client-side library ¤ a drop-in replacement for sensitive APIs 9

  10. Dr. Android hidelib.dex Bytecode Rewriter classes.dex input.apk output.apk Manifest Rewriter manifest.xml ¤ Dalvik Rewriter for Android ¤ injects hidelib.dex ¤ modifies the app’s bytecode to use Mr. Hide ¤ removes Android perms. and adds Mr. Hide perms. 10

  11. Case Studies Brightest Flashlight Ultimate Flashlight Google Sky Map Angry Birds Rio Baby Monitor Angry Birds Radar Now! Task Killer GasBuddy Horoscope Amazon ASTRO Qrdroid Shazam built-in Android perm. INTERNET # # # : can be replaced READ CONTACTS ACCESS * LOCATION ¢ : cannot be replaced READ PHONE STATE # ✗ : over-privileged WRITE SETTINGS 8 InternetURL( · ) 4 4 4 4 4 4 4 4 4 4 4 fine-grained perm. ContactCol( · ) 4 4 4 ✔ : needed, and LocationBlock 4 4 4 4 4 4 4 being used ReadPhoneState( UniqueID ) 4 4 4 4 4 4 4 4 WriteSettings( Ringtone ) 4 ¤ 14 case studies ¤ which exercise our fine-grained permissions ¤ 31 out of 35 usages of perms. are replaced ¤ not always appropriate: e.g. sftp feature of ASTRO 11

  12. Transformation Time Name ) # Ins # Chg Tm (s) Amazon 88 114,691 174 17.86 Angry Birds ,018 79,311 760 11.44 Angry Birds Rio ,716 173,441 968 21.92 ASTRO 48 149,911 695 18.30 Baby Monitor 1 12,378 1 3.81 Gas Buddy 69 67,514 222 11.81 Horoscope 31 92,441 829 12.73 Shazam 04 259,643 778 30.67 Google Sky Map 12 33,355 193 8.38 Task Killer 99 9,696 76 6.10 Brightest Flashlight 56 174,159 1,265 18.94 Ultimate Flashlight 87 46,878 464 8.26 Qrdroid 02 105,400 11 9.05 Radar Now! 9 26,706 121 7.66 ¤ small changes are enough ¤ thanks to Mr. Hide’s clean drop-in replacements ¤ fast enough for offline use 12

  13. Correctness of Transformation ¤ Applied RefineDroid-Dr.Android-Mr.Hide and then run the apps manually ¤ Rewritten apps pass the Dalvik verifier ¤ Almost all activities of apps function normally, with no observable changes ¤ Limitations ¤ small behavioral differences due to WebView Mr. Hide didn’t support ¤ performance overhead due to IPC ¤ but not that significant in practice 13

  14. Conclusion ¤ …Fine-grained Permissions ¤ RefineDroid , a static analyzer to infer … ¤ Mr. Hide , clean interfaces to enforce … ¤ Dr. Android , a bytecode rewriter to retrofit … ¤ Broader uses ¤ can be enhanced to check suspicious perm. usage ¤ other security policies ¤ inserting mock data, changing policies at run-time, etc. ¤ general support for modifying Dalvik bytecode ¤ http://www.cs.umd.edu/projects/PL/redexer/ ¤ Hiring postdoc ¤ http://www.cs.umd.edu/~jfoster/postdoc.shtml 14

  15. Android Popularity ¤ Android , the most popular smartphone platform ¤ 64.1% market share (2Q12) 1 , 675K apps, 25B installs 2 1 http://www.gartner.com/it/page.jsp?id=2120015 2 http://officialandroid.blogspot.com/2012/09/google-play-hits-25-billion-downloads.html 15

  16. Overview (1) RefineDroid : light-weight analysis to infer the app’s perm. usages (1) (2) Dr. Android : bytecode transformer anal. Dr. Android result to retrofit the app w/ fine-grained perm. (3) Mr. Hide : easy-to-replace interfaces to enforce fine-grained perm. (2) RefineDroid Process boundary app …Manager Mr. Hide services p p perm Perm Check hidelib (3) Kernel boundary IPC rsrc 16

  17. category fine-grained Taxonomy Android perm. strategies 1 Outside 2 Structured InternetURL( d ) ContactCol(c) Resources User Info. INTERNET, SMS, whitelist filtering-out by BLUETOOTH, NFC, CALANDER, CONTACT, ACCOUNTS, LOGS, … EXTERNAL_STORAGE, or blacklist conditions … 4 System ReadPhoneState(p) 3 Sensors LocationBlock WriteSettings(s) State/Settings reducing the LOCATION, CAMEAR, BOOKMARKS, subset AUDIO, … SETTINGS, *_STATES, … fidelity (e.g., blur) 17

  18. RefineDroid ¤ A static analysis tool ¤ infers which fine-grained permissions are used ¤ InternetURL( d ), ContactCol( c ), ReadPhoneState( p ), WriteSettings( s ) ¤ via simple analyses ¤ string analysis to search URL-like strings ¤ constant propagation analysis to determine key parameters to privileged APIs Uri uri = Uri.parse (‘‘ my ringtone.mp3’’); Cursor c = getContentResolver() TelephonyManager tm = RingtoneManager.setActualDefaultRingtoneUri( .query( uri , projections , selection , ...); (TelephonyManager) getSystemService( this , RingtoneManager.TYPE ALARM, uri); Context.TELEPHONY SERVICE); String path = uri. toString (); int index = c.getColumnIndex( String id = tm.getDeviceId(); Settings .System.putString( ContactsContract.PhoneLookup.NUMBER); tm. listen ( new PhoneStateListener() { ... } , getContentResolver (), String id = c.getString(index ); PhoneStateListener.LISTEN CALL STATE); Settings .System.RINGTONE, path); (a) Contacts (b) Phone state (c) System settings 18

  19. Over-privileged ¤ apps use far fewer capabilities than available 80 20 60 15 App count App count 40 10 5 20 0 0 0 20 40 100 1000 0 10 20 30 Static domains used Contacts columns used 40 150 App count App count 30 100 20 50 10 0 0 0 2 4 6 8 0 2 4 6 8 10 Phone states used Settings used 19

  20. Popularity ¤ few popular items are used _id Apps using domain Column popularity 100 100 type Domain N google.com 457 admob.com 324 10 50 gstatic.com 311 facebook.com 256 android.com 207 1 0 … 0 20 40 60 80 1 10 100 1000 ith most popular static domain ith most popular contact column Phone state popularity IMEI 400 Settings popularity ♬ 15 300 10 # 200 5 100 0 0 0 5 10 0 5 10 15 20 ith most popular phone state ith most popular settings 20

  21. Mr. Hide process boundary Mr. Hide app hidelib service (direct access removed) Sensitive Android APIs ¤ the Hide interface to the droid environment ¤ services ¤ interact with a client app and resources ¤ strong guarantee of permission enforcement ¤ client-side library ¤ a drop-in replacement for sensitive APIs 21

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend