00:00:01.134-->00:00:07.441 >>Right yeah lets welcome Kevin’s first time. DefCon welcome. Hello. Let’s hear it. 00:00:07.441-->00:00:18.986 [cheering] Let’s hear it. [cheering] [Applause] >>Wow. Woo [laughs] Ok. Good afternoon. Uh 00:00:18.986-->00:00:24.057 thank you for coming uh to this session. I’m very excited to talk to you, talk to you about a 00:00:24.057-->00:00:29.696 research your watch can watch you. About privilege pitfalls pitfalls and uh Samsung Gear 00:00:29.696-->00:00:39.706 smartwatch. Before we begin uh let me introduce us. Uh my name is Dongsung Kim and we are 00:00:39.706-->00:00:45.479 security research that called HAT some Sung Kyun Kwan University from South Korea. Uh 00:00:45.479-->00:00:51.752 if you have any questions or comments [applause] not the other one, uh please feel free 00:00:51.752-->00:01:01.161 to contact. So yeah. For the foremost uh let’s start with why we did this research and uh 00:01:01.161-->00:01:09.102 motivation behind. As you may well know the Gear series includes Samsung’s smartwatch 00:01:09.102-->00:01:16.910 products but apparently a few days ago they changed the name to the Galaxy watch. So for now 00:01:16.910-->00:01:23.650 just lets just pretend it didn’t happen. Uh [laughter] They are advertised to uh as offering 00:01:23.650-->00:01:30.924 many useful features including like tracking fitness or i uh receiving or replying to calls, 00:01:30.924-->00:01:38.065 texts, emails, and even paying for stuff using your NFC. Well typically you pair it with your 00:01:38.065-->00:01:45.906 smartphone and via bluetooth and it comes with uh WiFi or even LTE. Um some of them also 00:01:45.906-->00:01:53.680 operate on app marketplace uh for the Gear within Samsung Galaxy apps where anyone can 00:01:53.680-->00:02:02.823 just develop for the watch using the DSTK. To achieve all of this we share our uh highly sensitive 00:02:02.823-->00:02:08.161 information with the watch. Your contacts, your calendar, your location, emails. Under 00:02:08.161-->00:02:16.003 notifications there’s more all come from your smartphone or vice versa and access to such 00:02:16.003-->00:02:28.081 privilege resources must be uh permitted based on proper access rights. So the the firmware for 00:02:28.081-->00:02:36.723 um the uh Gear Smartwatch consists of 2 parts. So 1 is the wearable version of Tizen OS 00:02:36.723-->00:02:44.164 open source components. And the other is Samsung’s closed source components built on top of ah 00:02:44.164-->00:02:50.771 you know Tizen. So Tizen probably uh for those of you who don’t know is a Linux-based open 00:02:50.771-->00:02:59.079 source OS developed by Samsung. Uh since the OS was envisioned to serve all kinds of devices. 00:02:59.079-->00:03:05.018 Uh it has been shipped with many of Samsung’s products including your watches, including your 00:03:05.018-->00:03:13.093 smartphones probably, and TVs, uh cameras and even refrigerators. Uh Previously 00:03:13.093-->00:03:20.667 many researchers actually took a look at Tizen. In 2015 Abraham revealed many problems with 00:03:20.667-->00:03:30.644 Tizen at the time. In 2017 Neiderman disclosed 40 0-day vulnerabilities. And which made 00:03:30.644-->00:03:39.186 some media splashes. Uh PVS-Studios put in a live portion of the Tizen open source 00:03:39.186-->00:03:47.961 code base. Uh so so they claimed there would be uh more over 27-->000 of code errors. But uh 00:03:47.961-->00:03:56.236 this research uh served around Tizen as an OS. However we decided to take a look at the 00:03:56.236-->00:04:02.309 Gear as a smartwatch where the smart things actually happen as an extension to your smartphone. 00:04:02.309-->00:04:10.450 So it was the motivation so we need to get right into the uh internals of Tizen’s superior 00:04:10.450-->00:04:17.190 concepts. In this section we will highlight Tizen version 3. It’s the latest version publicly 00:04:17.190-->00:04:25.599 shared with the Gear smartwatch products. The first concept is optics uh obviously so since 00:04:25.599-->00:04:32.539 Tizen is based on Linux there are typical stuff like files and directories and sockets and 00:04:32.539-->00:04:38.044 utilities but in this talk however we’re going to focus on 2 types: applications versus 00:04:38.044-->00:04:44.885 services. So applications use Tizen’s public or private APIs to access the subsystems 00:04:44.885-->00:04:52.692 including uh framework and services. And services are special, have special privileges 00:04:52.692-->00:05:00.934 daemons, each dedicated specific resource like wifi or bluetooth and GPS and messaging, sensors, 00:05:00.934-->00:05:07.507 etcetera. These resources are by nature sensitive uh so some sort of control should be in place to 00:05:07.507-->00:05:17.284 reject unauthorized access. So Tizen achieved this by introducing the privilege 00:05:17.284-->00:05:26.493 services. Must validate if the calling app has this proper uh want. So similar to Android, app 00:05:26.493-->00:05:33.967 developer type in privilege strings in the manifest file. For example the on the right 00:05:33.967-->00:05:42.209 side of the slide uh you can see the manifest file. Uh and there's there are uh there are 00:05:42.209-->00:05:49.850 some uh privileges like http tizen org privilege internet or alarm set. These are privileged. 00:05:49.850-->00:05:58.358 Uh the app market or Samsung signs the TPK application package and sells it. On 00:05:58.358-->00:06:04.931 installation user accepts the permissions on the screen and then the installer checks and 00:06:04.931-->00:06:12.405 registers the policy in the database and finally it the runtime access is controlled by 00:06:12.405-->00:06:19.846 the policies. Well Tizen defines many privileges: internet, bluetooth, network set or more. 00:06:19.846-->00:06:27.721 However, only some of them are public to app developers. There are also partner and platform 00:06:27.721-->00:06:37.631 develop privileges not for public use. So to enforce this kind of privileges uh to the 00:06:37.631-->00:06:45.605 enforces the policies Tizen implements 3 plus 1 security mechanisms. Uh the first is the 00:06:45.605-->00:06:53.380 classic DAC, the UNIX uh user ID group ID uh. That you’re probably familiar with. The 00:06:53.380-->00:07:03.523 second is SMACK. SMACK uh is Tizen’s choice of kernel space mac I mechanism like uh SC 00:07:03.523-->00:07:11.298 LINUX. Uh the the specifics are a bit complex complex but conceptually they are they look 00:07:11.298-->00:07:16.736 like this on app receives uh unique [coughing] label and is insulation like user package 00:07:16.736-->00:07:25.545 sample app. And for every kernel opted to access to current label or context uh its checked 00:07:25.545-->00:07:34.054 against the rules in SMACK database. The third is shin Cynara. Cynara is Tizen’s user 00:07:34.054-->00:07:39.993 space privilege management daemon. Uh services ask Cynara to check if the calling 00:07:39.993-->00:07:47.233 application has the privilege. Cynara identifies the application by its SMACK label 00:07:47.233-->00:07:55.809 then validates it against the policies within its own Cynara database. And finally the plus 1 00:07:55.809-->00:08:02.916 security manager is a policy configurator and it reads the policies from from the file 00:08:02.916-->00:08:08.588 system and the manager’s file and here and there and uh it fills the databases we talked 00:08:08.588-->00:08:17.564 about, uh so DAC, SMACK, Cynara can recognize them. Now let’s talk about how applications 00:08:17.564-->00:08:26.639 actually talk to services. A D-Bus is a widely implemented IP system for LINUX like OS that 00:08:26.639-->00:08:33.246 also offers offers useful built in functions like discoverability or 00:08:33.246-->00:08:39.552 introspection. To put it simply, a service daemon registers itself to the D-Bus daemon then 00:08:39.552-->00:08:51.031 clients dispatch requests uh messages over a virtual channel. Tizen relies heavily on on D-Bus 00:08:51.031-->00:08:57.637 for [coughing] IPCs asterisk. So let me use some D-Bus uh concepts using an an example on 00:08:57.637-->00:09:04.444 the right. Uh a typical D-Bus message call. Eh it looks like this. So we wanna send a request 00:09:04.444-->00:09:10.583 from a client to a service. That’s uh the service process already has a set register in 00:09:10.583-->00:09:17.590 this case and the client process opens a connection to the D-Bus and the connection gets assigned 00:09:17.590-->00:09:24.898 a unique Bus name. It looks like colon something 1.7 in this case. So now the client sends a 00:09:24.898-->00:09:33.373 request message to the Bus and that message uh reaches the service uh whose connection also 00:09:33.373-->00:09:42.782 has a unique uh Bus name but also uh an optional wellknown Bus name org example service. 00:09:42.782-->00:09:52.525 This is the service name. Then the request is to invoke SetFoo method of the object slash org 00:09:52.525-->00:10:01.000 slash example slash object 1. Uh the object implements the interface org example interface 00:10:01.000-->00:10:09.609 which specifies methods like SetFoo and GetFoo. And finally the the service responds with a 00:10:09.609-->00:10:19.185 message. Oh sorry. So to recap in 1 sentence. The client processes a request from a Bus 00:10:19.185-->00:10:25.325 name colon 1.7 via the Bus to a Bus in org example service to invoke SetFoo method of the 00:10:25.325-->00:10:36.069 object org example object 1 of the interface org example interface. Yes. So the asteriks. 00:10:36.069-->00:10:45.645 Just because Tizen’s D-Bus is Cynara aware. Meaning it is patched to natively perform 00:10:45.645-->00:10:52.919 privilege checks. So when receiving a message the D-Bus daemon in the middle asks Cynara 00:10:52.919-->00:10:59.259 for validation. But this approach allows the D-Bus daemon to control access on messages. 00:10:59.259-->00:11:05.765 On the right example it shows the bixby uh assistant Bus configuration Bus configuration 00:11:05.765-->00:11:13.039 file. And you can see there is a check element uh with destination, interface, member 00:11:13.039-->00:11:21.247 method and and importantly privilege attribute bixby agent. So whenever D-Bus daemon 00:11:21.247-->00:11:27.387 receives a message it calls Cynara to see if the sender has the privilege then decide to 00:11:27.387-->00:11:37.530 accept or deny the message. Let’s dig a little deeper with an actual code example how an 00:11:37.530-->00:11:44.737 API call sends a request to service and it’s privilege gets validated. So we’re going to 00:11:44.737-->00:11:51.044 start with uh a location major API with proper location privilege. So left upper left 00:11:51.044-->00:11:57.350 upper code shows that the privilege string is in the manifest so the client process 00:11:57.350-->00:12:04.524 logic function below creates a manger handles starts the manager and then prints out the 00:12:04.524-->00:12:12.665 results to the log. Uh on the right in the shell of the actual device you can see the result is 00:12:12.665-->00:12:19.405 0 as expected which is a success. Then what happens if there is no privilege. Then lets 00:12:19.405-->00:12:27.246 try just the same thing then the result will come out uh negative 13, a failure. The log shows 00:12:27.246-->00:12:36.556 within the same PID, the process ID, with the written within the parenthesis parentheses shows a 00:12:36.556-->00:12:43.630 failure. Cynara check failed. Location library lu el uh library libls location is 00:12:43.630-->00:12:50.403 responsible for this log by calling location check Cynara function. Now this is the first 00:12:50.403-->00:13:00.246 privilege check on the chain of uh service request. Now this happens within the same PID this 00:13:00.246-->00:13:06.219 so by reverse engineering the location library we can pinpoint where this happens. Since the 00:13:06.219-->00:13:12.759 library is linked to the client within the same process ID, client can simply live patch the 00:13:12.759-->00:13:22.435 instructions. So remove the code and write 0 to register 0. Then we bypass the first check. Ah 00:13:22.435-->00:13:31.110 the left code shows the live patch and protect to enable right then simply just override 00:13:31.110-->00:13:38.584 the memory. When we run this the result is still negative search uh negative 1 3. However, the 00:13:38.584-->00:13:48.461 log changes eh uh D-Bus “access denied” message. Still within the same PID is printed out in 00:13:48.461-->00:13:58.304 violation of the privilege http something location. So we can see the D-Bus library LBS D-Bus 00:13:58.304-->00:14:05.578 client sends a request to LBS server and the uh error shows the request access is denied by 00:14:05.578-->00:14:13.886 D-Bus daemon which records Cynara in the middle. This is the second privilege check on 00:14:13.886-->00:14:24.597 the chain. So to recap on the top an app using location API links the location library then 00:14:24.597-->00:14:32.004 the library creates Cynara for the first time. If that passes a D-Bus request is sent. Then the 00:14:32.004-->00:14:39.145 D-Bus daemon in the middle creates Cynara for the second time. If that passes the 00:14:39.145-->00:14:44.617 location daemon receives a request which could potentially create Cynara for the third 00:14:44.617-->00:14:51.791 time. Then finally the request reaches the hardware below. Now we didn’t discuss the third 00:14:51.791-->00:15:03.302 check. Uh we’ll talk more about this in the next section. So what if the client is a malware? 00:15:03.302-->00:15:10.243 So if the client is malware there’s no first check anymore so there are 2 points that can 00:15:10.243-->00:15:16.816 pinpoint, that can actually secure the service. The second point D-Bus daemon in request in 00:15:16.816-->00:15:23.556 the middle. And the third point service daemon after receiving the request. If the OS service 00:15:23.556-->00:15:34.734 developer fails to implement both of them, then the the violation can happen. Now we 00:15:34.734-->00:15:42.175 know the background lets move on to actually finding violations. To do so let me introduce a 00:15:42.175-->00:15:50.016 simple tool developed named Dan the D-Bus analyzer. So the the idea is simple. So let’s say we 00:15:50.016-->00:15:57.890 send a D-Bus request to a safe service like the LBS server we saw with no argument given. 00:15:57.890-->00:16:03.563 Without the privilege then “access denied” is gonna get returned but with the privilege 00:16:03.563-->00:16:09.569 though invalid arguments is returned. Then when you think about it the error suggest 00:16:09.569-->00:16:18.010 privilege validations always happen first ahead of any other validation of the request. Then 00:16:18.010-->00:16:23.316 how about we send a non privilege request to all of them, all possible methods then 00:16:23.316-->00:16:30.556 the other ones that return any other errors that is not “access denied” that will comply the 00:16:30.556-->00:16:37.496 policies at least the D-Bus policies. Except non privilege request which could lead to 00:16:37.496-->00:16:48.674 violations. So we developed Dan. Dan automatically evaluates privilege verification of D-Bus 00:16:48.674-->00:16:55.982 services. It spawns a test process on a remote device [coughing] and then recursively 00:16:55.982-->00:17:01.954 scans the D-Bus structure. It then tries to read every property of every object also 00:17:01.954-->00:17:11.030 calling every method of every interface. After 1 round of analysis Dan writes 3 parts 3 00:17:11.030-->00:17:18.337 files 1 of is 1 is the whole D-Bus structure flattened into JSON file and the others are 00:17:18.337-->00:17:25.945 properties and methods that require further attention. Now let’s discuss how this works 00:17:25.945-->00:17:33.119 step by step. So first we gather all possible Bus names of services. Notice that as we 00:17:33.119-->00:17:39.191 discussed we one service can have multiple Bus names, 1 unique or 1 or more well known 00:17:39.191-->00:17:46.532 names. So from the extracted firmware we gather all names from files under user shared 00:17:46.532-->00:17:55.374 D-Bus 1. So as shown on the left image of system D 1 the service. From the run time we call we 00:17:55.374-->00:18:02.281 call the built in method list names to list all currently available Bus names as shown on 00:18:02.281-->00:18:08.955 the right image. You can see some are unique some are unique colon something something and 00:18:08.955-->00:18:15.394 some are well known like some in this case ah org pulseaudio server, net net config. Second 00:18:15.394-->00:18:25.972 we recursively introspect the services. That means gathering their structure objects 00:18:25.972-->00:18:34.480 interface method etcetera. Per the D-Bus specifications each service can respond with its 00:18:34.480-->00:18:42.388 object structure when the D-Bus standard message introspect is requested. The response is well 00:18:42.388-->00:18:49.829 formatted XML as shown on the right example. And this is the root object of system D and you 00:18:49.829-->00:19:01.273 can see the the interfaces methods and method arguments and child objects. Now in this step 00:19:01.273-->00:19:07.413 we try to read every property value. To do that we use the D-Bus standard method to get all 00:19:07.413-->00:19:14.687 on every object. But then uh uses the utility called the D-Bus standard, which is all of 00:19:14.687-->00:19:21.694 the default uh utilities. But however, the responses from get all method as shown on the left 00:19:21.694-->00:19:30.403 are not not quite well formatted for easy processing. So we made a custom Bison parser basically 00:19:30.403-->00:19:38.344 a compiler uh get all the JSON to convert to strings to into JSON compliant form as shown on 00:19:38.344-->00:19:48.454 the upper right. Next step. Uh the uh most important one we try to call every method of every 00:19:48.454-->00:19:55.327 interface for all the objects. When doing this we use random arguments. It’s gibberish thing 00:19:55.327-->00:20:01.467 so that the actual logic is not yet executed. Is is is not executed. Uh as shown above 00:20:01.467-->00:20:11.377 something like several strings of just 1. Then an error would be returned as we discussed 00:20:11.377-->00:20:19.118 since the privilege the the privilege gets validated. The uh validated first we ignore the 00:20:19.118-->00:20:26.158 message that return “access denied” so they they actually check the von they are actually 00:20:26.158-->00:20:36.035 checking so they are safe. But with any other error we assume the methods are callable. Though 00:20:36.035-->00:20:41.807 finally we hash every object to remove duplicates then print out the readable properties and 00:20:41.807-->00:20:49.515 callable methods. Now that was then. Now we got that out the way let’s move onto the fun 00:20:49.515-->00:20:59.759 part, the vulnerabilities. We ran our Dan with the target device Samsung Gear Sport. It 00:20:59.759-->00:21:06.499 took about an hour then then the results were like this. And the there were 269 Bus names from 00:21:06.499-->00:21:14.640 which there were over 130-->000 readable properties and over 2-->000 callable methods. This 00:21:14.640-->00:21:21.380 does not include the first default interface such as the D-Bus. That’s a lot of methods. 00:21:21.380-->00:21:31.423 But we do have some false positive uh because of the third check we mentioned. Uh the log 00:21:31.423-->00:21:38.297 show some services check Cynara, some services themselves explicitly checks Cynara. You 00:21:38.297-->00:21:46.372 can see on the right: Cynara check fail. But the method call itself uh does not return any 00:21:46.372-->00:21:53.746 D-Bus error so then tool cat categorize them callable. At this point we sort of manually 00:21:53.746-->00:22:02.288 examine each method. The 2-->000 of them. And it turns out it was worth it as we discovered many 00:22:02.288-->00:22:08.027 system services that allow privileges privilege violations. Malware without any privilege 00:22:08.027-->00:22:15.134 could take over WiFi, bluetooth, the screen, notifications, email, and so many more. Some a 00:22:15.134-->00:22:24.076 bit scary. So so now let’s take a look at them one by one. First we found the D-Bus API for the 00:22:24.076-->00:22:30.115 wpa supplicant was fully exposed. For those who don’t know, this is a free software 00:22:30.115-->00:22:38.824 implementation for uh 802 11 i which can easily be found on LINUX systems. Tizen builds its 00:22:38.824-->00:22:47.866 own APIs and daemons on top of wpa supplicant but we found every method is callable and 00:22:47.866-->00:22:55.241 every property is readable and that includes create interface, remove interface, scan, WPS scan 00:22:55.241-->00:23:04.416 WPS start, uh Getpin, P2P Find, connect and more. Now this expo exposure violates Tizen’s many 00:23:04.416-->00:23:11.457 network related privileges and also location related private ones too. Now let me give you 00:23:11.457-->00:23:18.397 some more [coughing] examples on that. Well many companies run a database from which GPS 00:23:18.397-->00:23:25.537 coordinates can be publicly obtained if the components are known. BSSID of nearby WiFI 00:23:25.537-->00:23:32.745 networks and their signal values. So even though location privileges, the location 00:23:32.745-->00:23:39.318 privileges isn’t granted or even the location then daemon is uh completely turned off, the 00:23:39.318-->00:23:47.760 malware can take can track the device by taking over WiFi. On the right example we acquire the 00:23:47.760-->00:23:56.468 BSSID of the first known WiFI network starting with 90 8d 78 and the signal value of negative 00:23:56.468-->00:24:04.843 51. So using Google’s geolocation API we have the GPS cor oh coordinates which is our 00:24:04.843-->00:24:16.955 lab. [coughing] Next we have bluetooth. The project x dot bt and project x bt core are 2 of 00:24:16.955-->00:24:24.196 uh Tizen’s own services for controlling bluetooth. These services partially expose 00:24:24.196-->00:24:31.337 methods where a malware can silently accept incoming bluetooth pair requests or 00:24:31.337-->00:24:39.244 silent your force uh to uh discovery mode or prompt a pairing request system UI to do 00:24:39.244-->00:24:46.885 phishing. Now on the right we have an example. So whenever a malware calls the method in the 00:24:46.885-->00:24:54.760 background or at any time the UI the first image pops up. But when the users scrolls down, 00:24:54.760-->00:25:03.469 they see the actual name of the paired smartphone. This system interface is suppose supposed to 00:25:03.469-->00:25:10.409 be one of the bluetooth uh pairing methods where the user manually manually types in the 00:25:10.409-->00:25:18.350 PIN. However if the user sh sees the UI without any initiation or without even entering the 00:25:18.350-->00:25:24.656 bluetooth discovery mode then user would think like “that’s weird” or “what does this PIN 00:25:24.656-->00:25:31.463 mean? Well does my phone that that’s the name of my phone so I guess I should punch in my PIN.” 00:25:31.463-->00:25:41.640 Then the value just gets returned to the malware. Now besides project X there is 00:25:41.640-->00:25:49.181 another daemon for bluetooth: bluez. Now bluez is uh the underlying bluetooth tech H for 00:25:49.181-->00:25:55.921 LINUX and we found that it’s ex APIs are partially exposed as well. A malware can silently 00:25:55.921-->00:26:03.429 force devices to disconnect uh and gather information as long. There is a bonus though than 00:26:03.429-->00:26:11.703 that H HCI dump we found on some devices that there is no restriction on HCI dump utility. 00:26:11.703-->00:26:17.276 As you can see on the right, what that means is that any malware or any user at can 00:26:17.276-->00:26:24.316 simply dump the incoming outgoing bluetooth packet with no super user privileges. Now by 00:26:24.316-->00:26:32.624 combining the 2 uh malware can start dumping HCI packets and force the paired device to ah 00:26:32.624-->00:26:39.698 disconnect which will automatically reconnect with a new link key. Then extract the 00:26:39.698-->00:26:46.472 key from the dump. Needless to say this problem violates Tizen’s bluetooth related also 00:26:46.472-->00:26:57.015 private privilege. Next we take over the screen too. Tizen’s choice of windows manager is the 00:26:57.015-->00:27:05.657 enlightenment project. Among many exposure methods dump top v wins somehow it this method 00:27:05.657-->00:27:12.431 dumps windows into png files as you can see on the right. Now this problem violates uh Tizen’s 00:27:12.431-->00:27:21.273 screenshot private privilege. And then we have the notification service. This 00:27:21.273-->00:27:27.813 service doesn’t only manage notification data but also can do stuff on behalf of users. Tap 00:27:27.813-->00:27:35.821 on the screen. So this service is also partially exposed as a result of malware can remove all 00:27:35.821-->00:27:43.462 the notifications or uh launch an application on the phone, read all the incoming messages, 00:27:43.462-->00:27:50.502 transmit data, and so on. Now in this case privilege like notification and push are are 00:27:50.502-->00:27:57.576 violated but there is no privilege assigned to this kind of invasive behavior. No 00:27:57.576-->00:28:05.817 application should actually be able to do this. Then finally we have emails. The wemails 00:28:05.817-->00:28:13.592 consumer manages the user’s mailbox data, just like the notification, it also lets 00:28:13.592-->00:28:19.531 anyone do stuff. A malware can launch the email app on the smartphone, modify email 00:28:19.531-->00:28:28.340 messages, and most importantly send any email using the user’s email address. So messaging and 00:28:28.340-->00:28:37.382 email related private privileges are correlated. But the most problematic thing is how this 00:28:37.382-->00:28:44.823 service actually handles private message. Actually sending an email request does get re 00:28:44.823-->00:28:52.331 rejected but how? On the right we have the code. At first we have the string wemail private 00:28:52.331-->00:29:01.173 send mail noti. Then it does string compare and nothing more. If it’s not a match the error 00:29:01.173-->00:29:09.414 shows up, IP is different but if it’s a match then we’re through. There is no proper privilege 00:29:09.414-->00:29:20.425 check in place and the only security here is that 1 string check. Now let me give you uh an 00:29:20.425-->00:29:35.507 actual demo that combines many of the problems we discussed into one neat little package. 00:29:35.507-->00:29:43.382 Here you can see our malware has no privilege. Now then we are building it uh and launching it 00:29:43.382-->00:29:48.787 on the target device on the right. The package is being loaded and the malware will look 00:29:48.787-->00:29:58.130 like a simple watch face application annnnnd there you go. Now the phone receives a 00:29:58.130-->00:30:05.370 Google hangouts notification that they they is handed over to the watch. That uh then let’s 00:30:05.370-->00:30:11.043 say the user puts the app in the background and after a bit of waiting the malware will start 00:30:11.043-->00:30:22.120 to run the code. Then the user is now checking the email. It’s waiting for awhile. Then the 00:30:22.120-->00:30:28.226 first it disconnects the bluetooth connection to the phone, then executes HCI dump 00:30:28.226-->00:30:37.769 for bluetooth packets for awhile. Then yes. Soon the connection will reestablish with 00:30:37.769-->00:30:47.279 a new link key then the malware will log the data like that. Then it also acquires the 00:30:47.279-->00:30:55.987 notification data. Now it starts to send the data to the hackers email using the user’s email 00:30:55.987-->00:31:02.861 account. It also captures the screen then sends the email image data. And now we are at 00:31:02.861-->00:31:12.304 the attacker’s screen. Uh emails should arrive soon. There you go. It’s taking awhile. And one 00:31:12.304-->00:31:19.578 thing to notice is that the emails are coming from the phone. You can see the 00:31:19.578-->00:31:27.285 notifications start to pop on top of the phone and and the watch. That and the watch. Yes. 00:31:27.285-->00:31:40.031 Now we are receiving the images. Each image is a window. This one. And there’s the code. No 00:31:40.031-->00:31:50.108 and this data is one part uh HCI pcap file and the other part a JSON object. So lets lets just 00:31:50.108-->00:31:57.482 parse it. Uh the JSON object is the internal data of the notification service. So you can 00:31:57.482-->00:32:06.658 see the message in the middle. From my my room password is something in the in the middle. 00:32:06.658-->00:32:16.001 Now finally examining the HCI pcap file shows the new link key like at the bottom. And that’s 00:32:16.001-->00:32:30.715 the demo. [applause] Thank you. [applause] Then why did all this happen? So we went through the 00:32:30.715-->00:32:38.623 configuration files to get a glimpse of it. First we have the notification service. You can 00:32:38.623-->00:32:44.963 see there are only 3 checks a limits listed. They try something but many other methods 00:32:44.963-->00:32:55.173 are simply missing. In the case of WiFi we can get a clue from the Tizen Wiki. The left diagram 00:32:55.173-->00:33:00.745 shows where how how it was designed on top of WPA supplicant there are Tizen’s 00:33:00.745-->00:33:07.552 connman daemon and net config daemon and then on top of that there’s the application. While 00:33:07.552-->00:33:14.593 the middleware is protected by the configuration files. That would be a supplicant 00:33:14.593-->00:33:21.266 configuration simply doesn’t exist. And why is that? Because how it actually works is on the 00:33:21.266-->00:33:28.874 right diagram. D-Bus is not a hierarchy like a supposed design on the left. The services are on 00:33:28.874-->00:33:41.553 the same Bus so they all need to be secured and it was neglected. Finally we went to the Galaxy 00:33:41.553-->00:33:47.993 app store since D-Bus client APIs are officially supported through the enlightenment. We 00:33:47.993-->00:33:57.669 were able to develop a proof of concept. We were able to uh submit uh uh an app called 00:33:57.669-->00:34:05.410 bitwatch. The the app watch face uh app watch face app only has internet related privileges but 00:34:05.410-->00:34:12.150 it dumps the notification internal data and sends it to a remote server. The app was 00:34:12.150-->00:34:18.056 submitted with some obfuscation to hide some strings and went through the verification process 00:34:18.056-->00:34:24.629 undetected as a malware. It went on sale for a brief uh brief amount of time until they took 00:34:24.629-->00:34:33.438 it down. We reported this research to Samsung in April. They were quick to respond with 00:34:33.438-->00:34:39.411 many patches committed to the Tizen open source repository and some firmware updates were 00:34:39.411-->00:34:50.488 released. Now lets uh wrap up. To recap, in this session we discussed the Tizen security 00:34:50.488-->00:34:56.194 internal [cough] and ah the objects and privileges. We focused on where they are 00:34:56.194-->00:35:03.001 validated. We talked about the 3 checkpoints, the client process, the Cynara aware D-Bus daemon, 00:35:03.001-->00:35:11.109 and the service process. Then we discussed Dan which is an access denied error message and is an 00:35:11.109-->00:35:17.849 oracle to discover a potential violations. And finally we disclosed the privilege 00:35:17.849-->00:35:24.055 violations that impact many systems services of the Gear smartwatch: WiFi, bluetooth, 00:35:24.055-->00:35:30.996 screen, notification, and email. Additionally we showed up the possibility of distribution via 00:35:30.996-->00:35:40.238 the the uh official store. So where we can we go from here? There may be some questions. Can 00:35:40.238-->00:35:47.278 this tool be applied to other Tizen systems like TVs or refrigerators? Or how about 00:35:47.278-->00:35:54.552 other D-Bus systems like LINUX? We can also think about some more advanced work around 00:35:54.552-->00:36:03.762 techniques to bypass phisher mitigations enforced by Galaxy app store. Uh that’s it for the 00:36:03.762-->00:36:07.799 session. I would like to thank Professor Hyoung-Kee Choi for his guidance. Hyoseok Lee for 00:36:07.799-->00:36:14.439 the initial research. Betty Bae for the proofreading. Uh and Gyeonghwan Hong, Shinjo Park, 00:36:14.439-->00:36:18.376 and John Steinbach for the advice. And that’s it. If you have any questions I would like 00:36:18.376-->00:00:00.000 to answer them. Thank you for listening. [applause]