Slide 1

Slide 1 text

Upgrading approaches to the secure mobile architectures #appbuilders16 @vixentael

Slide 2

Slide 2 text

OR

Slide 3

Slide 3 text

Everything will be BROKEN! #appbuilders16 @vixentael

Slide 4

Slide 4 text

Everything will be BROKEN, so what should we do? #appbuilders16 @vixentael

Slide 5

Slide 5 text

Intro: this is a picture

Slide 6

Slide 6 text

This is a picture: virgin sight network backend logic the app server environment #appbuilders16 @vixentael

Slide 7

Slide 7 text

UI/UX deliver fast! GTD! swift boring crap, waste of life maaaagic! magic.. MVP! #appbuilders16 @vixentael This is a picture: mobile focus

Slide 8

Slide 8 text

source of trust risk we control sandbox dragons lots of risk even if app is good easy to f*ck up #appbuilders16 @vixentael This is a picture: security vision

Slide 9

Slide 9 text

#appbuilders16 @vixentael This is a picture: the reality FBI CIA NSA hackers QA engineers

Slide 10

Slide 10 text

the brains! #appbuilders16 @vixentael This is a picture: our control

Slide 11

Slide 11 text

The problem

Slide 12

Slide 12 text

The problem bad cryptography insecure API’s plaintext traffic data leakage denial of service remote jailbreak over bluetooth stolen credentials man-in-the-middle

Slide 13

Slide 13 text

Openness Speed Ignorance The problem #appbuilders16 @vixentael

Slide 14

Slide 14 text

How bad is it? Like this Control Nissan LEAF via vulnerable APIs http://www.troyhunt.com/2016/02/controlling- vehicle-features-of-nissan.html #appbuilders16 @vixentael http://www.wired.com/2015/07/gadget-hacks- gm-cars-locate-unlock-start/ http://samy.pl/defcon2015/ hacking cars using OnStar app to locate, unlock and remote start vehicles what could possibly go wrong?

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

iMessage Recovery of Plaintext iMessage Data using Javascript http://www.bishopfox.com/blog/2016/04/if-you-cant-break-crypto-break-the-client- recovery-of-plaintext-imessage-data/ Grab all your iMess aHachments via key enumeraIon http://blog.cryptographyengineering.com/2016/03/attack-of- week-apple-imessage.html #appbuilders16 @vixentael

Slide 17

Slide 17 text

This is how bad it is! #appbuilders16 @vixentael iOS vulnerabilities by years raw data from cvedetails.com 0 100 200 300 400 2007 2008 2009 2010 2011 2012 2013 2014 2015 1 9 27 32 37 112 90 120 384

Slide 18

Slide 18 text

This is how bad it is! http://blog.mindedsecurity.com/2015/03/ssl- mitm-attack-in-afnetworking-251-do.html >1500 vulnerable apps via flawed AFNetworking <10% popular apps use SSL pinning #appbuilders16 @vixentael iOS vulnerabilities by years raw data from cvedetails.com 0 100 200 300 400 2007 2008 2009 2010 2011 2012 2013 2014 2015 1 9 27 32 37 112 90 120 384

Slide 19

Slide 19 text

SO WHAT?

Slide 20

Slide 20 text

Why does this even happen?

Slide 21

Slide 21 text

Our mindset is wrong a bit “It works” != “It’s secure” Mobile’s limited abilities require specific server behavior Mobile is not traditional client- server Design-driven development is frequently a security disaster #appbuilders16 @vixentael

Slide 22

Slide 22 text

Mobile is an odd thin client #appbuilders16 @vixentael – Can server really address you by IP address? – Can server expect RFC behavior of your IP stack? – Can server and client share code and components with proper trust? – Is IPC / RPC behavior reciprocal between client and server? – Is client and server equal in their capacity for technical decisions? Mobile considers itself in a proper client-server relationship, but:

Slide 23

Slide 23 text

Mobile is an odd thin client #appbuilders16 @vixentael – Can server really address you by IP address? – Can server expect RFC behavior of your IP stack? – Can server and client share code and components with proper trust? – Is IPC / RPC behavior reciprocal between client and server? – Is client and server equal in their capacity for technical decisions? Mobile considers itself in a proper client-server relationship, but: NOPE ;)

Slide 24

Slide 24 text

Mobile security is hard and yet undeveloped #appbuilders16 @vixentael Sophisticated problems security-wise No well established techniques Very blurred risk models

Slide 25

Slide 25 text

What exactly are we risking?

Slide 26

Slide 26 text

Identity Data Control What we risk? #appbuilders16 @vixentael

Slide 27

Slide 27 text

Data #appbuilders16 @vixentael personal data health data conversations certificates passwords contacts users’ data

Slide 28

Slide 28 text

Identity #appbuilders16 @vixentael identification (credentials) attacker access allowed! application

Slide 29

Slide 29 text

Control #appbuilders16 @vixentael Remember those cars, right?

Slide 30

Slide 30 text

What should we do?

Slide 31

Slide 31 text

Understand the strong sides #appbuilders16 @vixentael limited ecosystem low collateral risk things user has and you can trust authentication/trust is quite good data safety almost network passive narrowed threat scope

Slide 32

Slide 32 text

Trust no one. But yourself #appbuilders16 @vixentael trust server less explicit trust involve users ☁

Slide 33

Slide 33 text

Echelonization #appbuilders16 @vixentael if the system has one perimeter, it will fail!

Slide 34

Slide 34 text

Echelonization #appbuilders16 @vixentael authenticate manually verify credentials use many factors ..add more layers of defense!

Slide 35

Slide 35 text

Compartmentalization #appbuilders16 @vixentael limit the access to information to those who need to know it in order to perform certain tasks store secure transmit display

Slide 36

Slide 36 text

SO WHAT?

Slide 37

Slide 37 text

Practice time! techniques for your architectures

Slide 38

Slide 38 text

Do all classic things #appbuilders16 @vixentael https://speakerdeck.com/vixentael/avoiding-damage-shame-and- regrets-data-protection-for-mobile-client-server-architectures Protect transport well, authenticate server, pin certificates Authenticate everything Encrypt everything in motion and at rest Protect keys well Then escalate with novel techniques read my previous slides

Slide 39

Slide 39 text

End-to-end encryption 101 #appbuilders16 @vixentael users own all keys server can’t see anything important transport keys are ephemeral app state does not rely on server state ☁

Slide 40

Slide 40 text

End-to-end encryption 101+1 #appbuilders16 @vixentael https://cossacklabs.com/choose-your-ios-crypto.html large + text

Slide 41

Slide 41 text

Multi-factor authentication #appbuilders16 @vixentael things you have things you know things you are phone device sim card ID docs private/public key password address answer to quesIon biometrics of all kinds

Slide 42

Slide 42 text

Multi-factor authentication #appbuilders16 @vixentael things you have things you know things you are phone device sim card ID docs private/public key password address answer to quesIon biometrics of all kinds 2+ = MFA && &&

Slide 43

Slide 43 text

Zero-knowledge: problem no trust :( #appbuilders16 @vixentael

Slide 44

Slide 44 text

Zero-knowledge: proof! trust :) #appbuilders16 @vixentael https://cossacklabs.com/introducing_secure_comparator.html wanna know more?

Slide 45

Slide 45 text

Is this it?

Slide 46

Slide 46 text

Combining things: secure app v.1 SSL storage encryption storage encryption data leakage MiTM weak SSL #appbuilders16 @vixentael

Slide 47

Slide 47 text

Combining things: secure app v.2 end-to-end encryption #appbuilders16 @vixentael storage encryption storage encryption weak auth blind trust ephemeral keys protected transport

Slide 48

Slide 48 text

Combining things: secure app v.3 #appbuilders16 @vixentael end-to-end encryption storage encryption storage encryption ephemeral keys protected transport MFA ZKP

Slide 49

Slide 49 text

It is simple, isn’t it?

Slide 50

Slide 50 text

Key points #appbuilders16 @vixentael 1. read these slides again, tapping on links 2. read ‘Additional reading’ 3. read my previous presentations 4. analyze your current system 5. implement the techniques 6. ??? 7. profit! …feel free to contact me

Slide 51

Slide 51 text

Thank you for listening @vixentael iOS developer at stanfy.com iOS contributor at Themis/cossacklabs.com

Slide 52

Slide 52 text

Additional reading https://medium.com/stanfy-engineering-practices/data-protection-for-mobile-client-server- architectures-6e6dcabd871a Data Protection For Mobile Client-Server Architectures http://mashable.com/2016/04/16/apple-security-explained/ How Apple Security works https://www.cossacklabs.com/avoid-ssl-for-your-next-app.html Why you should avoid ssl for your next application https://cossacklabs.com/choose-your-ios-crypto.html Crypto in iOS: choose your destiny https://www.owasp.org/index.php/IOS_Application_Security_Testing_Cheat_Sheet OWASP: iOS application security testing cheat sheet