WEBVTT

00:00.000 --> 00:01.840
So, I guess we start.

00:01.840 --> 00:04.600
Thanks everybody for showing up so early.

00:05.020 --> 00:08.600
I guess we are the first talk today on the IoT Village.

00:09.600 --> 00:13.720
I still need to get this somewhere near my mouth.

00:14.520 --> 00:18.540
So, I'm Daniel, this is Jiska and Caroline.

00:18.600 --> 00:23.700
And we will present our work on Fitbit fitness trackers.

00:23.700 --> 00:28.420
Our talk is called Fitness Firmware Hacking, the Current State of the Heart.

00:28.420 --> 00:34.360
And this basically summarizes our research from the last few years.

00:34.400 --> 00:40.260
And all the work we are presenting was done in the secure mobile networking lab.

00:41.580 --> 00:43.780
So, a brief motivation.

00:44.560 --> 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.

00:58.480 --> 00:59.920
But that's not so important.

00:59.920 --> 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.

01:09.520 --> 01:13.920
And we thought, why not help this poor soul achieving his goals.

01:13.920 --> 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.

01:37.960 --> 01:41.760
So, let's start with the version comparison.

01:42.860 --> 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.

01:54.220 --> 02:00.340
So, we started with the Flex as a simple tracker and also the ChargeHR.

02:00.440 --> 02:04.540
But Caroline did a lot of work on the Fitbit Ionic.

02:05.000 --> 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.

02:13.500 --> 02:16.540
Apart from this, all of them are ARM-based.

02:16.540 --> 02:26.380
So, the architecture is definitely similar for the Flex and ChargeHR and somewhat similar for the Ionic.

02:28.580 --> 02:35.760
Yeah, the Fitbit Ionic is the first device within Fitbit's product portfolio to be marketed as an actual smartwatch.

02:35.880 --> 02:41.220
And this is because it introduces a number of new functionalities and interfaces.

02:41.320 --> 02:44.680
So, for instance, it does not only have GPS or Bluetooth.

02:44.680 --> 02:47.500
It also has a Wi-Fi interface and NFC.

02:47.500 --> 02:53.920
And it has something that is called Fitbit Pay, which essentially allows you to contactlessly pay with your watch.

02:53.960 --> 03:00.480
And you can develop your own custom applications in JavaScript using, for instance, an online IDE called Fitbit Studio.

03:00.600 --> 03:08.500
And, of course, it synchronizes data over Bluetoothable energy using some form of application, for example, on a smartphone or computer.

03:09.280 --> 03:14.040
And, of course, it has a number of different sensors for capturing the user's fitness data.

03:14.040 --> 03:21.460
And you can store music files, download radio station playlists, for example, from Deezer or Pandora, and connect your Bluetooth headphones.

03:21.460 --> 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.

03:31.980 --> 03:38.940
So, I'm now going to introduce the communication between the Fitbit and the server.

03:38.940 --> 03:45.840
And this part is very important for you to remember to understand the remaining part of the talk.

03:45.840 --> 03:53.760
So, you have a Fitbit fitness tracker, and this is connected over Bluetooth LE to the smartphone app.

03:53.760 --> 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.

04:06.100 --> 04:10.560
And the traffic is end-to-end encrypted with a device-specific symmetric key.

04:10.560 --> 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.

04:23.880 --> 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.

04:37.240 --> 04:41.680
So, you cannot disable it, but on the oldest you could.

04:42.060 --> 04:48.360
And then also, there was a memory attack that was not patched in all trackers.

04:48.360 --> 04:52.180
It was only patched in October 2017 on all trackers.

04:52.180 --> 04:57.580
So, there were some possibilities in all the trackers to analyze this communication in plain text.

04:58.440 --> 05:00.060
So, what is happening?

05:00.060 --> 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.

05:10.720 --> 05:15.700
And this locally stored data could be something like a week of activity data.

05:15.700 --> 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.

05:27.120 --> 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.

05:39.140 --> 05:46.520
So, you would get summaries, like all the steps of the last week or something, in JSON.

05:46.780 --> 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.

05:53.200 --> 05:55.280
So, this is a different communication here.

05:55.280 --> 05:59.320
What you see in JSON is a different thing than what you will see in the micro dump, mega dump.

06:01.500 --> 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.

06:11.660 --> 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.

06:17.340 --> 06:19.300
So, there is a live mode.

06:19.380 --> 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.

06:32.580 --> 06:36.860
And the smartphone app, actually, in this step, also gets authentication credentials.

06:37.460 --> 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.

06:45.700 --> 06:50.100
And in this authenticated live mode, you would get plain text data.

06:50.960 --> 06:56.260
So, that is only the thing that you see as a summary on the display.

06:56.260 --> 07:00.720
So, it's only the total step count of the day, the current hide rate, and so on.

07:01.180 --> 07:04.820
And there was also the possibility for a memory readout.

07:04.880 --> 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.

07:14.220 --> 07:18.980
But we can also understand why they did it this way, because it's for the offline usage.

07:18.980 --> 07:22.100
So, it's kind of by design that you can reuse it forever.

07:23.560 --> 07:27.800
So, Karin is now going to tell you about the additions on the Ionic smartwatch.

07:28.800 --> 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.

07:36.240 --> 07:41.340
And for this reason, the communication paradigm has also been a bit modified.

07:41.640 --> 07:46.760
What remains largely the same is pretty much things like so-called server dumps.

07:46.760 --> 07:49.100
This is something that Disco already told you about.

07:49.100 --> 07:52.220
It's essentially a generalization of micro and mega dumps.

07:52.220 --> 07:57.680
And they are sent from the Fitbit service over the Fitbit smartphone application to the Fitbit smartwatch.

07:57.760 --> 08:02.160
And also, the entire communication on top of plutable energy is very similar.

08:02.160 --> 08:04.300
But there are also some new concepts.

08:04.300 --> 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.

08:10.700 --> 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.

08:21.540 --> 08:22.680
And that's pretty much it.

08:22.680 --> 08:26.240
Everything else is still relayed over the smartphone application.

08:26.420 --> 08:32.840
And the NFC interface is only used for the transmission of payment traffic to and from a payment terminal.

08:32.900 --> 08:37.060
And of course, as I've said, you can connect your Bluetooth headphones using Bluetooth.

08:40.590 --> 08:45.950
Okay, so one important step during our research was accessing the hardware.

08:45.950 --> 08:53.570
You can start with disassembling the app, of course, or taking dumps from, I don't know, HTTPS.

08:53.570 --> 09:00.010
But to get the whole picture, we thought we also want to get access to the hardware itself.

09:00.230 --> 09:11.950
So, to quickly show you our thread model, we still have Suzy Fit, who stores her activity locally on her tracker.

09:11.950 --> 09:15.990
And of course, this tracker has a local symmetric device key.

09:16.310 --> 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?

09:26.910 --> 09:32.650
So our goals are to access the local data storage and to get the encryption keys.

09:32.810 --> 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.

09:38.610 --> 09:44.690
And so in our case, the Fitbit Flex was pretty cheap already.

09:44.690 --> 09:50.970
So broken ones you could get up into patches of 20 for $1 each.

09:52.250 --> 09:59.710
And so here's a quick look at the hardware and software of the Fitbit Flex.

09:59.710 --> 10:03.150
So you have your main system on a chip.

10:03.610 --> 10:07.610
You have, which in this case is a chip from STM.

10:07.610 --> 10:11.450
It runs a Cortex-M3 arm.

10:11.970 --> 10:17.890
And the firmware consists of a few libraries which we identified they used.

10:17.890 --> 10:21.050
So for encryption, for example, they used libtomcrypt.

10:21.050 --> 10:25.970
And for BLE, they used a library which is very similar to libble-shield.

10:26.190 --> 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.

10:37.410 --> 10:42.550
And here in the Fitbit Flex example, everything is connected via a new R bus.

10:43.190 --> 10:47.830
So if you pry open the hardware, this is pretty easy on the Fitbit Flex.

10:47.830 --> 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.

10:55.190 --> 11:01.910
So here we already removed the battery and the vibration sensor or vibration actuator.

11:02.590 --> 11:06.450
And so you already see that there are many testing points.

11:06.450 --> 11:09.270
And the most important ones are these.

11:09.590 --> 11:13.690
So TP8 and 9 are used for SWD debugging.

11:13.690 --> 11:19.890
And you can use just the ground for the battery to connect it to your debugger.

11:20.410 --> 11:25.410
And apart from this, there is also TP10, which you can use for resetting.

11:26.150 --> 11:27.690
And yeah, that's it.

11:27.690 --> 11:32.590
Then you have everything you need to hook it up to a debugger.

11:32.590 --> 11:37.490
And so here on the right-hand side, this is how it looked in our case.

11:37.490 --> 11:44.450
We just used the ST-Link debugger from STM in the breadboard, basically.

11:44.530 --> 11:49.810
And with this, we were already able to read out all the memory.

11:50.470 --> 11:54.050
So it basically consists of three big parts.

11:54.050 --> 11:57.490
A flash, an EEPROM, and an SRAM.

11:57.590 --> 12:01.090
The flash contains, of course, all the firmware code.

12:01.090 --> 12:05.870
The EEPROM stores all the data you want to get your hands on.

12:05.970 --> 12:09.750
And the SRAM, of course, for firmware variables.

12:11.810 --> 12:18.310
If you have a closer look at the flash, you will see that it consists of two big parts.

12:18.650 --> 12:21.110
An app part and a BSL part.

12:21.110 --> 12:23.950
Iska will tell you more about these later.

12:24.130 --> 12:28.030
But the important thing is that they can run independently from each other.

12:28.030 --> 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.

12:39.050 --> 12:43.170
So with this switch, it was possible to disable encryption completely.

12:43.170 --> 12:48.930
But nowadays, the backend will not accept connections which are not encrypted anymore.

12:48.930 --> 12:50.570
So this does not work anymore.

12:52.650 --> 12:57.050
So one important step also was to re-enable GDB access.

12:57.050 --> 13:08.010
What we discovered is that you were only able to connect to the Fitbit if you did a reset before this.

13:08.730 --> 13:17.110
And after this, if you hit continue on your GDB, the connection to the debugger will be lost.

13:17.110 --> 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.

13:26.310 --> 13:31.510
So we thought, why not reset them to something which we actually need?

13:31.790 --> 13:36.170
And what we used for this is the Nexmon patching framework.

13:36.170 --> 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.

13:46.170 --> 13:48.270
And we adapted it for our needs.

13:49.450 --> 13:55.170
Of course, our goal was to modify the firmware and enable the dynamic debugging.

13:56.850 --> 14:03.370
So this is what the core graph looks like after initialization.

14:03.370 --> 14:06.630
So at the beginning, GDB access still works.

14:06.630 --> 14:10.250
And somewhere after the initialization, it doesn't work anymore.

14:10.250 --> 14:19.090
So I have no idea where exactly these GPIO pins are reassigned, but I actually don't need to know.

14:19.090 --> 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.

14:31.530 --> 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.

14:43.250 --> 14:47.360
And we just wanted to keep the side effects as small as possible.

14:49.090 --> 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.

14:58.180 --> 15:02.680
So naturally, we also had to look at the Fitbit Ionix hardware.

15:03.060 --> 15:06.880
And we did this by using two broken Fitbit Ionix smartwatches.

15:06.880 --> 15:13.340
And the goal was for us to understand the hardware that is used and also to find possibilities for debugging.

15:13.340 --> 15:19.160
And what you see on the picture below is the Fitbit Ionix main PCB being powered by its battery pack.

15:19.160 --> 15:24.720
And it has 39 copper wires soldered to its back and is connected to a logic analyzer.

15:24.720 --> 15:30.860
And since the Fitbit Ionix main PCB is rather small, this entire setup always reminds me of the Flying Spaghetti Monster.

15:32.080 --> 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.

15:40.640 --> 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.

15:48.600 --> 15:53.480
And also the CPU and the flash memory are manufactured by Toshiba.

15:53.580 --> 15:58.280
And the CPU is custom-built for wearables and smartwatches.

15:58.400 --> 16:01.700
And it contains an ARM Cortex-M4.

16:01.700 --> 16:08.840
And it does not have JTAG interface, but instead uses SWD, which is short for Serial Wire Debug.

16:08.880 --> 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.

16:15.920 --> 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.

16:25.020 --> 16:27.700
So there's definitely an involvement there.

16:28.680 --> 16:30.960
This is the main PCB from the back.

16:30.960 --> 16:34.280
With all the different testing points, there are 95 in sum.

16:34.280 --> 16:39.020
And we tested 39 of them using the logic analyzer under different conditions.

16:39.020 --> 16:44.600
And we wanted to identify which testing points correlate to the SWD interface.

16:44.600 --> 16:50.420
Unfortunately, Murphy's Law, this did not yield the desired result.

16:50.480 --> 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.

17:02.060 --> 17:05.780
So if you want to follow up on this, these are the testing points to look for.

17:07.320 --> 17:12.040
And this is what the flash memory and the main CPU look like desoldered.

17:12.040 --> 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.

17:22.340 --> 17:28.320
We found one that was very similar, that had just one letter exchanged, essentially, but it was bigger.

17:28.460 --> 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.

17:40.900 --> 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.

17:51.200 --> 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.

18:02.840 --> 18:06.540
So, the firmware update process usually works as follows.

18:06.560 --> 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.

18:23.200 --> 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.

18:37.060 --> 18:44.600
So, app here is not a smartphone application, but the main application running on the Fitbit tracker.

18:44.600 --> 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.

18:52.240 --> 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.

19:04.960 --> 19:06.700
So far, so good.

19:06.700 --> 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.

19:17.620 --> 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.

19:34.280 --> 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.

19:46.720 --> 19:52.260
So, you really need to understand how the format works and how the encryption works.

19:53.040 --> 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.

20:02.400 --> 20:07.520
You can achieve that actually if you buy one of the older trackers and never connect it to the internet.

20:07.520 --> 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.

20:19.640 --> 20:24.400
So, if you have the key, you can then also read out the firmware.

20:24.500 --> 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.

20:33.260 --> 20:38.200
Our app actually already has a few firmware images built in.

20:38.200 --> 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.

20:49.060 --> 20:54.680
And then you need again to format and encrypt the firmware and flash it back as I explained.

20:55.520 --> 21:00.900
So, the pre-compiled firmware that we have has a couple of funny features.

21:00.900 --> 21:06.660
So, the first feature we actually did when we had our first demo.

21:08.240 --> 21:10.160
So, when we gave our first talk.

21:10.180 --> 21:13.380
And it is just returning the step counts times 100.

21:14.220 --> 21:16.460
So, you need to do less points.

21:16.880 --> 21:20.000
And it will still look somewhat realistic to the server.

21:20.000 --> 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.

21:28.300 --> 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.

21:42.060 --> 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.

21:55.820 --> 21:58.840
So, that's really funny what happens if you do this.

21:58.840 --> 22:02.840
And yeah, you definitely don't need to do any more sports.

22:04.160 --> 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.

22:16.440 --> 22:18.180
So, be careful with this.

22:19.740 --> 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.

22:29.100 --> 22:33.980
And display means that you can impress your friends without taking the smartphone app with you.

22:33.980 --> 22:36.920
So, you can just show like, oh, I did a lot of steps today.

22:37.200 --> 22:40.040
I was doing sports before coming to your party.

22:40.040 --> 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?

22:47.740 --> 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.

23:04.920 --> 23:10.120
And there is almost no strings in the firmware, so it's very hard to reverse engineer.

23:10.120 --> 23:15.620
But one thing that is there is a factory test mode with some basic console.

23:15.820 --> 23:22.000
And luckily, so one of the very few things that has a string is a command to test the accelerometer.

23:23.040 --> 23:27.260
And with this, we found out how the accelerometer is configured.

23:27.540 --> 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.

23:36.980 --> 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.

23:47.560 --> 23:55.180
But the 100 hertz is totally sufficient for recognizing some gestures and movements.

23:55.560 --> 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?

24:09.460 --> 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.

24:21.120 --> 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.

24:36.200 --> 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.

24:56.300 --> 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.

25:11.200 --> 25:18.660
And this you could do with Python or whatever you like on your smartphone in Java, whatever.

25:18.720 --> 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,

25:33.720 --> 25:34.840
it's very interesting.

25:35.560 --> 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.

25:57.980 --> 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.

26:11.240 --> 26:18.440
Yeah, so much about the trackers, and now we are going to tell you more about the new smartwatch.

26:21.600 --> 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.

26:31.500 --> 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.

26:45.940 --> 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.

26:58.520 --> 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,

27:18.280 --> 27:22.880
so it's rather hard to get in between the communication or modify communication.

27:24.080 --> 27:31.000
So I'll skip applications and focus on Fitbit Pay as well as synchronization in the next couple of slides.

27:31.820 --> 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.

27:44.420 --> 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.

27:54.620 --> 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.

28:11.200 --> 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.

28:20.740 --> 28:22.940
It says 4.0 on the website.

28:23.220 --> 28:29.740
And Bluetooth for Energy is not known for being the most secure standard by design.

28:29.960 --> 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.

28:48.360 --> 28:50.980
And this is precisely what the Fitbit Ionic uses.

28:50.980 --> 28:53.240
It enforces the use of JustWorks pairing.

28:53.240 --> 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.

29:02.760 --> 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.

29:17.600 --> 29:23.960
And this application layer protocol is what I'd like to dive a bit into in the next couple of slides.

29:24.100 --> 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.

29:31.400 --> 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.

29:39.340 --> 29:42.900
And this is still included and present on the Fitbit Ionic.

29:42.900 --> 29:49.100
It is not protected in any way on the application layer and sent between the smartwatch and the Ionic.

29:49.440 --> 29:55.400
Another type of data that is present on this application layer protocol is so-called command messages.

29:55.400 --> 30:00.040
They either instruct the receiving side to take a certain action or signal a state.

30:00.700 --> 30:07.440
And there have been modifications to previous ones or older ones from older trackers for the Fitbit Ionic.

30:07.440 --> 30:10.360
And there are also a couple of new ones that have been introduced.

30:10.360 --> 30:17.980
And they are also not protected on the application layer and exchanged between the smartwatch and the Fitbit application.

30:18.780 --> 30:23.740
One thing that is new to the Fitbit Ionic are something that we call app dumps.

30:24.080 --> 30:30.100
App dumps because they are exchanged between the Fitbit application and the Fitbit Ionic.

30:30.100 --> 30:34.620
And they are encrypted dumps, encrypted blobs of data.

30:35.040 --> 30:40.700
They are encrypted using AES in EAX mode using a symmetric key of course.

30:40.700 --> 30:47.080
And this key is derived using a proprietary session key derivation protocol that has been designed by Fitbit.

30:47.080 --> 30:49.440
We reverse engineered this protocol.

30:49.440 --> 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.

30:57.680 --> 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.

31:13.400 --> 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.

31:23.580 --> 31:29.640
Previously this was only present or possible between the Fitbit tracker and the Fitbit servers.

31:29.840 --> 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.

31:42.460 --> 31:47.440
And last but not least, I've already mentioned this, server dumps are still present on the Fitbit Ionic.

31:47.440 --> 31:50.500
They are exchanged between the Fitbit servers and the smartwatch.

31:50.500 --> 31:54.260
And they are also encrypted blobs of data using a symmetric key.

31:54.260 --> 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.

32:02.320 --> 32:05.360
It is completely transparent to the Fitbit mobile application.

32:05.480 --> 32:08.860
And for the Fitbit Ionic, the server dump header has been modified.

32:10.860 --> 32:16.060
Another thing that we looked into is the Fitbit pay capability.

32:16.240 --> 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.

32:23.260 --> 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.

32:31.460 --> 32:37.280
For instance, the Bank of America is supported or the German Landesbank Baden-Württemberg.

32:37.320 --> 32:43.300
And all the payment traffic is transmitted on the NFC interface which means it is all transmitted wirelessly.

32:43.320 --> 32:47.840
And the implementation is according to the EMV standard or EMV specifications.

32:47.840 --> 32:52.280
And EMV is short for Europay International, Mastercard and Visa.

32:52.280 --> 32:58.900
And those are just three organizations that work together to create a common specification for credit card payments.

32:59.660 --> 33:04.560
The credit card information is managed using the Fitbit mobile application.

33:04.560 --> 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.

33:16.180 --> 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.

33:25.840 --> 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,

33:44.140 --> 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.

34:01.780 --> 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.

34:14.860 --> 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.

34:31.660 --> 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.

34:45.280 --> 34:50.160
And what this does is that the transaction cannot be modified or replayed.

34:50.180 --> 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.

35:09.240 --> 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.

35:21.740 --> 35:22.480
Yeah.

35:24.160 --> 35:25.000
Okay.

35:25.000 --> 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.

35:35.180 --> 35:39.740
And for this purpose I grouped all the vulnerabilities we identified in two categories.

35:39.780 --> 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.

35:46.660 --> 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.

35:54.260 --> 35:57.680
And what is pretty obvious is that the right-hand side is much larger.

35:57.680 --> 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.

36:04.800 --> 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.

36:13.280 --> 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.

36:25.220 --> 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.

36:36.420 --> 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.

36:45.360 --> 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.

36:53.820 --> 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.

37:03.460 --> 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.

37:25.220 --> 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.

37:40.800 --> 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...

38:16.240 --> 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.

38:28.240 --> 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.

38:34.940 --> 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.

39:03.480 --> 39:04.320
Okay.

39:06.200 --> 39:16.540
So to conclude our talk we have three major points which we want to point out.

39:16.540 --> 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.

39:45.940 --> 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.

40:02.880 --> 40:03.840
Questions?

40:09.780 --> 40:13.680
So the question was if we already looked into the app, right?

40:13.680 --> 40:16.480
Do you want to talk about this?

40:16.720 --> 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.

40:54.000 --> 41:03.000
Okay, so the question was with the secure connections and the pairing how it works and why it kicks in later?

41:04.020 --> 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.

41:16.480 --> 41:21.800
They exchange data for a couple of seconds and then randomly pairing starts.

41:21.800 --> 41:25.340
I don't know why but I've seen this quite a lot when testing.

41:40.220 --> 41:44.240
Ah, so the question was if we also looked into other smartwatches.

41:44.240 --> 41:50.500
So actually another group at our university initially did a study on fitness trackers in general.

41:50.500 --> 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.

42:07.840 --> 42:13.860
So we actually picked Fitbit because we thought it's like a very interesting ecosystem.

42:13.860 --> 42:15.680
They have encryption and so on.

42:16.060 --> 42:20.320
So it's like we are hacking the strongest implementation.

42:20.840 --> 42:21.800
But yeah.

42:23.860 --> 42:25.100
Yeah.

42:30.220 --> 42:33.560
Ah, so the question is there's some Fitbits with GPS.

42:33.560 --> 42:35.800
I think it's the Fitbit search or something.

42:35.800 --> 42:41.080
But that one has been produced after 2015 so it's encrypted.

42:41.680 --> 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.

42:48.440 --> 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.

42:56.700 --> 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.

43:03.400 --> 43:07.560
And that's a lot of effort for just taking one device.

43:14.840 --> 43:16.300
Okay, then thank you for listening.

43:16.300 --> 43:19.060
We will be around here for a bit more if you have any questions.

43:19.060 --> 43:22.480
Also on how we patched the firmware for example.

43:22.480 --> 43:24.240
That might be interesting for some of you.

43:24.620 --> 43:25.280
Yeah.

43:25.280 --> 43:26.120
Thank you.

