Explicating SDKs: Uncovering Assumptions Underlying Secure Authentication and Authorization Rui Wang 1 *, Yuchen Zhou 2 * †, (*Lead authors, † Speaker)

Slides:



Advertisements
Similar presentations
Modular and Verified Automatic Program Repair Francesco Logozzo, Thomas Ball RiSE - Microsoft Research Redmond.
Advertisements

OAuth 2.0 By “PJ” (JP on meetup.com) iOS and PHP developer, and occasional lawyer Contact me via:
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Automated Software Verification with a Permission-Based Logic 20 th June 2014, Zürich Malte Schwerhoff, ETH Zürich.
Using Evernote and Google Docs in your web or mobile application (and potentially Dropbox and Skydrive) By Peter Messenger Senior Developer – Triple Point.
The Devil is in the (Implementation) Details: An Empirical Analysis of OAuth SSO Systems San-Tsai Sun and Konstantin Beznosov University of British Columbia.
Environmental Council of States Network Authentication and Authorization Services The Shared Security Component February 28, 2005.
Facebook Applications Teppo Räisänen. Facebook Applications Facebook provides many Software Development Kits (SDK’s) – PHP SDK – iOS SDK – Android SDK.
1 Trillion Azure AD authentications since the release of the service 50 M Office 365 users active every month >1 Billion authentications every.
Confidential Date Project ONE CLICK : 12/26/2006 Oracle Single Sign-On Sridhar Gangapuram Manager, Oracle Applications (Phoenix) Roger Raj Sr. Technical.
GRDevDay March 21, 2015 Cloud-based Identity for Applications.
1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.
Vienna/Austria Authenticate as entitled user or app for the individual service Authenticate as entitled user for our web portal Decide what.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Building Secure Applications.
SIM205. (On-Premises) Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime You manage Infrastructure (as a Service)
User signs in to WindowsUser is signed in to your app 12.
Secure Search Engine Ivan Zhou Xinyi Dong. Project Overview  The Secure Search Engine project is a search engine that utilizes special modules to test.
Edwin Sarmiento Microsoft MVP – Windows Server System Senior Systems Engineer/Database Administrator Fujitsu Asia Pte Ltd
Part Two Network Security Applications Chapter 4 Key Distribution and User Authentication.
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
Towards Scalable Modular Checking of User-defined Properties Thomas Ball, MSR Brian Hackett, Mozilla Shuvendu Lahiri, MSR Shaz Qadeer, MSR Julien Vanegue,
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Jeff Shiley. Start Point System Environment User Experience Our “Unique” Requirements Solution System Evaluation & Prototype Single Sign-on Component.
Office 365 Platform Flexible Tools Each Office 365 Workload API required different Authentication.
Module 5 Configuring Authentication. Module Overview Lesson 1: Understanding Classic SharePoint Authentication Providers Lesson 2: Understanding Federated.
Microsoft ® Official Course Module 13 Implementing Windows Azure Active Directory.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) Stored Procedure James Wang.
An Overview of Single Sign-On, Federation, Its Benefits, and Basic Procedures for Integrating Applications.
 Facebook Integration on iOS Phan Thanh Phat Huynh Thanh Van.
Ins and Outs of Authenticating Users Requests to IIS 6.0 and ASP.NET Chris Adams Program Manager IIS Product Unit Microsoft Corporation.
Module 7: Advanced Application and Web Filtering.
THE DEVIL IS IN THE (IMPLEMENTATION) DETAILS: AN EMPIRICAL ANALYSIS OF OAUTH SSO SYSTEMS SAN-TSAI SUN & KONSTANTIN BEZNOSOV PRESENTED BY: NAZISH KHAN COMPSCI.
Yuchen Zhou and David Evans Presented by Simon du Preez Compsci 726 SSOScan: Automated Testing of Web Applications for Single Sign-On Vulnerabilities.
Protecting Browsers from Extension Vulnerabilities Paper by: Adam Barth, Adrienne Porter Felt, Prateek Saxena at University of California, Berkeley and.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Satisfy Your Technical Curiosity 27, 28 & 29 March 2007 International Convention Center (ICC) Ghent, Belgium.
ICM – API Server & Forms Gary Ratcliffe.
Security E-Learning Chapter 08. Security Control access to your web site –3 Techinques for Identifying users Giving users access to your site Securing.
Esri UC 2014 | Demo Theater | Using ArcGIS Online App Logins in Node.js James Tedrick.
Andrew Coates Advanced Windows 10 development with the Office 365 APIs DEV33 5.
Web Technologies Lecture 11 Implementing RESTful services.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
Secure Search Engine Ivan Zhou Xinyi Dong. Project Overview  The Secure Search Engine project is a search engine that utilizes special modules to test.
API Auth By Kyle Bradley. Role Definitions  User (Resource Owner)  The resource owner is the person who is giving access to some portion of their account.
Secure Mobile Development with NetIQ Access Manager
Today’s Applications Web API Browser Native app Web API Web API
#SummitNow Consuming OAuth Services in Alfresco Share Alfresco Summit 2013 Will Abson
Business Objects XIr2 Windows NT Authentication Single Sign-on 18 August 2006.
Martina Grom MVP Office 365 How to (remote) control Office 365 with Azure Toni Pohl MVP Client Dev
The Alfresco iOS SDK Gi Lee (Zia Consulting) Peter Schmidt (Alfresco)
11 | Managing User Info Jeremy Foster Michael Palermo
562: Power of Single Sign-On in OpenEdge
Consuming OAuth Services in Alfresco Share
HMA Identity Management Status
Migrating SharePoint Add-ins from Azure ACS to Azure AD
Viewbiquity HTML5 Tom Shafron Developer’s Blog CEO, Viewbiquity
Prime Service Catalog 12.0 SAML 2.0 Single Sign-On Support
Security mechanisms and vulnerabilities in .NET
SSOScan: Automated Testing of Web Applications for Single Sign-On Vulnerabilities Yuchen Zhou, and David Evans 23rd USENIX Security Symposium, August,
Power your app with Live services
Azure AD Line Of Business Application Integration
Security & .NET 12/1/2018.
Agenda OAuth Concepts Programming OAuth.
SharePoint Online Authentication Patterns
Office 365 Development.
Token-based Authentication
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
An Introduction to JavaScript
08 | Configuring SharePoint Online
Presentation transcript:

Explicating SDKs: Uncovering Assumptions Underlying Secure Authentication and Authorization Rui Wang 1 *, Yuchen Zhou 2 * †, (*Lead authors, † Speaker) Shuo Chen 1, Shaz Qadeer 1, David Evans 2 and Yuri Gurevich 1 1 Microsoft Research and 2 University of Virginia 1

Most modern apps are empowered by online services. 2 chart source: builtwith.com

Single Sign-On Service 3

The requested response type, one of code or token. Defaults to code… 4 If the developers follow the guides properly, will the application be secure? Facebook documentation example

Possible implementation 5 Facebook back end dialog/oauth… 1 access_token 3 2 exchange user info 4 user id/ 5 Welcome, Alice! 6 Foo App Client Malicious App Client Foo App Server Possible Attack access_token 3 4 Welcome Alice?! 7 exchange user info 5 user id/ 6

Video Demo 6

Who’s to blame? Developers? SDK providers? 7

The requested response type, one of code or token. Defaults to code… 8 If developers follow the guides properly, will the applications be secure? Facebook documentation example No. Not because of vulnerabilities in SDKs. Due to implicit assumptions about how to use them.

Implicit Assumptions Assumptions that are o not clearly stated in the SDK’s developer guides; o related to how the SDK should be used; o essential for application’s security property. Goal of this project: systematically find these implicit assumptions 9

10 Verifier ModelAssertionsAssumptions Model checks? Counter- Example Refine Model Add necessary assumptions More to model NY Enrich Model Add related assertions Y N Iterative process General Approach

11 General Approach

System Architecture 12 FooApp C Client SDK Client runtime Identity Provider (IdP) FooApp S Service SDK Service runtime

Threat model 13 FooApp C Client SDK Client runtime Identity Provider (IdP) FooApp S Service SDK Service runtime MalApp C Mallory

Desired Security Properties Authentication Mallory cannot sign into Foo app as Alice. Authorization Mallory cannot access data that Alice have not granted permission to Mallory. Association The user identity, user’s permission (authorization result), and session identity must represent the same person. 14

15 Verifier ModelAssertionsAssumptions 3 security properties assert(logged_in_user != _Alice);

System Architecture 16 FooApp C Client SDK Client runtime Identity Provider (IdP) FooApp S Service SDK Service runtime

Modeling SDKs 17 FooApp C Client SDK Client runtime Identity Provider (IdP) FooApp S Service SDK Service runtime Concrete module with src or documentation

Modeling underlying system layer 18 FooApp C Client SDK FooApp S Service SDK Client runtime Identity Provider (IdP) Service runtime Concrete module with src or documentation Black-box concrete module

Modeling Foo application 19 Client SDK Service SDK Client runtime Identity Provider (IdP) Service runtime FooApp C FooApp S Abstract module subject to dev guide Concrete module with src or documentation Black-box concrete module

Modeling Mallory 20 FooApp C Client SDK Client runtime Identity Provider (IdP) FooApp S Service SDK Service runtime MalApp C Mallory Abstract module subject to dev guide Concrete module with src or documentation Black-box concrete module Abstract module subject to knowledge pool

21 FooApp C Client SDK Client runtime Identity Provider (IdP) FooApp S Service SDK Service runtime MalApp C Mallory Knowledge Pool Knowledge Pool Concrete Modules Test Harness Modeling Mallory Abstract module subject to dev guide Concrete module with src or documentation Black-box concrete module Abstract module subject to knowledge pool

22 Verifier ModelAssertions Assumptions 3 security properties Basic system components SDK documentation and previously uncovered assumptions SDK documentation and previously uncovered assumptions All relevant system components

Boogie/BoogiePL: Symbolic execution engine Supports loop invariants and function pre/post conditions to enable unbounded verification 23 [1]: Boogie: An Intermediate Verification Language. Verifier: Boogie [1] ModelAssertions Assumptions 3 security properties SDK documentation and previously uncovered assumptions SDK documentation and previously uncovered assumptions All relevant system components

24 Verifier ModelAssertionsAssumptions Model checks? Counter- Example Refine Model Add necessary assumptions More to model NY Enrich Model Add related assertions Y N Results

Results overview Explicated three SDKs: (6 months) Many implicit assumptions were found: 25 5 cases reported, 4 fixed, 3 bounties (3x). One case reported; documentation revised. Paragraph added to OAuth 2.0 standard. Majority of tested apps vulnerable due to failure to ensure at least one uncovered assumption. Facebook SSO PHP SDK Windows 8 SDK for modern apps Windows Live connect SDK

SDK models 26 Facebook PHP Source codeBoogie PL Model

procedure {:inline 1} dialog_oauth(IdPLoggedInUser:User, client_id: AppID, redirect_domain: Web_Domain, scope:Scope, response_type:ResponseType) returns (r:int, Response_data: int) modifies Access_Tokens__TokenValue, Access_Tokens__user_ID, Access_Tokens__Scope; modifies Codes__user_ID,Codes__App_ID,Codes__Scope; modifies … { var access_token:int, code:int, sr:int; … if (response_type==_Token || response_type==_Signed_Request){ havoc access_token; //it means "access_token := *;" … IdP_Signed_Request_signature[sr]:=ValidIdPSignature; IdP_Signed_Request_oauth_token[sr]:=access_token; IdP_Signed_Request_code[sr]:=code; IdP_Signed_Request_user_ID[sr]:= IdPLoggedInUser; IdP_Signed_Request_app_id[sr]:= client_id; } if (response_type==_Token) { Response_data:=access_token; } else if (response_type==_Code) { Response_data:=code; } else { Response_data:=sr; } r:=200; } API models 27 Facebook Dialog API documentation Boogie model procedure {:inline 1} dialog_oauth(IdPLoggedInUser:User, client_id: AppID, redirect_domain: Web_Domain, scope:Scope, response_type:ResponseType) returns (r:int, Response_data: int) modifies Access_Tokens__TokenValue, Access_Tokens__user_ID, Access_Tokens__Scope; modifies Codes__user_ID,Codes__App_ID,Codes__Scope; modifies … { var access_token:int, code:int, sr:int; … if (response_type==_Token || response_type==_Signed_Request){ havoc access_token; //it means "access_token := *;" … IdP_Signed_Request_signature[sr]:=ValidIdPSignature; IdP_Signed_Request_oauth_token[sr]:=access_token; IdP_Signed_Request_code[sr]:=code; IdP_Signed_Request_user_ID[sr]:= IdPLoggedInUser; IdP_Signed_Request_app_id[sr]:= client_id; } if (response_type==_Token) { Response_data:=access_token; } else if (response_type==_Code) { Response_data:=code; } else { Response_data:=sr; } r:=200; }

Example vulnerability from Facebook SDK

Example assumption from Facebook SDK 29 procedure {:inline 1} getLogoutUrl() returns (API_id: API_ID, …) modifies …; { var test_t:int ; call access_token := getAccessToken(); call test_t := getApplicationAccessToken(); assume(access_token != test_t); API_id := API_id_FBConnectServer_login_php; … return; } Assumption (in the model) Assumption (in plain text): getLogoutUrl() must not return an application access token to the client. Best outcome: Facebook fixed their SDK code so this assumption is not needed in the newer version.

Example assumption from Windows Live 30 function saveRefreshToken($refreshToken) { // save the refresh token associated with the user id on the site. } function handleTokenResponse($token, $error = null) { $authCookie = $_COOKIE[AUTHCOOKIE]; $cookieValues = parseQueryString($authCookie); … if (!empty($token->{ REFRESHTOKEN })) { saveRefreshToken($token->{ REFRESHTOKEN }); } … original Live ID developer guide associate refresh token with the user ID obtained from the global variable $_COOKIE associate refresh token with the user ID obtained from the refresh token passed into the function Two interpretations procedure {:inline 1} saveRefreshToken (refresh_token_index: int, RP_Cookie_index: int) modifies RP_Refresh_Token_index; { var user: User; //call user := get_User_ID(RP_Cookie_index); user := Refresh_Token__user_ID[refresh_token_index]; if (user == _nobody) {return;} RP_Refresh_Token_index[user] := refresh_token_index; } function saveRefreshToken(…) { // save the refresh token associated with the user id on the site. }

Example assumption from Windows Live 31 procedure {:inline 1} saveRefreshToken (refresh_token_index: int, RP_Cookie_index: int) modifies RP_Refresh_Token_index; { var user: User; call user := get_User_ID(RP_Cookie_index); user := Refresh_Token__user_ID[refresh_token_index]; if (user == _nobody) {return;} RP_Refresh_Token_index[user] := refresh_token_index; }

Example assumption from Windows Live 32 function saveRefreshToken($refreshToken) { // save the refresh token and associate it with the user identified by your site credential system. } function handleTokenResponse($token, $error = null) { $authCookie = $_COOKIE[AUTHCOOKIE]; $cookieValues = parseQueryString($authCookie); if (!empty($token)) … new Live ID developer guide

Testing Popular Apps 33 Facebook showcase applications Popular Windows 8 modern applications using Facebook SSO

Testing Results 34 Test SetNumber of AppsVulnerable Illustrative example2721 (78%) Assumption A1 (in the paper)76 (86%) Assumption A6 (in the paper)2114 (67%)

Conclusion Missed implicit assumptions can lead to many vulnerabilities when integrating third-party services. What we advocate: SDK providers explicate SDKs before release. o Fix SDK Code o Develop Automated Checker o Improve SDK documentation 35

Thank you! Rui Wang 1 *, Yuchen Zhou 2 * †, (* Lead authors, † Speaker) Shuo Chen 1, Shaz Qadeer 1, David Evans 2 and Yuri Gurevich 1 1 Microsoft Research and 2 University of Virginia 36 Models available at: Visit project website for more info: Visit project website for more info: