1 00:00:00,000 --> 00:00:01,840 So, I guess we start. 2 00:00:01,840 --> 00:00:04,600 Thanks everybody for showing up so early. 3 00:00:05,020 --> 00:00:08,600 I guess we are the first talk today on the IoT Village. 4 00:00:09,600 --> 00:00:13,720 I still need to get this somewhere near my mouth. 5 00:00:14,520 --> 00:00:18,540 So, I'm Daniel, this is Jiska and Caroline. 6 00:00:18,600 --> 00:00:23,700 And we will present our work on Fitbit fitness trackers. 7 00:00:23,700 --> 00:00:28,420 Our talk is called Fitness Firmware Hacking, the Current State of the Heart. 8 00:00:28,420 --> 00:00:34,360 And this basically summarizes our research from the last few years. 9 00:00:34,400 --> 00:00:40,260 And all the work we are presenting was done in the secure mobile networking lab. 10 00:00:41,580 --> 00:00:43,780 So, a brief motivation. 11 00:00:44,560 --> 00:00:58,480 A few years ago, I guess like 2017, there was this article in the Telegraph, which talks about privacy in the Fitbit fitness trackers. 12 00:00:58,480 --> 00:00:59,920 But that's not so important. 13 00:00:59,920 --> 00:01:09,520 What's more important here is this comment from this guy, who says basically, please modify my Fitbit so that I run 10k every day. 14 00:01:09,520 --> 00:01:13,920 And we thought, why not help this poor soul achieving his goals. 15 00:01:13,920 --> 00:01:37,560 And also, if you look like insurance companies, you will get up to 1500 bucks bonuses if you upload your fitness data to the insurance companies to show them that you are healthy and stuff like this. 16 00:01:37,960 --> 00:01:41,760 So, let's start with the version comparison. 17 00:01:42,860 --> 00:01:54,220 So, today we are going to show you several issues and hacks and modifications that are applying to very different versions of the Fitbit. 18 00:01:54,220 --> 00:02:00,340 So, we started with the Flex as a simple tracker and also the ChargeHR. 19 00:02:00,440 --> 00:02:04,540 But Caroline did a lot of work on the Fitbit Ionic. 20 00:02:05,000 --> 00:02:13,500 So, there will be very different things on top of this because the Fitbit Ionic has different interfaces, which she will tell you. 21 00:02:13,500 --> 00:02:16,540 Apart from this, all of them are ARM-based. 22 00:02:16,540 --> 00:02:26,380 So, the architecture is definitely similar for the Flex and ChargeHR and somewhat similar for the Ionic. 23 00:02:28,580 --> 00:02:35,760 Yeah, the Fitbit Ionic is the first device within Fitbit's product portfolio to be marketed as an actual smartwatch. 24 00:02:35,880 --> 00:02:41,220 And this is because it introduces a number of new functionalities and interfaces. 25 00:02:41,320 --> 00:02:44,680 So, for instance, it does not only have GPS or Bluetooth. 26 00:02:44,680 --> 00:02:47,500 It also has a Wi-Fi interface and NFC. 27 00:02:47,500 --> 00:02:53,920 And it has something that is called Fitbit Pay, which essentially allows you to contactlessly pay with your watch. 28 00:02:53,960 --> 00:03:00,480 And you can develop your own custom applications in JavaScript using, for instance, an online IDE called Fitbit Studio. 29 00:03:00,600 --> 00:03:08,500 And, of course, it synchronizes data over Bluetoothable energy using some form of application, for example, on a smartphone or computer. 30 00:03:09,280 --> 00:03:14,040 And, of course, it has a number of different sensors for capturing the user's fitness data. 31 00:03:14,040 --> 00:03:21,460 And you can store music files, download radio station playlists, for example, from Deezer or Pandora, and connect your Bluetooth headphones. 32 00:03:21,460 --> 00:03:28,340 And the Hungry Cat marks the parts of the Fitbit Ionic that we thought were the most interesting in terms of security research. 33 00:03:31,980 --> 00:03:38,940 So, I'm now going to introduce the communication between the Fitbit and the server. 34 00:03:38,940 --> 00:03:45,840 And this part is very important for you to remember to understand the remaining part of the talk. 35 00:03:45,840 --> 00:03:53,760 So, you have a Fitbit fitness tracker, and this is connected over Bluetooth LE to the smartphone app. 36 00:03:53,760 --> 00:04:06,100 And this connection is not that secure, so it's not that important that it's not so secure because the app is only forwarding this traffic over HTTPS to the server. 37 00:04:06,100 --> 00:04:10,560 And the traffic is end-to-end encrypted with a device-specific symmetric key. 38 00:04:10,560 --> 00:04:22,160 So, each Fitbit will have its own key, 128-bit key, during fabrication of it, and it will be used for encryption. 39 00:04:23,880 --> 00:04:37,000 And this encryption only has been on recent trackers only, which means... well, recent... I mean, we started some years ago, so any model introduced after 2015 has encryption enabled by default. 40 00:04:37,240 --> 00:04:41,680 So, you cannot disable it, but on the oldest you could. 41 00:04:42,060 --> 00:04:48,360 And then also, there was a memory attack that was not patched in all trackers. 42 00:04:48,360 --> 00:04:52,180 It was only patched in October 2017 on all trackers. 43 00:04:52,180 --> 00:04:57,580 So, there were some possibilities in all the trackers to analyze this communication in plain text. 44 00:04:58,440 --> 00:05:00,060 So, what is happening? 45 00:05:00,060 --> 00:05:10,720 If you are running, so if you're Suzy Fit here in the example, you would run and then you have steps that are recorded on the tracker locally. 46 00:05:10,720 --> 00:05:15,700 And this locally stored data could be something like a week of activity data. 47 00:05:15,700 --> 00:05:27,120 But usually, if you're connected to the smartphone app, this data will be transferred to the server, just forwarded, and then it will be added to the activity database. 48 00:05:27,120 --> 00:05:38,880 And this activity database has this data then in plain text, but you need to actually log in with your smartphone to see this data in JSON. 49 00:05:39,140 --> 00:05:46,520 So, you would get summaries, like all the steps of the last week or something, in JSON. 50 00:05:46,780 --> 00:05:53,200 And the mega dumps itself, so the binary format from the tracker will also be answered with some settings from the server. 51 00:05:53,200 --> 00:05:55,280 So, this is a different communication here. 52 00:05:55,280 --> 00:05:59,320 What you see in JSON is a different thing than what you will see in the micro dump, mega dump. 53 00:06:01,500 --> 00:06:11,560 And now, there is a very interesting concept, because let's say I have my current step count or my heart rate, and I would like to see it in the smartphone app. 54 00:06:11,660 --> 00:06:17,280 That would be very inefficient to send it to the server each time, let the server decrypt, send it back in JSON, and so on. 55 00:06:17,340 --> 00:06:19,300 So, there is a live mode. 56 00:06:19,380 --> 00:06:32,280 And the idea here is that the user is logging in to the server, does a local pairing with the tracker, and then there is a remote association, so each time I would log in again, I would see the data from this tracker. 57 00:06:32,580 --> 00:06:36,860 And the smartphone app, actually, in this step, also gets authentication credentials. 58 00:06:37,460 --> 00:06:45,420 These credentials are only obtained once, so that you can later use them offline, so that you don't need the server for getting more data. 59 00:06:45,700 --> 00:06:50,100 And in this authenticated live mode, you would get plain text data. 60 00:06:50,960 --> 00:06:56,260 So, that is only the thing that you see as a summary on the display. 61 00:06:56,260 --> 00:07:00,720 So, it's only the total step count of the day, the current hide rate, and so on. 62 00:07:01,180 --> 00:07:04,820 And there was also the possibility for a memory readout. 63 00:07:04,880 --> 00:07:14,220 And since you can reuse this forever, even if you associate the tracker another time, this is kind of a critical thing here. 64 00:07:14,220 --> 00:07:18,980 But we can also understand why they did it this way, because it's for the offline usage. 65 00:07:18,980 --> 00:07:22,100 So, it's kind of by design that you can reuse it forever. 66 00:07:23,560 --> 00:07:27,800 So, Karin is now going to tell you about the additions on the Ionic smartwatch. 67 00:07:28,800 --> 00:07:36,240 So, as I've said, the Fitbit Ionic introduces new functionality and has new interfaces that have not been there in previous trackers. 68 00:07:36,240 --> 00:07:41,340 And for this reason, the communication paradigm has also been a bit modified. 69 00:07:41,640 --> 00:07:46,760 What remains largely the same is pretty much things like so-called server dumps. 70 00:07:46,760 --> 00:07:49,100 This is something that Disco already told you about. 71 00:07:49,100 --> 00:07:52,220 It's essentially a generalization of micro and mega dumps. 72 00:07:52,220 --> 00:07:57,680 And they are sent from the Fitbit service over the Fitbit smartphone application to the Fitbit smartwatch. 73 00:07:57,760 --> 00:08:02,160 And also, the entire communication on top of plutable energy is very similar. 74 00:08:02,160 --> 00:08:04,300 But there are also some new concepts. 75 00:08:04,300 --> 00:08:10,400 For example, something that we called app dumps, that I'm going to talk to you about later on in more detail. 76 00:08:10,700 --> 00:08:21,540 And the Fitbit Ionic's Wi-Fi interface is used during the installation of a custom application mainly for WebSocket traffic and also for downloading firmware during a firmware update. 77 00:08:21,540 --> 00:08:22,680 And that's pretty much it. 78 00:08:22,680 --> 00:08:26,240 Everything else is still relayed over the smartphone application. 79 00:08:26,420 --> 00:08:32,840 And the NFC interface is only used for the transmission of payment traffic to and from a payment terminal. 80 00:08:32,900 --> 00:08:37,060 And of course, as I've said, you can connect your Bluetooth headphones using Bluetooth. 81 00:08:40,590 --> 00:08:45,950 Okay, so one important step during our research was accessing the hardware. 82 00:08:45,950 --> 00:08:53,570 You can start with disassembling the app, of course, or taking dumps from, I don't know, HTTPS. 83 00:08:53,570 --> 00:09:00,010 But to get the whole picture, we thought we also want to get access to the hardware itself. 84 00:09:00,230 --> 00:09:11,950 So, to quickly show you our thread model, we still have Suzy Fit, who stores her activity locally on her tracker. 85 00:09:11,950 --> 00:09:15,990 And of course, this tracker has a local symmetric device key. 86 00:09:16,310 --> 00:09:26,470 But now what happens if Suzy is not so active anymore and likes to modify her own data or get her own data? 87 00:09:26,910 --> 00:09:32,650 So our goals are to access the local data storage and to get the encryption keys. 88 00:09:32,810 --> 00:09:38,610 So the first stuff you do, of course, is to search for eBay and buy all the trackers you get your hands on. 89 00:09:38,610 --> 00:09:44,690 And so in our case, the Fitbit Flex was pretty cheap already. 90 00:09:44,690 --> 00:09:50,970 So broken ones you could get up into patches of 20 for $1 each. 91 00:09:52,250 --> 00:09:59,710 And so here's a quick look at the hardware and software of the Fitbit Flex. 92 00:09:59,710 --> 00:10:03,150 So you have your main system on a chip. 93 00:10:03,610 --> 00:10:07,610 You have, which in this case is a chip from STM. 94 00:10:07,610 --> 00:10:11,450 It runs a Cortex-M3 arm. 95 00:10:11,970 --> 00:10:17,890 And the firmware consists of a few libraries which we identified they used. 96 00:10:17,890 --> 00:10:21,050 So for encryption, for example, they used libtomcrypt. 97 00:10:21,050 --> 00:10:25,970 And for BLE, they used a library which is very similar to libble-shield. 98 00:10:26,190 --> 00:10:37,410 And of course, apart from the main sock, you also have your Bluetooth chip, which is from Nordic Semiconductors and an accelerometer. 99 00:10:37,410 --> 00:10:42,550 And here in the Fitbit Flex example, everything is connected via a new R bus. 100 00:10:43,190 --> 00:10:47,830 So if you pry open the hardware, this is pretty easy on the Fitbit Flex. 101 00:10:47,830 --> 00:10:55,090 You just use a heating gun, heat it up, and then you can basically pull it apart and you will get to the PCB. 102 00:10:55,190 --> 00:11:01,910 So here we already removed the battery and the vibration sensor or vibration actuator. 103 00:11:02,590 --> 00:11:06,450 And so you already see that there are many testing points. 104 00:11:06,450 --> 00:11:09,270 And the most important ones are these. 105 00:11:09,590 --> 00:11:13,690 So TP8 and 9 are used for SWD debugging. 106 00:11:13,690 --> 00:11:19,890 And you can use just the ground for the battery to connect it to your debugger. 107 00:11:20,410 --> 00:11:25,410 And apart from this, there is also TP10, which you can use for resetting. 108 00:11:26,150 --> 00:11:27,690 And yeah, that's it. 109 00:11:27,690 --> 00:11:32,590 Then you have everything you need to hook it up to a debugger. 110 00:11:32,590 --> 00:11:37,490 And so here on the right-hand side, this is how it looked in our case. 111 00:11:37,490 --> 00:11:44,450 We just used the ST-Link debugger from STM in the breadboard, basically. 112 00:11:44,530 --> 00:11:49,810 And with this, we were already able to read out all the memory. 113 00:11:50,470 --> 00:11:54,050 So it basically consists of three big parts. 114 00:11:54,050 --> 00:11:57,490 A flash, an EEPROM, and an SRAM. 115 00:11:57,590 --> 00:12:01,090 The flash contains, of course, all the firmware code. 116 00:12:01,090 --> 00:12:05,870 The EEPROM stores all the data you want to get your hands on. 117 00:12:05,970 --> 00:12:09,750 And the SRAM, of course, for firmware variables. 118 00:12:11,810 --> 00:12:18,310 If you have a closer look at the flash, you will see that it consists of two big parts. 119 00:12:18,650 --> 00:12:21,110 An app part and a BSL part. 120 00:12:21,110 --> 00:12:23,950 Iska will tell you more about these later. 121 00:12:24,130 --> 00:12:28,030 But the important thing is that they can run independently from each other. 122 00:12:28,030 --> 00:12:39,050 And the EEPROM, as I said, contains all your fitness data, but also the serial number of the Fitbit, an encryption key, and an encryption switch. 123 00:12:39,050 --> 00:12:43,170 So with this switch, it was possible to disable encryption completely. 124 00:12:43,170 --> 00:12:48,930 But nowadays, the backend will not accept connections which are not encrypted anymore. 125 00:12:48,930 --> 00:12:50,570 So this does not work anymore. 126 00:12:52,650 --> 00:12:57,050 So one important step also was to re-enable GDB access. 127 00:12:57,050 --> 00:13:08,010 What we discovered is that you were only able to connect to the Fitbit if you did a reset before this. 128 00:13:08,730 --> 00:13:17,110 And after this, if you hit continue on your GDB, the connection to the debugger will be lost. 129 00:13:17,110 --> 00:13:26,310 So at some point in time, it apparently remaps the GPIO ports to something else, but not to something which we need for debugging. 130 00:13:26,310 --> 00:13:31,510 So we thought, why not reset them to something which we actually need? 131 00:13:31,790 --> 00:13:36,170 And what we used for this is the Nexmon patching framework. 132 00:13:36,170 --> 00:13:46,010 So we already developed this for a previous project, and with this framework, we are able to binary patch the stuff, basically. 133 00:13:46,170 --> 00:13:48,270 And we adapted it for our needs. 134 00:13:49,450 --> 00:13:55,170 Of course, our goal was to modify the firmware and enable the dynamic debugging. 135 00:13:56,850 --> 00:14:03,370 So this is what the core graph looks like after initialization. 136 00:14:03,370 --> 00:14:06,630 So at the beginning, GDB access still works. 137 00:14:06,630 --> 00:14:10,250 And somewhere after the initialization, it doesn't work anymore. 138 00:14:10,250 --> 00:14:19,090 So I have no idea where exactly these GPIO pins are reassigned, but I actually don't need to know. 139 00:14:19,090 --> 00:14:31,110 What we just did instead is to add an additional Bluetooth command to remap the GPIO ports to re-enable GDB access. 140 00:14:31,530 --> 00:14:43,250 And for this, we did this with a special Bluetooth command, because we did not know which other use case they had for the GPIO pins. 141 00:14:43,250 --> 00:14:47,360 And we just wanted to keep the side effects as small as possible. 142 00:14:49,090 --> 00:14:54,170 And with this, of course, then we were able to have break points and memory watch points and all the good stuff. 143 00:14:58,180 --> 00:15:02,680 So naturally, we also had to look at the Fitbit Ionix hardware. 144 00:15:03,060 --> 00:15:06,880 And we did this by using two broken Fitbit Ionix smartwatches. 145 00:15:06,880 --> 00:15:13,340 And the goal was for us to understand the hardware that is used and also to find possibilities for debugging. 146 00:15:13,340 --> 00:15:19,160 And what you see on the picture below is the Fitbit Ionix main PCB being powered by its battery pack. 147 00:15:19,160 --> 00:15:24,720 And it has 39 copper wires soldered to its back and is connected to a logic analyzer. 148 00:15:24,720 --> 00:15:30,860 And since the Fitbit Ionix main PCB is rather small, this entire setup always reminds me of the Flying Spaghetti Monster. 149 00:15:32,080 --> 00:15:40,400 What you see on this picture are all the hardware markings that we deciphered from the chips on the Fitbit Ionix main PCB using a microscope. 150 00:15:40,640 --> 00:15:48,600 And what you see from this is that the Fitbit Ionix uses a Cypress Bluetooth chip, a Broadcom Wi-Fi and an NXP NFC chip. 151 00:15:48,600 --> 00:15:53,480 And also the CPU and the flash memory are manufactured by Toshiba. 152 00:15:53,580 --> 00:15:58,280 And the CPU is custom-built for wearables and smartwatches. 153 00:15:58,400 --> 00:16:01,700 And it contains an ARM Cortex-M4. 154 00:16:01,700 --> 00:16:08,840 And it does not have JTAG interface, but instead uses SWD, which is short for Serial Wire Debug. 155 00:16:08,880 --> 00:16:15,920 And on the right-hand side, you see a comparison of the Fitbit Ionix main PCB to the main PCB of the Fitbit Flex. 156 00:16:15,920 --> 00:16:25,020 And what is noticeable is that the Fitbit Ionix has a lot more stuff going on on the PCB and it's a lot more densely packed and more complex. 157 00:16:25,020 --> 00:16:27,700 So there's definitely an involvement there. 158 00:16:28,680 --> 00:16:30,960 This is the main PCB from the back. 159 00:16:30,960 --> 00:16:34,280 With all the different testing points, there are 95 in sum. 160 00:16:34,280 --> 00:16:39,020 And we tested 39 of them using the logic analyzer under different conditions. 161 00:16:39,020 --> 00:16:44,600 And we wanted to identify which testing points correlate to the SWD interface. 162 00:16:44,600 --> 00:16:50,420 Unfortunately, Murphy's Law, this did not yield the desired result. 163 00:16:50,480 --> 00:17:02,060 Instead, we found that testing points 25 and 28 are responsible for SWD clock and input-output, respectively, after we desoldered the main CPU. 164 00:17:02,060 --> 00:17:05,780 So if you want to follow up on this, these are the testing points to look for. 165 00:17:07,320 --> 00:17:12,040 And this is what the flash memory and the main CPU look like desoldered. 166 00:17:12,040 --> 00:17:22,340 And the interesting thing to note about the flash memory is that we were not able to find any information on the public internet about the manufacturer parts number on this chip. 167 00:17:22,340 --> 00:17:28,320 We found one that was very similar, that had just one letter exchanged, essentially, but it was bigger. 168 00:17:28,460 --> 00:17:34,820 And this is why we think that it might be possible that this chip is even custom-built for the Fitbit Ionix. 169 00:17:40,900 --> 00:17:50,840 So, the thing is that it is not that practical to open up a Fitbit to then change your step count or whatsoever. 170 00:17:51,200 --> 00:18:02,840 So what we wanted to do is also to understand the wireless firmware flashing process to flash our own firmware that modifies something. 171 00:18:02,840 --> 00:18:06,540 So, the firmware update process usually works as follows. 172 00:18:06,560 --> 00:18:22,840 You just have the same mega-dump synchronization with the server and the server realizes, hey, I have a new firmware and then this firmware is actually shown to the user and the user needs to confirm to do a firmware update. 173 00:18:23,200 --> 00:18:37,060 And then again, the tracker is sending a micro-dump and there is the firmware request to the server and the answer to this contains two parts, which Daniel was already talking about, a BSL and an app. 174 00:18:37,060 --> 00:18:44,600 So, app here is not a smartphone application, but the main application running on the Fitbit tracker. 175 00:18:44,600 --> 00:18:52,200 And first, the BSL is flashed, validated and so on and then there is a reboot to BSL and then the same happens to the app. 176 00:18:52,240 --> 00:19:03,960 So, the idea is that you cannot prick your tracker, which means if I cannot reboot to BSL, then my BSL was wrong and then I can still boot the app. 177 00:19:04,960 --> 00:19:06,700 So far, so good. 178 00:19:06,700 --> 00:19:17,500 Another thing that you need to understand for trackers that still have a memory readout attack but do encryption is how the encryption itself works. 179 00:19:17,620 --> 00:19:34,280 So , we did a bit of reverse engineering and found that the tracker is using LibTomCrypt and with this it was also easier to find out how the nonce is used, how the encryption key is used and that they have a MAC. 180 00:19:34,280 --> 00:19:46,720 So, the MAC also means that you cannot easily flip a bit here and there to change the behavior because then in the end it will no longer match with the authentication MAC. 181 00:19:46,720 --> 00:19:52,260 So, you really need to understand how the format works and how the encryption works. 182 00:19:53,040 --> 00:20:01,840 So, if you want to flash a modified firmware, first of all you need to get the encryption key or you have a tracker that is still in plain text. 183 00:20:02,400 --> 00:20:07,520 You can achieve that actually if you buy one of the older trackers and never connect it to the internet. 184 00:20:07,520 --> 00:20:19,500 So, beginning of this year I was still buying trackers that could be modified, but only the very old models and then you need to find someone buying one of those models that has never been unpacked. 185 00:20:19,640 --> 00:20:24,400 So, if you have the key, you can then also read out the firmware. 186 00:20:24,500 --> 00:20:33,260 If it's not already a firmware that we already have, then you can copy the firmware, modify it with Nexmon and copy it back to the smartphone app. 187 00:20:33,260 --> 00:20:38,200 Our app actually already has a few firmware images built in. 188 00:20:38,200 --> 00:20:47,740 So, if you just want to have one of the images that we provide, you don't need to do this part, but probably you are interested in binary patching and want to have your own patches. 189 00:20:49,060 --> 00:20:54,680 And then you need again to format and encrypt the firmware and flash it back as I explained. 190 00:20:55,520 --> 00:21:00,900 So, the pre-compiled firmware that we have has a couple of funny features. 191 00:21:00,900 --> 00:21:06,660 So, the first feature we actually did when we had our first demo. 192 00:21:08,240 --> 00:21:10,160 So, when we gave our first talk. 193 00:21:10,180 --> 00:21:13,380 And it is just returning the step counts times 100. 194 00:21:14,220 --> 00:21:16,460 So, you need to do less points. 195 00:21:16,880 --> 00:21:20,000 And it will still look somewhat realistic to the server. 196 00:21:20,000 --> 00:21:27,260 So, you could do some more advanced stuff here like replaying activity records or something, but we just do the steps times 100. 197 00:21:28,300 --> 00:21:41,740 And another funny thing that happens, so if you then are resetting the tracker that has this patch and already have a high step count, then it is like taking the square of this or something, so it's getting like super high numbers. 198 00:21:42,060 --> 00:21:54,400 And this is really funny, because then if you have a Fitbit account in your inbox, you will have like all the notifications of like, you got the New Zealand badge of crossing all of New Zealand in one day and so on, I don't know. 199 00:21:55,820 --> 00:21:58,840 So, that's really funny what happens if you do this. 200 00:21:58,840 --> 00:22:02,840 And yeah, you definitely don't need to do any more sports. 201 00:22:04,160 --> 00:22:16,300 Maybe you shouldn't do too much of this, because if you have a health insurance and want to tell the health insurance I'm doing sports and then they are like, yes, but you did like 2 billion steps, then it might be strange. 202 00:22:16,440 --> 00:22:18,180 So, be careful with this. 203 00:22:19,740 --> 00:22:28,660 And then beginning of this year, I also ported this code to the Fitbit ChargeHR, which is also cool, because the Fitbit ChargeHR has a display. 204 00:22:29,100 --> 00:22:33,980 And display means that you can impress your friends without taking the smartphone app with you. 205 00:22:33,980 --> 00:22:36,920 So, you can just show like, oh, I did a lot of steps today. 206 00:22:37,200 --> 00:22:40,040 I was doing sports before coming to your party. 207 00:22:40,040 --> 00:22:46,040 And then you don't need to move a lot on the party, because otherwise they will think like, how did you do 5,000 steps on the party? 208 00:22:47,740 --> 00:23:04,060 Okay, so, the accelerometer is one thing that we thought is very interesting to access, because there is like, or at least has been, no good tools with trackers that are waterproof and still for experimentation to get accelerometer readings. 209 00:23:04,920 --> 00:23:10,120 And there is almost no strings in the firmware, so it's very hard to reverse engineer. 210 00:23:10,120 --> 00:23:15,620 But one thing that is there is a factory test mode with some basic console. 211 00:23:15,820 --> 00:23:22,000 And luckily, so one of the very few things that has a string is a command to test the accelerometer. 212 00:23:23,040 --> 00:23:27,260 And with this, we found out how the accelerometer is configured. 213 00:23:27,540 --> 00:23:36,980 And the most important part is the accelerometer is configured to make measurements with a rate of 100 hertz, so 100 measurements per second. 214 00:23:36,980 --> 00:23:47,560 I think this type of accelerometer can also be configured differently, so to something like 2 kilohertz, which would mean that you could also record or recognize some speech with this. 215 00:23:47,560 --> 00:23:55,180 But the 100 hertz is totally sufficient for recognizing some gestures and movements. 216 00:23:55,560 --> 00:24:08,580 Actually, already something like 25 hertz would be okay, so the question is, could we get the readings of the accelerometer somehow out of the tracker with at least a rate of 25 hertz? 217 00:24:09,460 --> 00:24:20,900 And the next problem is a bit that we are restricted in how to patch this, because we do binary patching, which means writing code from scratch aside, it's easier to reuse existing functions. 218 00:24:21,120 --> 00:24:35,020 So what we did is we made a switch into the live mode, so we are using the live mode, and then we are copying the XYZ values to the live mode. 219 00:24:36,200 --> 00:24:53,920 And the rate of this is the Bluetooth LE packet rate, and so you can put out the readings with something like 66 hertz, so it's not as much as the original readings, but it's still sufficient if you want to develop something that recognizes movements. 220 00:24:56,300 --> 00:25:10,480 And the use cases are various, so for example, you could now develop your own algorithms that do something with accelerometers, so recognize, I don't know, some gestures on top of step counts. 221 00:25:11,200 --> 00:25:18,660 And this you could do with Python or whatever you like on your smartphone in Java, whatever. 222 00:25:18,720 --> 00:25:33,720 And then once you have all the logic of how to recognize those movements, you can then point it back to C code with Nexamon, because putting out the readings over Bluetooth is draining the battery a lot, so it's nothing to do forever, but at least for development, 223 00:25:33,720 --> 00:25:34,840 it's very interesting. 224 00:25:35,560 --> 00:25:56,500 So the versions that you can modify is actually if you buy a Fitbit One Flex or ChargeHR that has never ever been updated, so a fresh one from the internet, or if you updated it only a very, very, very long time ago, so something like it was never updated since October 2017. 225 00:25:57,980 --> 00:26:11,240 And the ChargeHR would also allow you to access the heart rate sensor, so there's also some help commands with this, but we didn't release a patch for this so far, but if someone is very interested, we can look into this, of course. 226 00:26:11,240 --> 00:26:18,440 Yeah, so much about the trackers, and now we are going to tell you more about the new smartwatch. 227 00:26:21,600 --> 00:26:31,420 Okay, as Kiska said, I'll be switching back to the Fitbit Ionic for a bit and tell you about some of the insights that we gained during testing. 228 00:26:31,500 --> 00:26:45,940 So, as I've already mentioned, the most interesting parts of the Fitbit Ionic from our point of view are Fitbit Pay, the custom application installation capability, as well as the way that the Ionic synchronizes data. 229 00:26:45,940 --> 00:26:58,500 Synchronization is very interesting because we found that it heavily relies on the old Fitbit ecosystem and reuses old functionality, and we wanted to see whether all the old vulnerabilities are still present there. 230 00:26:58,520 --> 00:27:18,280 One thing to know about custom applications is that the process of installing heavily relies on the Wi-Fi interface, and for this, Fitbit consistently uses TLS, and sometimes, for example, during the download of firmware, they even use mutually authenticated TLS using server and client certificates, 231 00:27:18,280 --> 00:27:22,880 so it's rather hard to get in between the communication or modify communication. 232 00:27:24,080 --> 00:27:31,000 So I'll skip applications and focus on Fitbit Pay as well as synchronization in the next couple of slides. 233 00:27:31,820 --> 00:27:44,280 So one thing that I've talked quite a bit about already is Bluetooth for Energy, and as the name suggests, it is closely related to Bluetooth, yet a bit different, because it has been designed for energy-constrained devices. 234 00:27:44,420 --> 00:27:54,000 It operates on the 2.4 gigahertz frequency and performs frequency hopping on 40 channels, of which 37 are used for data transmission. 235 00:27:54,620 --> 00:28:10,920 The generic attribute profile is another layer within the Bluetooth for Energy protocol stack, and it groups related information into services and characteristics, and the smallest bit of information on this layer is called an attribute, hence the name generic attribute profile. 236 00:28:11,200 --> 00:28:20,740 So the Fitbit Ionic uses Bluetooth for Energy 4.2, which is the latest Bluetooth for Energy version, despite setting otherwise on the official website, which is weird. 237 00:28:20,740 --> 00:28:22,940 It says 4.0 on the website. 238 00:28:23,220 --> 00:28:29,740 And Bluetooth for Energy is not known for being the most secure standard by design. 239 00:28:29,960 --> 00:28:48,020 There is one pairing method called JustWorks, which essentially is the most unsecure pairing method that you could use, because it does not use authentication, and depending on the Bluetooth for Energy version, you can also launch active or passive eavesdropping and man-in-the-middle attacks. 240 00:28:48,360 --> 00:28:50,980 And this is precisely what the Fitbit Ionic uses. 241 00:28:50,980 --> 00:28:53,240 It enforces the use of JustWorks pairing. 242 00:28:53,240 --> 00:29:01,700 You cannot use anything else with your smartwatch, and we assume that this is due to usability issues, because it does not require user interaction. 243 00:29:02,760 --> 00:29:17,020 Also, the Fitbit Ionic exposes five different services on the generic attribute profile layer, and two of those services are proprietary, and these are used by Fitbit to layer their own application layer protocol on top. 244 00:29:17,600 --> 00:29:23,960 And this application layer protocol is what I'd like to dive a bit into in the next couple of slides. 245 00:29:24,100 --> 00:29:31,400 Some things are legacy and have already been present in previous trackers, and some things are new and specific to the Fitbit Ionic. 246 00:29:31,400 --> 00:29:39,040 So one thing Jiska already mentioned is the so-called live data, which is the real-time fitness information of a user. 247 00:29:39,340 --> 00:29:42,900 And this is still included and present on the Fitbit Ionic. 248 00:29:42,900 --> 00:29:49,100 It is not protected in any way on the application layer and sent between the smartwatch and the Ionic. 249 00:29:49,440 --> 00:29:55,400 Another type of data that is present on this application layer protocol is so-called command messages. 250 00:29:55,400 --> 00:30:00,040 They either instruct the receiving side to take a certain action or signal a state. 251 00:30:00,700 --> 00:30:07,440 And there have been modifications to previous ones or older ones from older trackers for the Fitbit Ionic. 252 00:30:07,440 --> 00:30:10,360 And there are also a couple of new ones that have been introduced. 253 00:30:10,360 --> 00:30:17,980 And they are also not protected on the application layer and exchanged between the smartwatch and the Fitbit application. 254 00:30:18,780 --> 00:30:23,740 One thing that is new to the Fitbit Ionic are something that we call app dumps. 255 00:30:24,080 --> 00:30:30,100 App dumps because they are exchanged between the Fitbit application and the Fitbit Ionic. 256 00:30:30,100 --> 00:30:34,620 And they are encrypted dumps, encrypted blobs of data. 257 00:30:35,040 --> 00:30:40,700 They are encrypted using AES in EAX mode using a symmetric key of course. 258 00:30:40,700 --> 00:30:47,080 And this key is derived using a proprietary session key derivation protocol that has been designed by Fitbit. 259 00:30:47,080 --> 00:30:49,440 We reverse engineered this protocol. 260 00:30:49,440 --> 00:30:57,680 And unfortunately for us, we did not find a practical exploit but only a theoretical attack on this protocol because it has two independent stages. 261 00:30:57,680 --> 00:31:13,360 And the semantics of the app dumps are defined in a construct that is called the Fitbit mobile data protocols which essentially is a set of XML files that define which bit and byte within a protocol byte stream means what exactly. 262 00:31:13,400 --> 00:31:23,580 And the normal thing about app dumps is that it's the first time that the application and the Fitbit tracker or smartwatch has the capability of exchanging encrypted blobs of data. 263 00:31:23,580 --> 00:31:29,640 Previously this was only present or possible between the Fitbit tracker and the Fitbit servers. 264 00:31:29,840 --> 00:31:41,840 And if you're interested how all of this works, I have a little Python script that demonstrates a little proof of concept to show you how app dumps work and how the session key derivation protocol works. 265 00:31:42,460 --> 00:31:47,440 And last but not least, I've already mentioned this, server dumps are still present on the Fitbit Ionic. 266 00:31:47,440 --> 00:31:50,500 They are exchanged between the Fitbit servers and the smartwatch. 267 00:31:50,500 --> 00:31:54,260 And they are also encrypted blobs of data using a symmetric key. 268 00:31:54,260 --> 00:32:02,320 And if you want to get to that data, you either have to hack the Fitbit servers or your Fitbit Ionic because that's where the keys are. 269 00:32:02,320 --> 00:32:05,360 It is completely transparent to the Fitbit mobile application. 270 00:32:05,480 --> 00:32:08,860 And for the Fitbit Ionic, the server dump header has been modified. 271 00:32:10,860 --> 00:32:16,060 Another thing that we looked into is the Fitbit pay capability. 272 00:32:16,240 --> 00:32:23,260 And when I heard that you could now pay with your smartwatch, I had really high hopes that it would be really insecure so I could find a lot of things. 273 00:32:23,260 --> 00:32:31,460 You can use Fitbit pay if you have a supported credit or debit card by one of the banks listed on Fitbit's website. 274 00:32:31,460 --> 00:32:37,280 For instance, the Bank of America is supported or the German Landesbank Baden-Württemberg. 275 00:32:37,320 --> 00:32:43,300 And all the payment traffic is transmitted on the NFC interface which means it is all transmitted wirelessly. 276 00:32:43,320 --> 00:32:47,840 And the implementation is according to the EMV standard or EMV specifications. 277 00:32:47,840 --> 00:32:52,280 And EMV is short for Europay International, Mastercard and Visa. 278 00:32:52,280 --> 00:32:58,900 And those are just three organizations that work together to create a common specification for credit card payments. 279 00:32:59,660 --> 00:33:04,560 The credit card information is managed using the Fitbit mobile application. 280 00:33:04,560 --> 00:33:16,180 And for this purpose, Fitbit registered a new web API that is located under the domain payables.co And we focused on analyzing the payment traffic. 281 00:33:16,180 --> 00:33:25,760 And to do this, we used an app that is called NFC Gate which has been developed within the CIMO Research Group, the Secure Mobile Networking Lab. 282 00:33:25,840 --> 00:33:44,140 And if you are interested in sniffing your own payment traffic using this very cost-effective setup, you can go to the link below of this slide which is nfc.wgf And what NFC Gate does essentially is it creates a Wi-Fi wormhole so the first app on the first smartphone captures the NFC traffic from the Fitbit Ionic, 283 00:33:44,140 --> 00:33:59,660 sends it via Wi-Fi to the NFC Gate server that is also able to lock the traffic and from there the traffic will be relayed to the other NFC Gate app where the data is sent via NFC to its destination which in this case is the payment terminal and vice versa. 284 00:34:01,780 --> 00:34:14,860 Okay, so after analyzing and experimenting with this, we found unfortunately for us that it is rather secure in terms of what is recommended in the EMV standard. 285 00:34:14,860 --> 00:34:31,660 So for instance something that is called tokenization is used during payment which means that your credit card number is never transmitted in plain text, instead it is replaced with a so-called token which essentially is a pseudonym for your credit card number. 286 00:34:31,660 --> 00:34:45,200 Also a so-called authorization request cryptogram is used which is a MAC that is computed among other things over the transaction details using a session key that is derived from the credit card's master key and a transaction counter. 287 00:34:45,280 --> 00:34:50,160 And what this does is that the transaction cannot be modified or replayed. 288 00:34:50,180 --> 00:35:08,720 And last but not least a four-digit PIN is used as soon as you decide to set up Fitbit Pay which is supposed to lessen the probability of someone else paying with your watch and it is also used during a process that is called consumer device cardholder verification which proves your identity as a cardholder towards the payment terminal. 289 00:35:09,240 --> 00:35:21,020 And to sum all of this up the security when paying with your Fitbit Ionic is pretty much the same than paying with your contactless plastic credit card. 290 00:35:21,740 --> 00:35:22,480 Yeah. 291 00:35:24,160 --> 00:35:25,000 Okay. 292 00:35:25,000 --> 00:35:34,660 And next I would like to dive a bit into all the vulnerabilities that we found on the Bluetooth interface which is something that we dedicated a bit more time to. 293 00:35:35,180 --> 00:35:39,740 And for this purpose I grouped all the vulnerabilities we identified in two categories. 294 00:35:39,780 --> 00:35:46,560 On the left-hand side you see all the vulnerabilities that are new to the Fitbit Ionic and have not been present in previous trackers. 295 00:35:46,660 --> 00:35:54,260 And on the right-hand side you see the vulnerabilities that are due to legacy implementations and have been known to be present in previous trackers. 296 00:35:54,260 --> 00:35:57,680 And what is pretty obvious is that the right-hand side is much larger. 297 00:35:57,680 --> 00:36:04,700 There's much more vulnerabilities and this is because Fitbit relies on its old ecosystem and has the need for backwards compatibility. 298 00:36:04,800 --> 00:36:12,860 So they reuse a lot of old stuff and implementations and this of course causes all the old vulnerabilities to still be present. 299 00:36:13,280 --> 00:36:25,220 Instead of explaining each and every one of those vulnerabilities, I'd just like to point out the main points of criticism that we have here and that are or that essentially cause all of these vulnerabilities. 300 00:36:25,220 --> 00:36:36,420 So one thing that I've already talked to you about of course is the weak Bluetooth Low Energy pairing that just works pairing method and also we found that Bluetooth Low Energy security is inconsistently enforced. 301 00:36:36,420 --> 00:36:45,360 This means once the connection is set up between your Fitbit Ionic and the smartphone application, Bluetooth Low Energy pairing does not instantly kick in. 302 00:36:45,360 --> 00:36:53,820 Instead it takes some time until pairing happens and during this time all of your data will be transmitted in plain text which of course is not that great. 303 00:36:53,820 --> 00:37:03,460 So our recommendation would be to use secure connections whenever possible which is present in Bluetooth 4.2 and use a pairing method that uses authentication. 304 00:37:03,460 --> 00:37:25,220 Also Jiska already said there is a problem with reusable authentication credentials for live data and this problem is still present on the Fitbit Ionic so if an attacker through whichever means acquires those authentication credentials they will forever be able to request live data from your smartwatch and of course this is also something that you do definitely not want. 305 00:37:25,220 --> 00:37:40,340 So the reuse of those authentication credentials should be prevented for example by associating them with a validity period or if that's not possible maybe just plainly store the last used authentication credentials because they are usually not swapped out that often. 306 00:37:40,800 --> 00:38:15,620 Another problem that persists is that live data is not protected on the application layer and this is a problem if you use a weak Bluetooth 4.0 energy pairing method as the Fitbit Ionic does or if at the beginning of each connection the traffic is not instantly protected so our recommendation at this point would be to encrypt live data with a similar mechanism that EPTOMs are protected with and this of course would introduce some additional delays so your real time data would not be entirely real time anymore but security has never been convenient so... 307 00:38:16,240 --> 00:38:28,240 and last but not least I also found some testing commands to be present in production for example I found a command that allows you which is one command to request a very large test dump. 308 00:38:28,240 --> 00:38:34,940 It's just meaningless test data but it's rather large and I was able to keep the Fitbit Ionic sending for 45 minutes straight. 309 00:38:34,940 --> 00:39:02,760 You could keep this for even longer and what it does is that it drains the Fitbit Ionic's battery quite quickly and for whatever reason the UI becomes very sluggish and unresponsive so you can't really use your smartwatch anymore and that's just pretty much unnecessary so our recommendation would be to employ a process that ensures that all your testing code is not rolled out to production which is probably something that is standard in software development. 310 00:39:03,480 --> 00:39:04,320 Okay. 311 00:39:06,200 --> 00:39:16,540 So to conclude our talk we have three major points which we want to point out. 312 00:39:16,540 --> 00:39:45,620 So in general we can say that Fitbit products improved a lot during the years which we observed them in general they have the problem of compatibility for older trackers so the app still needs to have this legacy protocol which needs to talk via Bluetooth and in general it seems that Fitbit just likes to implement encryption in weird ways. 313 00:39:45,940 --> 00:39:52,780 So that's it from our side thanks for your time and I guess we have now some time for Q&A. 314 00:40:02,880 --> 00:40:03,840 Questions? 315 00:40:09,780 --> 00:40:13,680 So the question was if we already looked into the app, right? 316 00:40:13,680 --> 00:40:16,480 Do you want to talk about this? 317 00:40:16,720 --> 00:40:31,620 Yeah, so we looked into the app so Caroline did it and me too for understanding for example how the firmware is and so on and we patched the APK and made some debug prints and so on to get an idea of what is going on. 318 00:40:54,000 --> 00:41:03,000 Okay, so the question was with the secure connections and the pairing how it works and why it kicks in later? 319 00:41:04,020 --> 00:41:16,160 So, I do not know why but I would expect that you pair or use a secure encrypted connection before you exchange any data between the smartwatch and the application and this just doesn't happen. 320 00:41:16,480 --> 00:41:21,800 They exchange data for a couple of seconds and then randomly pairing starts. 321 00:41:21,800 --> 00:41:25,340 I don't know why but I've seen this quite a lot when testing. 322 00:41:40,220 --> 00:41:44,240 Ah, so the question was if we also looked into other smartwatches. 323 00:41:44,240 --> 00:41:50,500 So actually another group at our university initially did a study on fitness trackers in general. 324 00:41:50,500 --> 00:42:07,460 I think that was back in 2017 or so or 2016 and they bought something like 16, 17 trackers, different kinds and what they found out is that most IOT fitness trackers do not even encrypt the data. 325 00:42:07,840 --> 00:42:13,860 So we actually picked Fitbit because we thought it's like a very interesting ecosystem. 326 00:42:13,860 --> 00:42:15,680 They have encryption and so on. 327 00:42:16,060 --> 00:42:20,320 So it's like we are hacking the strongest implementation. 328 00:42:20,840 --> 00:42:21,800 But yeah. 329 00:42:23,860 --> 00:42:25,100 Yeah. 330 00:42:30,220 --> 00:42:33,560 Ah, so the question is there's some Fitbits with GPS. 331 00:42:33,560 --> 00:42:35,800 I think it's the Fitbit search or something. 332 00:42:35,800 --> 00:42:41,080 But that one has been produced after 2015 so it's encrypted. 333 00:42:41,680 --> 00:42:48,260 And then it's harder to do it so that's why we just went then straight to the Ionic to see what changed. 334 00:42:48,440 --> 00:42:56,200 I assume that some stuff would be similar so if you would open the PCB and so on then you could maybe extract the firmware again. 335 00:42:56,700 --> 00:43:03,400 But then you only have access to this one tracker with the one encryption key that is on this very same tracker. 336 00:43:03,400 --> 00:43:07,560 And that's a lot of effort for just taking one device. 337 00:43:14,840 --> 00:43:16,300 Okay, then thank you for listening. 338 00:43:16,300 --> 00:43:19,060 We will be around here for a bit more if you have any questions. 339 00:43:19,060 --> 00:43:22,480 Also on how we patched the firmware for example. 340 00:43:22,480 --> 00:43:24,240 That might be interesting for some of you. 341 00:43:24,620 --> 00:43:25,280 Yeah. 342 00:43:25,280 --> 00:43:26,120 Thank you.