SlideShare a Scribd company logo
OAuth 2.0 Threat Landscapes
Prabath Siriwardena (@prabath)
Cloud Identity Summit, 2017.
ABOUT ME
2
▪  The Senior Director of Security Architecture, WSO2
▪  Authored the book Advanced API Security - and three more
OAUTH 2.0 RECAP
OAUTH 2.0
4
AUTHORIZATION CODE
5
IMPLICIT
6
CLIENT CREDENTIALS
7
RESOURCE OWNER PASSWORD
8
THREATS / MITIGATIONS / BEST PRACTICES
▪  CSRF (Cross Site Request Forgery)
○  The attacker tries to log into the target website (OAuth 2.0 client) with his
account at the corresponding identity provider.
○  The attacker blocks the redirection to the target web site, and captures the
authorization code. The target web site never sees the code.
○  The attacker constructs the callback URL for the target site - and lets the victim,
clicks on it.
○  The victim logs into the target web site, with the account attached to the
attacker - and adds credit card information.
○  The attacker too logs into the target website with his/her valid credentials and
uses victim’s credit card to buy goods.
10
SESSION INJECTION
THREATS
▪  Short-lived authorization code
▪  Use the state parameter as defined in the OAuth 2.0 specification.
○  Generate a random number and pass it to the authorization server along with
the grant request.
○  Before redirecting to the authorization server, add the generated value of the
state to the current user session.
○  Authorization server has to return back the same state value with the
authorization code to the return_uri.
○  The client has to validate the state value returned from the authorization server
with the value stored in the user’s current session - if mismatches - reject
moving forward.
11
MITIGATIONS / BEST PRACTICES
SESSION INJECTION
▪  Use Proof Key for Code Exchange (PKCE)
○  https://tools.ietf.org/html/rfc7636
12
MITIGATIONS / BEST PRACTICES
SESSION INJECTION
▪  The OAuth 2.0 client app generates a random number
(code_verifier) and finds the SHA256 hash of it - which
is called the code_challenge
▪  Send the code_challenge along with the hashing
method in the authorization grant request to the
authorization server.
▪  Authorization server records the code_challenge and
replies back with the code.
▪  The client sends the code_verifier along with the
authorization code to the token endpoint.
13
PROOF KEY FOR CODE EXCHANGE
TOKEN LEAKAGE
▪  Attacker may attempt to eavesdrop authorization code/access token/
refresh token in transit from the authorization server to the client.
○  Malware installed in the browser (public clients)
○  Browser history (public clients / URI fragments)
○  Intercept the TLS communication between the client (confidential) and the
authorization server (exploiting vulnerabilities at the TLS layer)
▪  Heartbleed
▪  Logjam
▪  Authorization Code Flow Open Redirector
14
THREATS
▪  A malicious app can register itself as a handler for the same custom
scheme as of a legitimate OAuth 2.0 native app, can get hold of the
authorization code.
▪  Attacker may attempt a brute force attack to crack the authorization
code/access token.
▪  Attacker may attempt to steal the authorization code/access token/
refresh token stored in the authorization server.
▪  IdP Mix-Up / Malicious Endpoint
15
THREATS
TOKEN LEAKAGE
▪  The OAuth 2.0 app provides multiple IdP options to login.
▪  The victim picks foo.idp from the browser - the attacker intercepts
the request and change the selection to evil.idp.
▪  The client thinks it’s evil.idp and redirects the user to evil.idp.
▪  The attacker intercepts the redirection and modify the redirection
to go to the foo.idp.
▪  The client gets either the code or the token (based on the grant
type) and now will talk to the evil.idp to validate.
▪  The evil.idp gets hold of user’s access token or the authorization
code from the foo.idp.
16
IDP MIXUP
▪  Always on TLS (use TLS 1.2 or later)
▪  Address all the TLS level vulnerabilities both at the client, authorization
server and the resource server.
▪  The token value should be >=128 bits long and constructed from a
cryptographically strong random or pseudo-random number sequence.
▪  Never store tokens in clear text - but the salted hash.
▪  Short-lived tokens.
○  LinkedIn	has	an	expiration	of	30	seconds	for	its	authorization	codes.	
17
MITIGATIONS / BEST PRACTICES
TOKEN LEAKAGE
▪  The token expiration time would depend on the following parameters.
○  Risk	associated	with	token	leakage		
○  Duration	of	the	underlying	access	grant		
○  Time	required	for	an	attacker	to	guess	or	produce	a	valid	token	
▪  One-time authorization code
▪  One-time access token (implicit grant type)
▪  Use PKCE (proof key for code exchange) to avoid authorization code
interception attack.
○  Have S256 as the code challenge method
▪  Enforce standard SQL injection countermeasures
18
MITIGATIONS / BEST PRACTICES
TOKEN LEAKAGE
▪  Avoid using the same client_id/client_secret for each instance of a
mobile app - rather use the Dynamic Client Registration API to
generate a key pair per instance.
○  Most of the time the leakage of authorization code becomes a threat when the
attacker is in hold of the client id and client secret.
▪  Restrict grant types by client.
○  Most of the authorization servers do support all core grant types. If unrestricted,
leakage of client id/client secret gives the attacker the opportunity obtain an
access token via client credentials grant type.
19
MITIGATIONS / BEST PRACTICES
TOKEN LEAKAGE
▪  Enable client authentication via a much secured manner.
○  JWT client assertions
○  TLS mutual authentication
○  Have a key of size 2048 bits or larger if RSA algorithms are used for the client
authentication
○  Have a key of size 160 bits or larger if elliptic curve algorithms are used for the
client authentication
▪  White-list callback URLs (redirect_uri)
○  The absolute URL or a regEx pattern
20
MITIGATIONS / BEST PRACTICES
TOKEN LEAKAGE
▪  IdP-Mixup
○  Use different callback URLs by IdP
○  https://tools.ietf.org/html/draft-ietf-oauth-mix-up-mitigation-01
ols.ietf.org/html/draft-ietf-oauth-mix-up-mitigaon-01
▪  Token Binding
○  https://tools.ietf.org/html/draft-ietf-tokbind-protocol
○  https://tools.ietf.org/html/draft-ietf-tokbind-negotiation
○  https://tools.ietf.org/html/draft-ietf-tokbind-https
○  https://tools.ietf.org/html/draft-ietf-oauth-token-binding
21
MITIGATIONS / BEST PRACTICES
TOKEN LEAKAGE
TOKEN REUSE/MISUSE
▪  A malicious resource (an API / Microservice) could reuse an access
token used to access itself by a legitimate client to access another
resource, impersonating the original client.
▪  An evil web site gets an access token from a legitimate user, can
reuse it at another web site (which trusts the same authorization
server) with the implicit grant type
○  https://target-app/callback?access_token=<access_token>
▪  A legitimate user misuses an access token (issued under implicit grant
type/SPA) to access a set of backend APIs in a way, exhausting
server resources.
22
THREATS
▪  Use scoped access tokens. Qualify the scope name, with a namespace
unique to the resource (resource server).
▪  The client obtains the access token for a given audience - by passing
the audience information (representing the resource server) to the
token endpoint - as per https://tools.ietf.org/id/draft-tschofenig-oauth-
audience-00.html.
▪  Use OAuth for authorization not for authentication.
○  Use OpenID Connect for authentication
23
MITIGATIONS / BEST PRACTICES
TOKEN REUSE/MISUSE
▪  To avoid exhausting resources at the server side, enforce throttle limits
by user by application. In case an attacker wants to misuse a token -
the worst he/she can do is to eat his/her own quota.
24
MITIGATIONS / BEST PRACTICES
TOKEN REUSE/MISUSE
OPEN TECHNOLOGY FOR YOUR AGILE DIGITAL BUSINESS
THANK YOU

More Related Content

PDF
Identity Federation Patterns with WSO2 Identity Server​
PPTX
Webinar: ForgeRock Identity Platform Preview (Dec 2015)
PDF
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
PDF
API Security Best Practices and Guidelines
PDF
WSO2 Enterprise Integrator 101
PDF
42Crunch Security Audit for WSO2 API Manager 3.1
PDF
The Role of IAM in Microservices
PDF
Identity Hub’s Role in Social Logins
Identity Federation Patterns with WSO2 Identity Server​
Webinar: ForgeRock Identity Platform Preview (Dec 2015)
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
API Security Best Practices and Guidelines
WSO2 Enterprise Integrator 101
42Crunch Security Audit for WSO2 API Manager 3.1
The Role of IAM in Microservices
Identity Hub’s Role in Social Logins

What's hot (20)

PDF
7.Trust Management
PPTX
OAuth and OpenID Connect for PSD2 and Third-Party Access
PPTX
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
PPTX
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...
PPTX
WSO2 IoT Server - Product Overview
PPTX
A CONTEMPLATION OF OPENIG DEEP THOUGHTS
PDF
[WSO2Con EU 2018] Blockchain in the Business API Ecosystem - API Consumption ...
PPTX
apidays LIVE New York 2021 - Top 10 API security threats every API team shoul...
PDF
Pimping the ForgeRock Identity Platform for a Billion Users
PDF
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
PDF
[APIdays Singapore 2019] Managing the API lifecycle with Open Source Technolo...
PDF
Token vs Cookies (DevoxxMA 2015)
PDF
Open Banking and PSD2: Are your APIs ready for external testing?
PPTX
apidays LIVE Paris 2021 - How password managers are built for Privacy and Sec...
PPTX
Webinar: Identity Wars: The Unified Platform Awakens
PPTX
Identity Gateway with the ForgeRock Identity Platform - So What’s New?
PDF
Identiverse - Microservices Security
PDF
[WSO2Con EU 2018] A New Service Architecture for Effective Business Services
PDF
Identity Server on Azure: A Reference Architecture
PPTX
Provisioning IoT...Oh Baby You Know Meeee!
7.Trust Management
OAuth and OpenID Connect for PSD2 and Third-Party Access
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...
WSO2 IoT Server - Product Overview
A CONTEMPLATION OF OPENIG DEEP THOUGHTS
[WSO2Con EU 2018] Blockchain in the Business API Ecosystem - API Consumption ...
apidays LIVE New York 2021 - Top 10 API security threats every API team shoul...
Pimping the ForgeRock Identity Platform for a Billion Users
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
[APIdays Singapore 2019] Managing the API lifecycle with Open Source Technolo...
Token vs Cookies (DevoxxMA 2015)
Open Banking and PSD2: Are your APIs ready for external testing?
apidays LIVE Paris 2021 - How password managers are built for Privacy and Sec...
Webinar: Identity Wars: The Unified Platform Awakens
Identity Gateway with the ForgeRock Identity Platform - So What’s New?
Identiverse - Microservices Security
[WSO2Con EU 2018] A New Service Architecture for Effective Business Services
Identity Server on Azure: A Reference Architecture
Provisioning IoT...Oh Baby You Know Meeee!
Ad

Similar to [Cloud Identity Summit 2017] Oauth 2.0 Threat Landscapes (20)

PPTX
OAuth 2.0 Threat Landscape
PDF
Oauth 2.0 Security Considerations for Client Applications
PDF
OAuth 2.0 Threat Landscapes
PDF
Security for oauth 2.0 - @topavankumarj
PDF
OAuth 2.0 Security Reinforced
PPTX
Y U No OAuth?!?
PDF
Keeping Pace with OAuth’s Evolving Security Practices.pdf
PDF
Mobile Authentication - Onboarding, best practices & anti-patterns
PPTX
Intro to OAuth2 and OpenID Connect
PPTX
OAuth2 and OpenID with Spring Boot
PPTX
Y U No OAuth, Using Common Patterns to Secure Your Web Applications
PDF
Access Management for Cloud and Mobile
PPTX
OAuth 2
PPTX
PDF
Demystifying OAuth 2.0
PPTX
WebHack #13 Web authentication essentials
PDF
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
PDF
Full stack security
PPTX
OAuth 2.0
PPTX
Devteach 2017 OAuth and Open id connect demystified
OAuth 2.0 Threat Landscape
Oauth 2.0 Security Considerations for Client Applications
OAuth 2.0 Threat Landscapes
Security for oauth 2.0 - @topavankumarj
OAuth 2.0 Security Reinforced
Y U No OAuth?!?
Keeping Pace with OAuth’s Evolving Security Practices.pdf
Mobile Authentication - Onboarding, best practices & anti-patterns
Intro to OAuth2 and OpenID Connect
OAuth2 and OpenID with Spring Boot
Y U No OAuth, Using Common Patterns to Secure Your Web Applications
Access Management for Cloud and Mobile
OAuth 2
Demystifying OAuth 2.0
WebHack #13 Web authentication essentials
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
Full stack security
OAuth 2.0
Devteach 2017 OAuth and Open id connect demystified
Ad

More from WSO2 (20)

PDF
Demystifying CMS-0057-F - Compliance Made Seamless with WSO2
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
PDF
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
PDF
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
PDF
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
PDF
Platformless Modernization with Choreo.pdf
PDF
Application Modernization with Choreo for the BFSI Sector
PDF
Choreo - The AI-Native Internal Developer Platform as a Service: Overview
PDF
[Roundtable] Choreo - The AI-Native Internal Developer Platform as a Service
PPTX
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
PPTX
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
PPTX
WSO2Con 2025 - Building Secure Customer Experience Apps
PPTX
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
PPTX
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
PPTX
WSO2Con 2025 - Unified Management of Ingress and Egress Across Multiple API G...
PPTX
WSO2Con 2025 - How an Internal Developer Platform Lets Developers Focus on Code
PPTX
WSO2Con 2025 - Architecting Cloud-Native Applications
PDF
Mastering Intelligent Digital Experiences with Platformless Modernization
PDF
Accelerate Enterprise Software Engineering with Platformless
PDF
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Demystifying CMS-0057-F - Compliance Made Seamless with WSO2
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Platformless Modernization with Choreo.pdf
Application Modernization with Choreo for the BFSI Sector
Choreo - The AI-Native Internal Developer Platform as a Service: Overview
[Roundtable] Choreo - The AI-Native Internal Developer Platform as a Service
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2Con 2025 - Building Secure Customer Experience Apps
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
WSO2Con 2025 - Unified Management of Ingress and Egress Across Multiple API G...
WSO2Con 2025 - How an Internal Developer Platform Lets Developers Focus on Code
WSO2Con 2025 - Architecting Cloud-Native Applications
Mastering Intelligent Digital Experiences with Platformless Modernization
Accelerate Enterprise Software Engineering with Platformless
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Cloud computing and distributed systems.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Approach and Philosophy of On baking technology
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Modernizing your data center with Dell and AMD
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Approach and Philosophy of On baking technology
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The Rise and Fall of 3GPP – Time for a Sabbatical?
Advanced Soft Computing BINUS July 2025.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Modernizing your data center with Dell and AMD
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...

[Cloud Identity Summit 2017] Oauth 2.0 Threat Landscapes

  • 1. OAuth 2.0 Threat Landscapes Prabath Siriwardena (@prabath) Cloud Identity Summit, 2017.
  • 2. ABOUT ME 2 ▪  The Senior Director of Security Architecture, WSO2 ▪  Authored the book Advanced API Security - and three more
  • 9. THREATS / MITIGATIONS / BEST PRACTICES
  • 10. ▪  CSRF (Cross Site Request Forgery) ○  The attacker tries to log into the target website (OAuth 2.0 client) with his account at the corresponding identity provider. ○  The attacker blocks the redirection to the target web site, and captures the authorization code. The target web site never sees the code. ○  The attacker constructs the callback URL for the target site - and lets the victim, clicks on it. ○  The victim logs into the target web site, with the account attached to the attacker - and adds credit card information. ○  The attacker too logs into the target website with his/her valid credentials and uses victim’s credit card to buy goods. 10 SESSION INJECTION THREATS
  • 11. ▪  Short-lived authorization code ▪  Use the state parameter as defined in the OAuth 2.0 specification. ○  Generate a random number and pass it to the authorization server along with the grant request. ○  Before redirecting to the authorization server, add the generated value of the state to the current user session. ○  Authorization server has to return back the same state value with the authorization code to the return_uri. ○  The client has to validate the state value returned from the authorization server with the value stored in the user’s current session - if mismatches - reject moving forward. 11 MITIGATIONS / BEST PRACTICES SESSION INJECTION
  • 12. ▪  Use Proof Key for Code Exchange (PKCE) ○  https://tools.ietf.org/html/rfc7636 12 MITIGATIONS / BEST PRACTICES SESSION INJECTION
  • 13. ▪  The OAuth 2.0 client app generates a random number (code_verifier) and finds the SHA256 hash of it - which is called the code_challenge ▪  Send the code_challenge along with the hashing method in the authorization grant request to the authorization server. ▪  Authorization server records the code_challenge and replies back with the code. ▪  The client sends the code_verifier along with the authorization code to the token endpoint. 13 PROOF KEY FOR CODE EXCHANGE
  • 14. TOKEN LEAKAGE ▪  Attacker may attempt to eavesdrop authorization code/access token/ refresh token in transit from the authorization server to the client. ○  Malware installed in the browser (public clients) ○  Browser history (public clients / URI fragments) ○  Intercept the TLS communication between the client (confidential) and the authorization server (exploiting vulnerabilities at the TLS layer) ▪  Heartbleed ▪  Logjam ▪  Authorization Code Flow Open Redirector 14 THREATS
  • 15. ▪  A malicious app can register itself as a handler for the same custom scheme as of a legitimate OAuth 2.0 native app, can get hold of the authorization code. ▪  Attacker may attempt a brute force attack to crack the authorization code/access token. ▪  Attacker may attempt to steal the authorization code/access token/ refresh token stored in the authorization server. ▪  IdP Mix-Up / Malicious Endpoint 15 THREATS TOKEN LEAKAGE
  • 16. ▪  The OAuth 2.0 app provides multiple IdP options to login. ▪  The victim picks foo.idp from the browser - the attacker intercepts the request and change the selection to evil.idp. ▪  The client thinks it’s evil.idp and redirects the user to evil.idp. ▪  The attacker intercepts the redirection and modify the redirection to go to the foo.idp. ▪  The client gets either the code or the token (based on the grant type) and now will talk to the evil.idp to validate. ▪  The evil.idp gets hold of user’s access token or the authorization code from the foo.idp. 16 IDP MIXUP
  • 17. ▪  Always on TLS (use TLS 1.2 or later) ▪  Address all the TLS level vulnerabilities both at the client, authorization server and the resource server. ▪  The token value should be >=128 bits long and constructed from a cryptographically strong random or pseudo-random number sequence. ▪  Never store tokens in clear text - but the salted hash. ▪  Short-lived tokens. ○  LinkedIn has an expiration of 30 seconds for its authorization codes. 17 MITIGATIONS / BEST PRACTICES TOKEN LEAKAGE
  • 18. ▪  The token expiration time would depend on the following parameters. ○  Risk associated with token leakage ○  Duration of the underlying access grant ○  Time required for an attacker to guess or produce a valid token ▪  One-time authorization code ▪  One-time access token (implicit grant type) ▪  Use PKCE (proof key for code exchange) to avoid authorization code interception attack. ○  Have S256 as the code challenge method ▪  Enforce standard SQL injection countermeasures 18 MITIGATIONS / BEST PRACTICES TOKEN LEAKAGE
  • 19. ▪  Avoid using the same client_id/client_secret for each instance of a mobile app - rather use the Dynamic Client Registration API to generate a key pair per instance. ○  Most of the time the leakage of authorization code becomes a threat when the attacker is in hold of the client id and client secret. ▪  Restrict grant types by client. ○  Most of the authorization servers do support all core grant types. If unrestricted, leakage of client id/client secret gives the attacker the opportunity obtain an access token via client credentials grant type. 19 MITIGATIONS / BEST PRACTICES TOKEN LEAKAGE
  • 20. ▪  Enable client authentication via a much secured manner. ○  JWT client assertions ○  TLS mutual authentication ○  Have a key of size 2048 bits or larger if RSA algorithms are used for the client authentication ○  Have a key of size 160 bits or larger if elliptic curve algorithms are used for the client authentication ▪  White-list callback URLs (redirect_uri) ○  The absolute URL or a regEx pattern 20 MITIGATIONS / BEST PRACTICES TOKEN LEAKAGE
  • 21. ▪  IdP-Mixup ○  Use different callback URLs by IdP ○  https://tools.ietf.org/html/draft-ietf-oauth-mix-up-mitigation-01 ols.ietf.org/html/draft-ietf-oauth-mix-up-mitigaon-01 ▪  Token Binding ○  https://tools.ietf.org/html/draft-ietf-tokbind-protocol ○  https://tools.ietf.org/html/draft-ietf-tokbind-negotiation ○  https://tools.ietf.org/html/draft-ietf-tokbind-https ○  https://tools.ietf.org/html/draft-ietf-oauth-token-binding 21 MITIGATIONS / BEST PRACTICES TOKEN LEAKAGE
  • 22. TOKEN REUSE/MISUSE ▪  A malicious resource (an API / Microservice) could reuse an access token used to access itself by a legitimate client to access another resource, impersonating the original client. ▪  An evil web site gets an access token from a legitimate user, can reuse it at another web site (which trusts the same authorization server) with the implicit grant type ○  https://target-app/callback?access_token=<access_token> ▪  A legitimate user misuses an access token (issued under implicit grant type/SPA) to access a set of backend APIs in a way, exhausting server resources. 22 THREATS
  • 23. ▪  Use scoped access tokens. Qualify the scope name, with a namespace unique to the resource (resource server). ▪  The client obtains the access token for a given audience - by passing the audience information (representing the resource server) to the token endpoint - as per https://tools.ietf.org/id/draft-tschofenig-oauth- audience-00.html. ▪  Use OAuth for authorization not for authentication. ○  Use OpenID Connect for authentication 23 MITIGATIONS / BEST PRACTICES TOKEN REUSE/MISUSE
  • 24. ▪  To avoid exhausting resources at the server side, enforce throttle limits by user by application. In case an attacker wants to misuse a token - the worst he/she can do is to eat his/her own quota. 24 MITIGATIONS / BEST PRACTICES TOKEN REUSE/MISUSE
  • 25. OPEN TECHNOLOGY FOR YOUR AGILE DIGITAL BUSINESS THANK YOU