authentication without authentication

65
Authentication Without Authentication AppSec Israel @omerlh

Upload: soluto

Post on 21-Jan-2018

185 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Authentication Without Authentication

Authentication Without Authentication

AppSec Israel@omerlh

Page 2: Authentication Without Authentication
Page 6: Authentication Without Authentication
Page 7: Authentication Without Authentication

- Helping people get the most out of their technology

Page 8: Authentication Without Authentication
Page 9: Authentication Without Authentication
Page 10: Authentication Without Authentication

“...a significant amount of drop-off in app usage,

losing up to 56% of users,

but are pretty much essential for the majority of apps

out there today...”

Source: Optimizely

Page 12: Authentication Without Authentication

Authenticate Request Per Second

Page 13: Authentication Without Authentication

Source: https://www.engadget.com/2016/01/08/samsung-family-hub-smart-fridge-hands-on/

Page 14: Authentication Without Authentication

Source: https://turcomusa.com/turcom-smart-home-camera-kit-with-motion-sensor-door-sensor-and-alarm-key-fob.html

Page 15: Authentication Without Authentication

User Id

Application Server

Page 16: Authentication Without Authentication

Device Id

Application Server

Page 17: Authentication Without Authentication

Agenda

● OpenID

● Digital Signature

● One Time Password

● Demo

● Edge Cases

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 18: Authentication Without Authentication

● “Simple Identity Layer”

● Token-based authentication

● Widely supported

● Modularity - many authentication flows

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 19: Authentication Without Authentication

Authorization Server

Application ServerDevice

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 20: Authentication Without Authentication

Supported Authentication Methods

Authorization/Implicit/Hybrid

Client credentials

Resource Owner

JWT client assertion

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 21: Authentication Without Authentication

We need a new authentication flow

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 22: Authentication Without Authentication

Authorization ServerDevice

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 23: Authentication Without Authentication

Authorization Server

Application ServerDevice

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 24: Authentication Without Authentication

Requirements

❏ Strong authentication solution

❏ Unique device identification

❏ Simple

❏ Unique per request

❏ Replay Attacks

❏ Fault tolerant

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 25: Authentication Without Authentication

Questions?

Page 26: Authentication Without Authentication

Let’s use Digital Signature

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 27: Authentication Without Authentication

Dear BobDear BobSign Verify

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Leo Bob the BuilderTM

Source: Bob the Buildertm Official Site

Page 28: Authentication Without Authentication

This sounds familiar...

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 29: Authentication Without Authentication

How we can use it?

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 30: Authentication Without Authentication

Authorization ServerDevice

Public Key, Id

Public Key, Id

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Id: 5467

Page 31: Authentication Without Authentication

Authorization ServerDevice

Digital Signature, Id

Public Key, Id

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Id: 5467

Page 32: Authentication Without Authentication

So far we have:

✓ Strong authentication solution

✓ Unique device identification

✓ Simple

❏ Unique per request

❏ Fault tolerant

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 33: Authentication Without Authentication

Questions?

Page 34: Authentication Without Authentication

One Time Password

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 35: Authentication Without Authentication

Authorization ServerDevice

Digital Signature, Id

Public Key, Id

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Id: 5467

Page 36: Authentication Without Authentication

Time Based

● Use current timestamp

● Allowed time range (e.g. +- 1

min)

● 2FA Solution

● Start with a random seed

● Increase by one after each

request

● Allowed value range (e.g. +- 5)

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Counter Based

Page 37: Authentication Without Authentication

Synchronization Issues

Page 38: Authentication Without Authentication

Let’s build our own OTP

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 39: Authentication Without Authentication

Client State Server State

Old 5

New 2

Old 5

New 2

Old 2

New 42Old 5

New 2

Old 2

New 42

Token

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 40: Authentication Without Authentication

So far we have…

✓ Strong authentication solution

✓ Unique device identification

✓ Simple

✓ Unique per request

✓ Fault tolerant

Page 41: Authentication Without Authentication

Questions?

Page 42: Authentication Without Authentication

Demo Time

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 43: Authentication Without Authentication

Client

Authorization

Server

Application Server

(Sensitive API)

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 44: Authentication Without Authentication

Let’s see it in action...All the code is available on GitHub

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 45: Authentication Without Authentication

Network request can fail

● Reasons:

○ Timeout

○ Network failure

○ Temporary server errors

● Unknown server state

○ State did not changed

○ State changed

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 46: Authentication Without Authentication

Client State Server State

Old 2

New 42

Old 1

New 2

Old 2

New 42

Old 2

New 42

Old 1

New 2

Token

Error

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 47: Authentication Without Authentication

Client State Server State

Old 2

New 42

Old 2

New 42

Old 1

New 2

Old 2

New 42Old 2

New 42Old 2

New 42

Error

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 48: Authentication Without Authentication

Client State Server State

Old 2

New 42

Old 2

New 42Old 42

New 86

Old 42

New 86

Old 2

New 42

Bad Request (400)

Token

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 49: Authentication Without Authentication

Questions?

Page 50: Authentication Without Authentication

What is the weakest link in the chain?

Page 51: Authentication Without Authentication

Detecting Compromised Devices

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 52: Authentication Without Authentication

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 53: Authentication Without Authentication

Client State Server State

Old 2

New 42

Old 1

New 2

Eve

Old 2

New 42

Old 1

New 2Old 2

New 42

Old 2

New 42 Token

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 54: Authentication Without Authentication

Client State Server State

Old 2

New 42

Old 2

New 42

Eve

Old 42

New 56

Old 2

New 42Old 2

New 42

Bad

Request

(400)

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 55: Authentication Without Authentication

Client State Server State

Old 42

New 78

Old 2

New 42

Eve

Old 42

New 56

Old 2

New 42Old 42

New 78

Old 42

New 78Token

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 56: Authentication Without Authentication

Client State Server State

Old 78

New 4

Old 7

New 78

Eve

Old 7

New 56

Old 7

New 78Old 7

New 93

400 Bad

Request

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 57: Authentication Without Authentication

OpenId --- Digital Signature --- One Time Password --- Demo --- Edges Cases

Page 58: Authentication Without Authentication

Questions?

Page 59: Authentication Without Authentication

Conclusion

Page 60: Authentication Without Authentication

Responsible Disclosure

Page 61: Authentication Without Authentication

Requirements

✓ Strong authentication solution

✓ Unique device identification

✓ Simple

✓ Unique per request

✓ Fault tolerant

Page 62: Authentication Without Authentication

Authorization ServerDevice

Page 63: Authentication Without Authentication

Authorization Server

Application ServerDevice

Page 64: Authentication Without Authentication
Page 65: Authentication Without Authentication

How can you use it?

@omerlh