Automatic Mediation Of Privacy-sensitive Resource Access In Smartphone Applications Ben Livshits and Jaeyeon Jung Microsoft Research.

Slides:



Advertisements
Similar presentations
De necessariis pre condiciones consequentia sine machina P. Consobrinus, R. Consobrinus M. Aquilifer, F. Oratio.
Advertisements

Modular and Verified Automatic Program Repair Francesco Logozzo, Thomas Ball RiSE - Microsoft Research Redmond.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Program Slicing Mark Weiser and Precise Dynamic Slicing Algorithms Xiangyu Zhang, Rajiv Gupta & Youtao Zhang Presented by Harini Ramaprasad.
Presented By: Krishna Balasubramanian
1 Appendix A: Writing and Submitting SAS ® Programs A.1 Writing and Submitting SAS Programs.
Best-First Search: Agendas
Searching and Sorting Topics  Sequential Search on an Unordered File  Sequential Search on an Ordered File  Binary Search  Bubble Sort  Insertion.
S. Narayanasamy, Z. Wang, J. Tigani, A. Edwards, B. Calder UCSD and Microsoft PLDI 2007.
Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
1 Advanced Material The following slides contain advanced material and are optional.
1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.
Tal Mor  Create an automatic system that given an image of a room and a color, will color the room walls  Maintaining the original texture.
Abstract Data Types (ADTs) Data Structures The Java Collections API
Efficient Privilege De-Escalation for Ad Libraries in Mobile Apps Bin Liu (SRA), Bin Liu (CMU), Hongxia Jin (SRA), Ramesh Govindan (USC)
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Towards Fully Automatic Placement of Security Sanitizers and Declassifiers Ben Livshits, Microsoft Research Stephen Chong, Harvard University.
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
RITA demonstration Juha Taina, Antti Tevanlinna. Rita prototype status Following the preliminary specifications we started Rita prototype implementation.
Presented by: Tom Staley. Introduction Rising security concerns in the smartphone app community Use of private data: Passwords Financial records GPS locations.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Searching and Sorting Topics Sequential Search on an Unordered File
Bug Localization with Machine Learning Techniques Wujie Zheng
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
COP3530 Data Structures600 Stack Stack is one the most useful ADTs. Like list, it is a collection of data items. Supports “LIFO” (Last In First Out) discipline.
Evaluating What’s Been Learned. Cross-Validation Foundation is a simple idea – “ holdout ” – holds out a certain amount for testing and uses rest for.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Experimental RELAP5-3D Time Step Improvements Dr. George L Mesina RELAP5 International Users Seminar Nov 18-20, 2008 Idaho Falls, ID.
Use of Coverity & Valgrind in Geant4 Gabriele Cosmo.
Chapter 13: Regression Testing Omar Meqdadi SE 3860 Lecture 13 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Type Systems CS Definitions Program analysis Discovering facts about programs. Dynamic analysis Program analysis by using program executions.
Senior Design 1 Project Android Pilot Nation Stellar Sea Lions Team –Andrew Olivier –Jordan Fryer –Karen Echon –Jacob Hahn University of Portland School.
Electrical and Computer Engineering Klaus Kristo Clem Leung Adam Frieden Chris Davidson Faculty: Professor Ramgopal Mettu Project: iPlanAhead Preliminary.
1 Automatic Classification of Bookmarked Web Pages Chris Staff Third Talk February 2007.
ABCD: Eliminating Array-Bounds Checks on Demand Rastislav Bodík Rajiv Gupta Vivek Sarkar U of Wisconsin U of Arizona IBM TJ Watson recent experiments.
Kaleidoscope – Adding Colors to Kademlia Gil Einziger, Roy Friedman, Eyal Kibbar Computer Science, Technion 1.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Chapter Making Decisions 4. Relational Operators 4.1.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Visual Basic for Application - Microsoft Access 2003 Finishing the application.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Perfecto Mobile Automation
The Ins and Outs of Gradual Type Inference Avik Chaudhuri Basil Hosmer Adobe Systems Aseem Rastogi Stony Brook University.
Building Java Programs Chapter 13 Lecture 13-1: binary search and complexity reading:
Reasoning and Design (and Assertions). How to Design Your Code The hard way: Just start coding. When something doesn’t work, code some more! The easier.
A Software Energy Analysis Method using Executable UML for Smartphones Kenji Hisazumi System LSI Research Center Kyushu University.
White-Box Testing Statement coverage Branch coverage Path coverage
CMSC 104, Version 8/061L24Searching&Sorting.ppt Searching and Sorting Topics Sequential Search on an Unordered File Sequential Search on an Ordered File.
Free for All! Assessing User Data Exposure to Advertising Libraries on Android Campbell Foskin.
Software Testing.
CSC 222: Object-Oriented Programming
Different Types of Testing
Types of Testing Visit to more Learning Resources.
TriggerScope Towards detecting logic bombs in android applications
2008/12/03: Lecture 20 CMSC 104, Section 0101 John Y. Park
Software Testing (Lecture 11-a)
Searching and Sorting Topics Sequential Search on an Unordered File
Testing and Test-Driven Development CSC 4700 Software Engineering
Searching and Sorting Topics Sequential Search on an Unordered File
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis.
Manipulating lists of data
UMBC CMSC 104 – Section 01, Fall 2016
Searching and Sorting Topics Sequential Search on an Unordered File
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CSC-682 Advanced Computer Security
Building Java Programs
Programming with Shared Memory Specifying parallelism
Presentation transcript:

Automatic Mediation Of Privacy-sensitive Resource Access In Smartphone Applications Ben Livshits and Jaeyeon Jung Microsoft Research

PERMISSIONS IN MOBILE APPS 2

Permissions Flavors 3 installation-time permissions runtime permissions Permissions Allow access to GPS location?

Examples of Permissions in Different Mobile Operating Systems 4 installation-time permissions runtime permissions

General Guidelines 5 Best Practices for Mobile Application Developers Center for Democracy & Technology

Guarding Location Access Focus on 3 representative applications in the Windows Phone store 6 App Resource AccessesAPIs usedDLLs using location AroundMe2 TryStart, getPositionAroundMe.dll Burger King5 Start, getPositionBurgerKing.dll, GART.dll LumiaClock2 Start, getPositionSOMAWP7.dll %z

AroundMe 7 public static bool AroundMe.App.CheckOptin() { if (((Option)Enum.Parse(typeof(Option),Config.GetSetting (SettingConstants.UseMyLocation),true)) == Option.Yes) { return GetCurrentCoordinates(); } if (MessageBox.Show("This app needs...", "Use location data?", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { Config.UpdateSetting(new KeyValuePair (SettingConstants.UseMyLocation,Option.Yes.ToString())); return GetCurrentCoordinates(); }... } checkpromptsaveaccess

Burger King 8 public BurgerKing.View.MapPage() { this.InitializeComponent(); base.DataContext = new MapViewModel(); this.BuildApplicationBar(); if (AppSettings.Current.UseLocationService){ this.watcher = new GeoCoordinateWatcher(); }.. } protected virtual void GART.Controls.ARDisplay. OnLocationEnabledChanged( DependencyPropertyChangedEventArgs e) { if (this.servicesRunning) { if (this.LocationEnabled) { this.StartLocation(); … application code library code

LumiaClock 9 public SomaAd() {... this._locationUseOK = true;... if (this._locationUseOK) { this.watcher = new GeoCoordinateWatcher (GeoPositionAccuracy.Default); this.watcher.MovementThreshold = 20.0; this.watcher.StatusChanged += new EventHandler ( this.watcher_StatusChanged); this.watcher.Start(); } } library: just do it!

Where Does that Leave Us? Properly protecting location access is challenging Location access is common Some location-related code is in the app A lot of location access in third-party libraries Location choices are sometimes ignored Third-party libraries such as ad libraries sometimes expose flags for enabling location access but those are frequently ignored by developers 10

1 Study how existing applications implement resource access prompts on a set of Windows Phone applications Contributions

2 Formulate a problem of valid prompt placement in graph- theoretic terms Propose a static analysis algorithm for correct resource access prompt placement Static analysis

13 3 We evaluate our approach to both locating missing prompts and placing them when they are missing on 100 apps Overall, our two-prong strategy of dominator-based and backward placement succeeds in about 95% of all unique cases Our analyses run in seconds, making it possible to run them as part of the app submission process Evaluation

ANALYSIS APPROACH 14

In This Paper… We focus on a completely automatic way to insert missing prompts Our approach is static: we want to be able to check for missing prompts and insert compensating code even if we cannot hit it at through runtime testing Graph-theoretic approach Represent the application statically as a graph An inter-procedural version of control flow graph (CFG) Reason about prompt placement in graph- theoretic terms Not information flow A lot of work on finding undesirable information flows We reason about control flow not data flow 15

Challenges 1. Avoiding double- prompts 2. Sticky prompts 3. Avoiding weaker prompts 4. Minimizing prompting 5. Avoiding prompts in background tasks 6. Avoiding prompts in libraries if(P) l1 = getLocation(); l2 = getLocation(); 16 flag = true; if(P){ prompt(); flag = true; l1 = getLocation(); } if(!flag){ prompt(); l2 = getLocation(); } flag = true; if(P){ prompt(); flag = true; l1 = getLocation(); } if(!flag){ prompt(); l2 = getLocation(); } if(P){ prompt(); l1 = getLocation(); l2 = getLocation(); }else{ prompt(); l2 = getLocation(); } if(P){ prompt(); l1 = getLocation(); l2 = getLocation(); }else{ prompt(); l2 = getLocation(); }

Challenges 1. Avoiding double-prompts 2. Sticky prompts 3. Avoiding weaker prompts 4. Minimizing prompting 5. Avoiding prompts in background tasks 6. Avoiding prompts in libraries 17 if (MessageBox.Show( "This app needs to know your location in order to find locations around you, can it use your location data? note: you can change the settings later through the settings menu", "Use location data? ", 1) == 1) { Config.UpdateSetting( new KeyValuePair ( SettingConstants.UseMyLocation, Option.Yes.ToString())); return GetCurrentCoordinates(); } if (MessageBox.Show( "This app needs to know your location in order to find locations around you, can it use your location data? note: you can change the settings later through the settings menu", "Use location data? ", 1) == 1) { Config.UpdateSetting( new KeyValuePair ( SettingConstants.UseMyLocation, Option.Yes.ToString())); return GetCurrentCoordinates(); }

Challenges 1. Avoiding double-prompts 2. Sticky prompts 3. Avoiding weaker prompts 4. Minimizing prompting 5. Avoiding prompts in background tasks 6. Avoiding prompts in libraries 18 3 rd party.dll

Valid Placement 19

Intuition for Placement 1. Start with a resource access 2. “Move” the prompts up until we are outside of background tasks Downside : possible to move these prompts too far (to the beginning of the app in the most extreme case) This would violate the frugal requirement. This gives rise to a notion of a prompt being needed at a particular point, for which we use the term anticipating getLocation()

Dominator-Based Approach Not frugal! getLocation()

Backward Placement Slower 4 4 getLocation()

Analysis Steps For every resource access type and every node n, pre- compute r-anticipated value A r (n) 2. Merge values by meeting them in the semi-lattice of resource types A(n) = A r (n) 3. For every

EVALUATION 24

Input Statistics apps analyzed app size MB processed methods352,8163.5K on average 25 background/library methods26,0337% library methods25,8987% nodes1,333,056 anticipating171,25312% accesses2272 per app accesses in background/library methods781/3 rd

Benchmarks 26 Took 100 WP 7 apps To make this meaningful, chose apps with LOCATION and NETWORKING caps An average app is 7.3 MB of code Uses third-party ad libraries

Prompt Placement Success 27

Dominator-Based vs. Backward When dominator-based placement succeeds, it is usually immediate Backward placement is helpful for cases where dominator-based placement fails However, some of these cases are still too hard, leading to 7 unique failures 28

Timing 29

Manual Examination Picked 10 apps with 27 resource accesses Manually exercised as much functionality as possible Verification includes running these apps in an emulator to collect network packets and API calls False negatives: resource access we think is protected whereas in fact at runtime it has no preceding prompts Out of 27 accesses our analysis reports 10 as unprotected No false negatives observed: analysis correctly identifies them as unprotected and finds proper prompt placements 30

False Positives False positives: analysis classifies a resource access as unprotected whereas it is properly protected at runtime 11 out of 21 accesses found as unprotected turn out to be false positives Reasons include: Not recognizing sticky prompts Custom consent dialogs Async calls and XAML 31 Our analysis errs on the safe side, introducing false positives and not false negatives False positives may lead to double-prompting Inserted prompts are sticky, so at most one extra runtime prompt per app Easy to spot and suppress by app store maintainers Interesting future research

Conclusions Explored the problem of missing prompts that should guard sensitive resource accesses Graph-theoretic algorithm for placing prompts Approach that balances execution speed and few prompts inserted via dominator-based placement with a comprehensive nature of a more exhaustive backward analysis Overall, our two-prong strategy of dominator- based and backward placement succeeds in about 95% of all unique cases highly scalable: analysis usually takes under a second on average Suggests that fully- automatic prompt placement is viable 32