Security threats and mi0ga0ons for iOS developers Emil - - PowerPoint PPT Presentation

security threats and mi0ga0ons for ios developers
SMART_READER_LITE
LIVE PREVIEW

Security threats and mi0ga0ons for iOS developers Emil - - PowerPoint PPT Presentation

Security threats and mi0ga0ons for iOS developers Emil Kvarnhammar www.truesecdev.com Twi=er: @emilkvarnhammar Isnt iOS secure? Q1 2014 : goto fail; Q4


slide-1
SLIDE 1

Security ¡threats ¡and ¡mi0ga0ons ¡ for ¡iOS ¡developers ¡

Emil ¡Kvarnhammar ¡ www.truesecdev.com ¡ Twi=er: ¡@emilkvarnhammar ¡

slide-2
SLIDE 2
slide-3
SLIDE 3

Isn’t ¡iOS ¡secure? ¡

slide-4
SLIDE 4

Q1 ¡2014 ¡: ¡goto ¡fail; ¡

slide-5
SLIDE 5

Q4 ¡2014 ¡: ¡Wirelurker ¡(Masque ¡a9acks) ¡

slide-6
SLIDE 6

Q2 ¡2015 ¡: ¡New ¡Masque ¡A9acks ¡

slide-7
SLIDE 7

Q3 ¡2015 ¡: ¡AirDrop ¡vulnerability ¡

slide-8
SLIDE 8

Q3 ¡2015 ¡: ¡Xcode ¡Ghost ¡

slide-9
SLIDE 9

Xcode ¡Ghost ¡

slide-10
SLIDE 10

From ¡an ¡a=acker’s ¡point ¡of ¡view ¡

slide-11
SLIDE 11

What’s ¡of ¡interest? ¡

  • ExtracMng ¡app ¡data ¡

– Creden0als, ¡Documents, ¡Email ¡etc. ¡

  • Execute ¡code ¡

– Impersonate ¡legi0mate ¡apps ¡ – Steal ¡app ¡data ¡ – Phishing ¡(creden0als, ¡credit ¡card ¡details ¡etc.) ¡ – Command ¡& ¡Control ¡(botnets ¡etc.) ¡

slide-12
SLIDE 12

What ¡are ¡the ¡security ¡mechanisms? ¡

slide-13
SLIDE 13
  • 1. ¡App ¡store ¡review ¡

What ¡are ¡the ¡security ¡mechanisms? ¡

slide-14
SLIDE 14
  • 2. ¡Mandatory ¡code ¡signing ¡

What ¡are ¡the ¡security ¡mechanisms? ¡

slide-15
SLIDE 15

Used ¡to ¡bypass ¡app ¡store ¡review! ¡

slide-16
SLIDE 16
  • 3. ¡Sandboxing ¡

What ¡are ¡the ¡security ¡mechanisms? ¡

slide-17
SLIDE 17

Sandboxing ¡

  • Enforced ¡by ¡plaXorm ¡
  • Break-­‑out ¡vulnerabili0es ¡in ¡almost ¡all ¡versions ¡

– Used ¡by ¡jailbreaks ¡ – App ¡store ¡is ¡an ¡extra ¡safety ¡net ¡

  • Cross-­‑app ¡access ¡

– Extensions ¡ – Custom ¡URI ¡scheme ¡

slide-18
SLIDE 18
  • 4. ¡Data ¡protec0on ¡(at ¡rest) ¡

What ¡are ¡the ¡security ¡mechanisms? ¡

slide-19
SLIDE 19

Data ¡protec0on ¡

  • Default ¡encryp0on ¡since ¡iOS ¡8 ¡(if ¡passcode ¡set) ¡

– NSFileProtec0onComplete* ¡flags ¡

  • A=acks ¡

– Backups ¡(iCloud ¡or ¡iTunes) ¡ – Jailbreak ¡ – Masque ¡a=acks ¡

slide-20
SLIDE 20

Preven0ng ¡backup ¡of ¡file ¡

h=ps://developer.apple.com/library/ios/qa/qa1719/_index.html ¡ BOOL ¡success ¡= ¡[URL ¡setResourceValue: ¡[NSNumber ¡numberWithBool: ¡YES] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡forKey: ¡NSURLIsExcludedFromBackupKey ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡error: ¡&error]; ¡

slide-21
SLIDE 21

Keychain ¡items ¡

Use ¡*ThisDeviceOnly ¡access ¡keys ¡ ¡ ¡

Example: ¡kSecA=rAccessibleAperFirstUnlockThisDeviceOnly ¡

slide-22
SLIDE 22
  • 5. ¡App ¡Transport ¡Security ¡

What ¡are ¡the ¡security ¡mechanisms? ¡

slide-23
SLIDE 23

Client ¡Hello ¡ Server ¡Hello, ¡Cer0ficate ¡etc. ¡ Client ¡Key ¡Exchange ¡etc. ¡ Change ¡Cipher ¡Spec ¡ Applica0on ¡data ¡

Client ¡ Cert ¡is ¡validated ¡against ¡ trusted ¡CA ¡certs ¡in ¡client ¡ Server ¡

SSL/TLS ¡

AuthenMcity ¡ ConfidenMality ¡ Integrity ¡

slide-24
SLIDE 24

App ¡Transport ¡Security ¡

  • Enforces ¡best ¡prac0ces ¡for ¡server ¡connec0ons ¡

– h=ps ¡only ¡ – Only ¡trusted ¡cer0ficates ¡ – TLS ¡version ¡1.2, ¡with ¡forward ¡secrecy ¡

¡ Developers ¡must ¡explicitly ¡opt-­‑out ¡

¡ [ ¡ ¡ D

  • n

’ t ¡

  • p

t

  • ­‑
  • u

t ! ¡ ¡ ] ¡

slide-25
SLIDE 25

More ¡regarding ¡SSL/TLS… ¡

  • Cert ¡pinning ¡is ¡recommended ¡

– Validate ¡cer0ficate ¡chain ¡ – Validate ¡that ¡cert ¡corresponds ¡to ¡host ¡name ¡

  • If ¡you ¡use ¡AFNetworking… ¡

– Your ¡app ¡might ¡be ¡vulnerable ¡to ¡MiTM ¡a=tacks ¡ – Update ¡to ¡latest ¡version ¡

slide-26
SLIDE 26

Time ¡for ¡demos… ¡

slide-27
SLIDE 27

Masque ¡a=acks ¡

  • App ¡Masque ¡
  • URL ¡Masque ¡
  • Extension ¡Masque ¡
  • …and ¡more ¡

¡

h=ps://www.fireeye.com/blog/threat-­‑research/2015/06/three_new_masquea=.html ¡

slide-28
SLIDE 28

Injec0ng ¡code ¡in ¡Xcode ¡

  • Steal ¡Apple ¡ID ¡developer ¡account ¡
  • Inject ¡code ¡in ¡apps ¡
slide-29
SLIDE 29

Summary ¡

slide-30
SLIDE 30

Summary ¡

  • Several ¡great ¡security ¡mechanisms ¡in ¡iOS ¡
  • …but ¡also ¡vulnerabili0es ¡

– Apps ¡can ¡be ¡replaced ¡ – App ¡data ¡can ¡be ¡stolen ¡

  • A=ackers ¡a=ack ¡your ¡developer ¡machines ¡

– Patch ¡ – Encrypt ¡ – Be ¡careful ¡what ¡“tools” ¡you ¡are ¡downloading ¡

slide-31
SLIDE 31

Full ¡day ¡about ¡security ¡for ¡developers: ¡

Emil ¡Kvarnhammar ¡ www.truesecdev.com ¡ Twi=er: ¡@emilkvarnhammar ¡

h=p://oredev.org/2015/security-­‑day ¡

slide-32
SLIDE 32