SlideShare a Scribd company logo
1 of 50
Download to read offline
OAuth Nightmares
HARIRAM BALASUNDARAM / YASHVIER KOSARAJU
BOX
$whoami
 Hari
 Staff Security Engineer
 ~5 years at Box
 @m4x1mus
 Yash
 Security Engineer
 ~2.5 years at Box
About Box
Box platform
 ~7 billion API calls per month
 ~90000 developers
 Developers from different industries
 Healthcare
 FinServ
 Tech
 Content APIs
 Webapp integrations
 Partner Integrations
 SDKs
Why this talk?
 OAuth RFC is fairly fluid
 And numerous
 RFC 6749 , RFC 6819, RFC 6750, RFC 7523 and so on!
 Framework is flexible
 Hence the success and adoption
 Lessons learned pivoting from a product to a
platform
 There is no one right design
Talk Agenda
 Quick overview on OAuth – end-to-end flow
 Grants
 Tokens
 Client registration
 Apps validation process
 Consent screen
 User Controls
 Developer Security
What is OAuth
 OAuth is a delegation protocol
 Security heavily driven by
 user-choice
 platform design decisions
 Trust on First use model
 You are using Oauth everywhere!
Flow: client registration
Flow: client registration
Flow: client registration
Flow: client registration
Roles
 The User: "Resource Owner”
 Authorization server
 The API: "Resource Server"
 The Third-Party Application: "Client”
 Web applications
 Backend services
 Mobile applications
 Native applications
Flow: User authorizing an app
Flow: User authorizing an app
Flow: Tokens granted to access
resource
Flow: API interaction to access
resource
Grants
 Defines the authorization flow to get tokens
 Types
 Authorization code grant
 Implicit grant
 Resource owner password credentials grant
 Client credentials grant
 JWT Bearer grant
Authorization code grant
 Use this if you want to support clients that are web
servers
 Ex. Office Online integration to Box
 Secure Design Considerations
 How long is the authorization code valid?
 How many times can the authorization code be reused?
Hint – zero!
 Rate limits on the authorization code granting endpoint?
 Tie authorization code to client id
 When a secret is not a secret (ex. Mobile apps)
 Will be discussed later in the talk.
Anti-CSRF – ”state” parameter
 Used by client to maintain state between request and
callback
 Should be mandated by server
 Attack
 Connect” type features
 Authorization code is the only identifying token in the first
step post authentication
 Generate authorization code for attacker account
 iFrame GET request to platform with authorization code
and trick victim to visit page
 Connect your account to victim’s account on the platform
Implicit grant
 Instead of a code, an access token is directly returned
back to the client
 Primarily for clients which has to ship secrets client-side
(ex. Angular JS app)
 Secure Design considerations:
 CORS (to be discussed later in the talk)
 Use this only if no other type of authorization can be used
since access token is exposed client-side.
 Clickjacking
 Confused deputy problem
 Token validation API
Confused Deputy problem
Token validation API
Other grant types
 Resource owner password credentials grant
 Translate username/password to a token
 Hacky way to turn your webapp into a resource server
supporting Oauth
 Secure design considerations
 Your third party clients now have incentive to request
username and password
 “Hacky” is never good – better not to support this grant.
Other grant types
 Client credentials grant
 Translate your client id and client secret to a token
 Backend services, trusted internal services
 Do not use this grant unless necessary.
 Compromise of platform DB == compromise of all client
secrets.
 Preferably switch to JWT bearer grant type
JSON Web Tokens (JWT)
 Open standard for a self-contained way to transmit
information in a JSON object
 Can be signed
 HMAC (symmetric) / RSA (Asymmetric)
 JWT Assertion Structure
 Header - for algorithm used to sign
 Payload - set of pre-determined claims
 Issuer, expiration, audience etc.
 Allows for custom defined claims
 Signature – contains the signature for the token
JWT Bearer grant
 Give me a JWT, I’ll give you an Access Token
 Needs creation of keys during client registration
JWT Bearer grant
JWT Bearer grant
 Security benefits:
 Supports revocation and rotation
 Assertion material is self-contained
 Can have extremely small lifetime for tokens grants (its easy
for clients to get a new one)
 Almost similar ease of use as client credentials grant
 With more securitah!
 Supports signing and encryption
 Compromise of server DB only exposes the public keys
 The private key material stays with the developer
 Compromise of DB of a platform that supports client credentials
grant leads to immediate compromise of all services.
Tokens
 Access token
 Something short lived
 Refresh token
 Can be used to get a new set of access token/refresh
token pair
Tokens
 Secure Design considerations:
 Treat tokens like a user password / session cookie
 Limit Token Scope
 Permissions and scope pentesting.
 Determine Expiration Time
 Use Short Expiration Time for Access Tokens
 Limit Number of Usages or One-Time Usage
 Refresh Token Rotation
 Should you rotate the refresh token on every session refresh?
 Revocation of Tokens
 Endpoint to revoke tokens
Client Registration
 We will talk about the things a developer has to
configure
 Auth type
 Client ID and Secret
 Redirect URI
 Scopes
 CORS
Client Registration
 Authentication method
 JWT vs Standard User Authentication
 vs
Client Registration
 Client ID and Secret
Client Registration
 Design Considerations
 Option to rotate the secret
 Encrypt the client secret
in the database.
Client Registration
 Redirect URI
 Where the token is sent
 If a developer does not specify
a redirect URI?
 Open redirect
 Account Takeover
 https://cloud.app.box.com/api/oauth2/authorize?response_ty
pe=code&client_id=<client_id>&redirect_uri=<redirect_URI>
Client Registration
 Design Considerations
 Mandating a redirect URI
 Mandate HTTPS:
 Do I need to talk about this?
 Multiple redirect URI’s
 Redirect URI validation
 redirect_uri.startsWith(registered_value) => Not good
enough!
 Do not allow wild card characters in the redirect URI
Client Registration
 Scopes
 Developer chooses the scopes that he wants access to
Client Registration
 Design Considerations
 Granular Scopes
 Clearly define the scopes
 Scope Overlap
Client Registration
 CORS
 Apps making AJAX requests
 Let the developer set the domains from which AJAX
calls will be made
Client Registration
 API / Webapp : Token/ Cookie => ROYALLY SCREWED..!!
 Webapp : abc.com
 API: abc.com/api/
 Also… CORS set to * …... is not all bad
Client Registration
 Public Key Security:
 When developer chooses JWT
 Design Considerations
 Prevent duplicate public keys
 Size matters
App Validation Process
 Process to validate apps before making them
available to the public.
App Validation Process
 Things to look for here are:
 Is there prohibited content in the
name/description/images ?
 Can it be used in Phishing
Consent Screen
Scopes
Name of the app
Apps
Logo
Consent Screen
 Consent Screen on Re-Association ?
 Scope changes
 User manually deletes
the app from their account
User Controls
 Provide users the ability to:
 See all apps they have authorized
 Remove apps
User Controls
 Official Apps Section
Developer Security
 Developer Console:
 Compromised developer account == compromise of all
application users
 Strong password requirements
 Mandate 2FA for the developers
 Action based 2FA?
 Product is going to hate you forever
 IP whitelisting Feature
Q/A

More Related Content

What's hot

OAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep DiveOAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep DiveNordic APIs
 
CIS14: Consolidating Authorization for API and Web SSO using OpenID Connect
CIS14: Consolidating Authorization for API and Web SSO using OpenID ConnectCIS14: Consolidating Authorization for API and Web SSO using OpenID Connect
CIS14: Consolidating Authorization for API and Web SSO using OpenID ConnectCloudIDSummit
 
OpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for BeginnersOpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for BeginnersSalesforce Developers
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authenticationleahculver
 
Why Assertion-based Access Token is preferred to Handle-based one?
Why Assertion-based Access Token is preferred to Handle-based one?Why Assertion-based Access Token is preferred to Handle-based one?
Why Assertion-based Access Token is preferred to Handle-based one?Hitachi, Ltd. OSS Solution Center.
 
Understanding Claim based Authentication
Understanding Claim based AuthenticationUnderstanding Claim based Authentication
Understanding Claim based AuthenticationMohammad Yousri
 
Single Sign On with OAuth and OpenID
Single Sign On with OAuth and OpenIDSingle Sign On with OAuth and OpenID
Single Sign On with OAuth and OpenIDGasperi Jerome
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular jsBixlabs
 
Claim based authentaication
Claim based authentaicationClaim based authentaication
Claim based authentaicationSean Xiong
 
Learn with WSO2 - API Security
Learn with WSO2 - API Security Learn with WSO2 - API Security
Learn with WSO2 - API Security WSO2
 
Single-Page-Application & REST security
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST securityIgor Bossenko
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - IntroductionKnoldus Inc.
 
REST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTsREST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTsJon Todd
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connectDerek Binkley
 
SPS Belgium 2015 - High-trust Apps for On-Premises Development
SPS Belgium 2015 -  High-trust Apps for On-Premises DevelopmentSPS Belgium 2015 -  High-trust Apps for On-Premises Development
SPS Belgium 2015 - High-trust Apps for On-Premises DevelopmentEdin Kapic
 
Oauth 2.0 security
Oauth 2.0 securityOauth 2.0 security
Oauth 2.0 securityvinoth kumar
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectJonathan LeBlanc
 
Making Sense of API Access Control
Making Sense of API Access ControlMaking Sense of API Access Control
Making Sense of API Access ControlCA API Management
 

What's hot (20)

OAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep DiveOAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep Dive
 
CIS14: Consolidating Authorization for API and Web SSO using OpenID Connect
CIS14: Consolidating Authorization for API and Web SSO using OpenID ConnectCIS14: Consolidating Authorization for API and Web SSO using OpenID Connect
CIS14: Consolidating Authorization for API and Web SSO using OpenID Connect
 
OpenID Connect Explained
OpenID Connect ExplainedOpenID Connect Explained
OpenID Connect Explained
 
OpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for BeginnersOpenID Connect and Single Sign-On for Beginners
OpenID Connect and Single Sign-On for Beginners
 
OAuth - Open API Authentication
OAuth - Open API AuthenticationOAuth - Open API Authentication
OAuth - Open API Authentication
 
Why Assertion-based Access Token is preferred to Handle-based one?
Why Assertion-based Access Token is preferred to Handle-based one?Why Assertion-based Access Token is preferred to Handle-based one?
Why Assertion-based Access Token is preferred to Handle-based one?
 
Understanding Claim based Authentication
Understanding Claim based AuthenticationUnderstanding Claim based Authentication
Understanding Claim based Authentication
 
Single Sign On with OAuth and OpenID
Single Sign On with OAuth and OpenIDSingle Sign On with OAuth and OpenID
Single Sign On with OAuth and OpenID
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular js
 
Claim based authentaication
Claim based authentaicationClaim based authentaication
Claim based authentaication
 
Learn with WSO2 - API Security
Learn with WSO2 - API Security Learn with WSO2 - API Security
Learn with WSO2 - API Security
 
Single-Page-Application & REST security
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST security
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
REST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTsREST Service Authetication with TLS & JWTs
REST Service Authetication with TLS & JWTs
 
OAuth2 primer
OAuth2 primerOAuth2 primer
OAuth2 primer
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connect
 
SPS Belgium 2015 - High-trust Apps for On-Premises Development
SPS Belgium 2015 -  High-trust Apps for On-Premises DevelopmentSPS Belgium 2015 -  High-trust Apps for On-Premises Development
SPS Belgium 2015 - High-trust Apps for On-Premises Development
 
Oauth 2.0 security
Oauth 2.0 securityOauth 2.0 security
Oauth 2.0 security
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID Connect
 
Making Sense of API Access Control
Making Sense of API Access ControlMaking Sense of API Access Control
Making Sense of API Access Control
 

Similar to Oauth Nightmares Abstract OAuth Nightmares

OAuth in the Real World featuring Webshell
OAuth in the Real World featuring WebshellOAuth in the Real World featuring Webshell
OAuth in the Real World featuring WebshellCA API Management
 
Spsbe15 high-trust apps for on-premises development
Spsbe15   high-trust apps for on-premises developmentSpsbe15   high-trust apps for on-premises development
Spsbe15 high-trust apps for on-premises developmentBIWUG
 
Deep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected AppsDeep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected AppsSalesforce Developers
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportGaurav Sharma
 
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...apidays
 
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...APIsecure_ Official
 
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect Nilanjan Roy
 
CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0CloudIDSummit
 
An Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices WorldAn Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices WorldVMware Tanzu
 
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...Hitachi, Ltd. OSS Solution Center.
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19aminmesbahi
 
CTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricCTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricSpiffy
 
Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...
Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...
Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...Tatsuo Kudo
 
apidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachi
apidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachiapidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachi
apidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachiapidays
 
attacks-oauth-secure-oauth-implementation-33644.pdf
attacks-oauth-secure-oauth-implementation-33644.pdfattacks-oauth-secure-oauth-implementation-33644.pdf
attacks-oauth-secure-oauth-implementation-33644.pdfMohitRampal5
 

Similar to Oauth Nightmares Abstract OAuth Nightmares (20)

OAuth in the Real World featuring Webshell
OAuth in the Real World featuring WebshellOAuth in the Real World featuring Webshell
OAuth in the Real World featuring Webshell
 
Spsbe15 high-trust apps for on-premises development
Spsbe15   high-trust apps for on-premises developmentSpsbe15   high-trust apps for on-premises development
Spsbe15 high-trust apps for on-premises development
 
O auth2.0 guide
O auth2.0 guideO auth2.0 guide
O auth2.0 guide
 
Securing RESTful API
Securing RESTful APISecuring RESTful API
Securing RESTful API
 
Deep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected AppsDeep Dive into OAuth for Connected Apps
Deep Dive into OAuth for Connected Apps
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
 
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
 
O auth 2
O auth 2O auth 2
O auth 2
 
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
 
CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0CIS13: Introduction to OAuth 2.0
CIS13: Introduction to OAuth 2.0
 
An Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices WorldAn Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices World
 
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
 
OAuth 2
OAuth 2OAuth 2
OAuth 2
 
.NET Core, ASP.NET Core Course, Session 19
 .NET Core, ASP.NET Core Course, Session 19 .NET Core, ASP.NET Core Course, Session 19
.NET Core, ASP.NET Core Course, Session 19
 
CTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricCTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App Fabric
 
Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...
Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...
Authorization Architecture Patterns: How to Avoid Pitfalls in #OAuth / #OIDC ...
 
apidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachi
apidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachiapidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachi
apidays Paris 2022 - Securing APIs in Open Banking, Takashi Norimatsu, Hitachi
 
Api security
Api security Api security
Api security
 
attacks-oauth-secure-oauth-implementation-33644.pdf
attacks-oauth-secure-oauth-implementation-33644.pdfattacks-oauth-secure-oauth-implementation-33644.pdf
attacks-oauth-secure-oauth-implementation-33644.pdf
 

Recently uploaded

VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdfThe Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdfMilind Agarwal
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Deliverybabeytanya
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Personfurqan222004
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 

Recently uploaded (20)

VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdfThe Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
The Intriguing World of CDR Analysis by Police: What You Need to Know.pdf
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Person
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 

Oauth Nightmares Abstract OAuth Nightmares

  • 1. OAuth Nightmares HARIRAM BALASUNDARAM / YASHVIER KOSARAJU BOX
  • 2. $whoami  Hari  Staff Security Engineer  ~5 years at Box  @m4x1mus  Yash  Security Engineer  ~2.5 years at Box
  • 4. Box platform  ~7 billion API calls per month  ~90000 developers  Developers from different industries  Healthcare  FinServ  Tech  Content APIs  Webapp integrations  Partner Integrations  SDKs
  • 5. Why this talk?  OAuth RFC is fairly fluid  And numerous  RFC 6749 , RFC 6819, RFC 6750, RFC 7523 and so on!  Framework is flexible  Hence the success and adoption  Lessons learned pivoting from a product to a platform  There is no one right design
  • 6. Talk Agenda  Quick overview on OAuth – end-to-end flow  Grants  Tokens  Client registration  Apps validation process  Consent screen  User Controls  Developer Security
  • 7. What is OAuth  OAuth is a delegation protocol  Security heavily driven by  user-choice  platform design decisions  Trust on First use model  You are using Oauth everywhere!
  • 12. Roles  The User: "Resource Owner”  Authorization server  The API: "Resource Server"  The Third-Party Application: "Client”  Web applications  Backend services  Mobile applications  Native applications
  • 15. Flow: Tokens granted to access resource
  • 16. Flow: API interaction to access resource
  • 17. Grants  Defines the authorization flow to get tokens  Types  Authorization code grant  Implicit grant  Resource owner password credentials grant  Client credentials grant  JWT Bearer grant
  • 18. Authorization code grant  Use this if you want to support clients that are web servers  Ex. Office Online integration to Box  Secure Design Considerations  How long is the authorization code valid?  How many times can the authorization code be reused? Hint – zero!  Rate limits on the authorization code granting endpoint?  Tie authorization code to client id  When a secret is not a secret (ex. Mobile apps)  Will be discussed later in the talk.
  • 19. Anti-CSRF – ”state” parameter  Used by client to maintain state between request and callback  Should be mandated by server  Attack  Connect” type features  Authorization code is the only identifying token in the first step post authentication  Generate authorization code for attacker account  iFrame GET request to platform with authorization code and trick victim to visit page  Connect your account to victim’s account on the platform
  • 20. Implicit grant  Instead of a code, an access token is directly returned back to the client  Primarily for clients which has to ship secrets client-side (ex. Angular JS app)  Secure Design considerations:  CORS (to be discussed later in the talk)  Use this only if no other type of authorization can be used since access token is exposed client-side.  Clickjacking  Confused deputy problem  Token validation API
  • 23. Other grant types  Resource owner password credentials grant  Translate username/password to a token  Hacky way to turn your webapp into a resource server supporting Oauth  Secure design considerations  Your third party clients now have incentive to request username and password  “Hacky” is never good – better not to support this grant.
  • 24. Other grant types  Client credentials grant  Translate your client id and client secret to a token  Backend services, trusted internal services  Do not use this grant unless necessary.  Compromise of platform DB == compromise of all client secrets.  Preferably switch to JWT bearer grant type
  • 25. JSON Web Tokens (JWT)  Open standard for a self-contained way to transmit information in a JSON object  Can be signed  HMAC (symmetric) / RSA (Asymmetric)  JWT Assertion Structure  Header - for algorithm used to sign  Payload - set of pre-determined claims  Issuer, expiration, audience etc.  Allows for custom defined claims  Signature – contains the signature for the token
  • 26. JWT Bearer grant  Give me a JWT, I’ll give you an Access Token  Needs creation of keys during client registration
  • 28. JWT Bearer grant  Security benefits:  Supports revocation and rotation  Assertion material is self-contained  Can have extremely small lifetime for tokens grants (its easy for clients to get a new one)  Almost similar ease of use as client credentials grant  With more securitah!  Supports signing and encryption  Compromise of server DB only exposes the public keys  The private key material stays with the developer  Compromise of DB of a platform that supports client credentials grant leads to immediate compromise of all services.
  • 29. Tokens  Access token  Something short lived  Refresh token  Can be used to get a new set of access token/refresh token pair
  • 30. Tokens  Secure Design considerations:  Treat tokens like a user password / session cookie  Limit Token Scope  Permissions and scope pentesting.  Determine Expiration Time  Use Short Expiration Time for Access Tokens  Limit Number of Usages or One-Time Usage  Refresh Token Rotation  Should you rotate the refresh token on every session refresh?  Revocation of Tokens  Endpoint to revoke tokens
  • 31.
  • 32. Client Registration  We will talk about the things a developer has to configure  Auth type  Client ID and Secret  Redirect URI  Scopes  CORS
  • 33. Client Registration  Authentication method  JWT vs Standard User Authentication  vs
  • 35. Client Registration  Design Considerations  Option to rotate the secret  Encrypt the client secret in the database.
  • 36. Client Registration  Redirect URI  Where the token is sent  If a developer does not specify a redirect URI?  Open redirect  Account Takeover  https://cloud.app.box.com/api/oauth2/authorize?response_ty pe=code&client_id=<client_id>&redirect_uri=<redirect_URI>
  • 37. Client Registration  Design Considerations  Mandating a redirect URI  Mandate HTTPS:  Do I need to talk about this?  Multiple redirect URI’s  Redirect URI validation  redirect_uri.startsWith(registered_value) => Not good enough!  Do not allow wild card characters in the redirect URI
  • 38. Client Registration  Scopes  Developer chooses the scopes that he wants access to
  • 39. Client Registration  Design Considerations  Granular Scopes  Clearly define the scopes  Scope Overlap
  • 40. Client Registration  CORS  Apps making AJAX requests  Let the developer set the domains from which AJAX calls will be made
  • 41. Client Registration  API / Webapp : Token/ Cookie => ROYALLY SCREWED..!!  Webapp : abc.com  API: abc.com/api/  Also… CORS set to * …... is not all bad
  • 42. Client Registration  Public Key Security:  When developer chooses JWT  Design Considerations  Prevent duplicate public keys  Size matters
  • 43. App Validation Process  Process to validate apps before making them available to the public.
  • 44. App Validation Process  Things to look for here are:  Is there prohibited content in the name/description/images ?  Can it be used in Phishing
  • 45. Consent Screen Scopes Name of the app Apps Logo
  • 46. Consent Screen  Consent Screen on Re-Association ?  Scope changes  User manually deletes the app from their account
  • 47. User Controls  Provide users the ability to:  See all apps they have authorized  Remove apps
  • 49. Developer Security  Developer Console:  Compromised developer account == compromise of all application users  Strong password requirements  Mandate 2FA for the developers  Action based 2FA?  Product is going to hate you forever  IP whitelisting Feature
  • 50. Q/A