start	end	text
0	4600	So, I guess we start. Thanks everybody for showing up so early.
5020	8600	I guess we are the first talk today on the IoT Village.
9600	13720	I still need to get this somewhere near my mouth.
14520	18540	So, I'm Daniel, this is Jiska and Caroline.
18600	23700	And we will present our work on Fitbit fitness trackers.
23700	28420	Our talk is called Fitness Firmware Hacking, the Current State of the Heart.
28420	34360	And this basically summarizes our research from the last few years.
34400	40260	And all the work we are presenting was done in the secure mobile networking lab.
41580	43780	So, a brief motivation.
44560	49840	A few years ago, I guess like 2017, there was this article in the Telegraph,
49840	58480	which talks about privacy in the Fitbit fitness trackers.
58480	59920	But that's not so important.
59920	63660	What's more important here is this comment from this guy,
63660	69520	who says basically, please modify my Fitbit so that I run 10k every day.
69520	73920	And we thought, why not help this poor soul achieving his goals.
73920	81080	And also, if you look like insurance companies,
81080	94240	you will get up to 1500 bucks bonuses if you upload your fitness data to the insurance companies
94240	97560	to show them that you are healthy and stuff like this.
97960	101760	So, let's start with the version comparison.
102860	108080	So, today we are going to show you several issues and hacks and modifications
108940	114220	that are applying to very different versions of the Fitbit.
114220	120340	So, we started with the Flex as a simple tracker and also the ChargeHR.
120440	124540	But Caroline did a lot of work on the Fitbit Ionic.
125000	129720	So, there will be very different things on top of this
129720	133500	because the Fitbit Ionic has different interfaces, which she will tell you.
133500	136540	Apart from this, all of them are ARM-based.
136540	143560	So, the architecture is definitely similar for the Flex and ChargeHR
143560	146380	and somewhat similar for the Ionic.
148580	153140	Yeah, the Fitbit Ionic is the first device within Fitbit's product portfolio
153140	155760	to be marketed as an actual smartwatch.
155880	158720	And this is because it introduces a number of new functionalities
158720	161220	and interfaces.
161320	164680	So, for instance, it does not only have GPS or Bluetooth.
164680	167500	It also has a Wi-Fi interface and NFC.
167500	169480	And it has something that is called Fitbit Pay,
169480	173920	which essentially allows you to contactlessly pay with your watch.
173960	177020	And you can develop your own custom applications in JavaScript
177020	180480	using, for instance, an online IDE called Fitbit Studio.
180600	183880	And, of course, it synchronizes data over Bluetoothable energy
183880	188500	using some form of application, for example, on a smartphone or computer.
189280	191200	And, of course, it has a number of different sensors
191200	194040	for capturing the user's fitness data.
194040	197080	And you can store music files, download radio station playlists,
197080	198840	for example, from Deezer or Pandora,
198840	201460	and connect your Bluetooth headphones.
201460	204480	And the Hungry Cat marks the parts of the Fitbit Ionic
204480	208340	that we thought were the most interesting in terms of security research.
211980	214880	So, I'm now going to introduce the communication
216060	218940	between the Fitbit and the server.
218940	222500	And this part is very important for you to remember
222500	225840	to understand the remaining part of the talk.
225840	229280	So, you have a Fitbit fitness tracker,
229280	233760	and this is connected over Bluetooth LE to the smartphone app.
233760	236920	And this connection is not that secure,
236920	240840	so it's not that important that it's not so secure
240840	246100	because the app is only forwarding this traffic over HTTPS to the server.
246100	250560	And the traffic is end-to-end encrypted with a device-specific symmetric key.
250560	255520	So, each Fitbit will have its own key,
255520	259440	128-bit key, during fabrication of it,
259440	262160	and it will be used for encryption.
263880	268260	And this encryption only has been on recent trackers only,
268260	271680	which means... well, recent... I mean, we started some years ago,
271680	274020	so any model introduced after 2015
274020	277000	has encryption enabled by default.
277240	281680	So, you cannot disable it, but on the oldest you could.
282060	285520	And then also, there was a memory attack
285520	288360	that was not patched in all trackers.
288360	292180	It was only patched in October 2017 on all trackers.
292180	294480	So, there were some possibilities in all the trackers
294740	297580	to analyze this communication in plain text.
298440	300060	So, what is happening?
300060	304380	If you are running, so if you're Suzy Fit here in the example,
304380	307820	you would run and then you have steps that are recorded
307820	310720	on the tracker locally.
310720	313880	And this locally stored data could be something like
314120	315700	a week of activity data.
315700	318240	But usually, if you're connected to the smartphone app,
318240	322500	this data will be transferred to the server,
322500	327120	just forwarded, and then it will be added to the activity database.
327120	331600	And this activity database has this data then in plain text,
331600	336560	but you need to actually log in with your smartphone
336560	338880	to see this data in JSON.
339140	343560	So, you would get summaries, like all the steps
343560	346520	of the last week or something, in JSON.
346780	350320	And the mega dumps itself, so the binary format from the tracker
350320	353200	will also be answered with some settings from the server.
353200	355280	So, this is a different communication here.
355280	357700	What you see in JSON is a different thing than what you will see
357700	359320	in the micro dump, mega dump.
361500	364080	And now, there is a very interesting concept,
364080	367940	because let's say I have my current step count
367940	370000	or my heart rate, and I would like to see it
370000	371560	in the smartphone app.
371660	374600	That would be very inefficient to send it to the server each time,
374600	377280	let the server decrypt, send it back in JSON, and so on.
377340	379300	So, there is a live mode.
379380	382820	And the idea here is that the user is logging in to the server,
382820	385980	does a local pairing with the tracker,
385980	388520	and then there is a remote association,
388520	390320	so each time I would log in again,
390320	392280	I would see the data from this tracker.
392580	394720	And the smartphone app, actually, in this step,
394720	396860	also gets authentication credentials.
397460	399420	These credentials are only obtained once,
399420	402020	so that you can later use them offline,
402020	405420	so that you don't need the server for getting more data.
405700	407640	And in this authenticated live mode,
407640	410100	you would get plain text data.
410960	416260	So, that is only the thing that you see as a summary on the display.
416260	418400	So, it's only the total step count of the day,
418400	420720	the current hide rate, and so on.
421180	424820	And there was also the possibility for a memory readout.
424880	426920	And since you can reuse this forever,
426920	430000	even if you associate the tracker another time,
430000	434220	this is kind of a critical thing here.
434220	437220	But we can also understand why they did it this way,
437220	438980	because it's for the offline usage.
438980	442100	So, it's kind of by design that you can reuse it forever.
443560	447800	So, Karin is now going to tell you about the additions on the Ionic smartwatch.
448800	452400	So, as I've said, the Fitbit Ionic introduces new functionality
452400	456240	and has new interfaces that have not been there in previous trackers.
456240	461340	And for this reason, the communication paradigm has also been a bit modified.
461640	466760	What remains largely the same is pretty much things like so-called server dumps.
466760	469100	This is something that Disco already told you about.
469100	472220	It's essentially a generalization of micro and mega dumps.
472220	475500	And they are sent from the Fitbit service over the Fitbit smartphone application
475500	477680	to the Fitbit smartwatch.
477760	482160	And also, the entire communication on top of plutable energy is very similar.
482160	484300	But there are also some new concepts.
484300	486460	For example, something that we called app dumps,
486460	490400	that I'm going to talk to you about later on in more detail.
490700	495360	And the Fitbit Ionic's Wi-Fi interface is used during the installation
495360	498020	of a custom application mainly for WebSocket traffic
498020	501540	and also for downloading firmware during a firmware update.
501540	502680	And that's pretty much it.
502680	506240	Everything else is still relayed over the smartphone application.
506420	510620	And the NFC interface is only used for the transmission of payment traffic
510620	512840	to and from a payment terminal.
512900	517060	And of course, as I've said, you can connect your Bluetooth headphones using Bluetooth.
520590	525950	Okay, so one important step during our research was accessing the hardware.
525950	529110	You can start with disassembling the app, of course,
529110	533570	or taking dumps from, I don't know, HTTPS.
533570	540010	But to get the whole picture, we thought we also want to get access to the hardware itself.
540230	545970	So, to quickly show you our thread model,
545970	551950	we still have Suzy Fit, who stores her activity locally on her tracker.
551950	555990	And of course, this tracker has a local symmetric device key.
556310	562410	But now what happens if Suzy is not so active anymore
562410	566470	and likes to modify her own data or get her own data?
566910	572650	So our goals are to access the local data storage and to get the encryption keys.
572810	575750	So the first stuff you do, of course, is to search for eBay
575750	578610	and buy all the trackers you get your hands on.
578610	584690	And so in our case, the Fitbit Flex was pretty cheap already.
584690	590970	So broken ones you could get up into patches of 20 for $1 each.
592250	599710	And so here's a quick look at the hardware and software of the Fitbit Flex.
599710	603150	So you have your main system on a chip.
603610	607610	You have, which in this case is a chip from STM.
607610	611450	It runs a Cortex-M3 arm.
611970	617890	And the firmware consists of a few libraries which we identified they used.
617890	621050	So for encryption, for example, they used libtomcrypt.
621050	625970	And for BLE, they used a library which is very similar to libble-shield.
626190	632770	And of course, apart from the main sock, you also have your Bluetooth chip,
632770	637410	which is from Nordic Semiconductors and an accelerometer.
637410	642550	And here in the Fitbit Flex example, everything is connected via a new R bus.
643190	647830	So if you pry open the hardware, this is pretty easy on the Fitbit Flex.
647830	655090	You just use a heating gun, heat it up, and then you can basically pull it apart and you will get to the PCB.
655190	661910	So here we already removed the battery and the vibration sensor or vibration actuator.
662590	666450	And so you already see that there are many testing points.
666450	669270	And the most important ones are these.
669590	673690	So TP8 and 9 are used for SWD debugging.
673690	679890	And you can use just the ground for the battery to connect it to your debugger.
680410	685410	And apart from this, there is also TP10, which you can use for resetting.
686150	687690	And yeah, that's it.
687690	692590	Then you have everything you need to hook it up to a debugger.
692590	697490	And so here on the right-hand side, this is how it looked in our case.
697490	704450	We just used the ST-Link debugger from STM in the breadboard, basically.
704530	709810	And with this, we were already able to read out all the memory.
710470	714050	So it basically consists of three big parts.
714050	717490	A flash, an EEPROM, and an SRAM.
717590	721090	The flash contains, of course, all the firmware code.
721090	725870	The EEPROM stores all the data you want to get your hands on.
725970	729750	And the SRAM, of course, for firmware variables.
731810	738310	If you have a closer look at the flash, you will see that it consists of two big parts.
738650	741110	An app part and a BSL part.
741110	743950	Iska will tell you more about these later.
744130	748030	But the important thing is that they can run independently from each other.
748030	752830	And the EEPROM, as I said, contains all your fitness data,
752830	759050	but also the serial number of the Fitbit, an encryption key, and an encryption switch.
759050	763170	So with this switch, it was possible to disable encryption completely.
763170	768930	But nowadays, the backend will not accept connections which are not encrypted anymore.
768930	770570	So this does not work anymore.
772650	777050	So one important step also was to re-enable GDB access.
777050	788010	What we discovered is that you were only able to connect to the Fitbit if you did a reset before this.
788730	797110	And after this, if you hit continue on your GDB, the connection to the debugger will be lost.
797110	803310	So at some point in time, it apparently remaps the GPIO ports to something else,
803310	806310	but not to something which we need for debugging.
806310	811510	So we thought, why not reset them to something which we actually need?
811790	816170	And what we used for this is the Nexmon patching framework.
816170	819870	So we already developed this for a previous project,
819870	826010	and with this framework, we are able to binary patch the stuff, basically.
826170	828270	And we adapted it for our needs.
829450	835170	Of course, our goal was to modify the firmware and enable the dynamic debugging.
836850	843370	So this is what the core graph looks like after initialization.
843370	846630	So at the beginning, GDB access still works.
846630	850250	And somewhere after the initialization, it doesn't work anymore.
850250	856350	So I have no idea where exactly these GPIO pins are reassigned,
856350	859090	but I actually don't need to know.
859090	864270	What we just did instead is to add an additional Bluetooth command
864270	871110	to remap the GPIO ports to re-enable GDB access.
871530	876790	And for this, we did this with a special Bluetooth command,
876790	883250	because we did not know which other use case they had for the GPIO pins.
883250	887360	And we just wanted to keep the side effects as small as possible.
889090	892370	And with this, of course, then we were able to have break points
892370	894170	and memory watch points and all the good stuff.
898180	902680	So naturally, we also had to look at the Fitbit Ionix hardware.
903060	906880	And we did this by using two broken Fitbit Ionix smartwatches.
906880	910380	And the goal was for us to understand the hardware that is used
910380	913340	and also to find possibilities for debugging.
913340	916780	And what you see on the picture below is the Fitbit Ionix main PCB
916780	919160	being powered by its battery pack.
919160	922280	And it has 39 copper wires soldered to its back
922280	924720	and is connected to a logic analyzer.
924720	927400	And since the Fitbit Ionix main PCB is rather small,
927400	930860	this entire setup always reminds me of the Flying Spaghetti Monster.
932080	935440	What you see on this picture are all the hardware markings
935440	940400	that we deciphered from the chips on the Fitbit Ionix main PCB using a microscope.
940640	945400	And what you see from this is that the Fitbit Ionix uses a Cypress Bluetooth chip,
945720	948600	a Broadcom Wi-Fi and an NXP NFC chip.
948600	953480	And also the CPU and the flash memory are manufactured by Toshiba.
953580	958280	And the CPU is custom-built for wearables and smartwatches.
958400	961700	And it contains an ARM Cortex-M4.
961700	966120	And it does not have JTAG interface, but instead uses SWD,
966120	968840	which is short for Serial Wire Debug.
968880	973140	And on the right-hand side, you see a comparison of the Fitbit Ionix main PCB
973140	975920	to the main PCB of the Fitbit Flex.
975920	981340	And what is noticeable is that the Fitbit Ionix has a lot more stuff going on on the PCB
981340	985020	and it's a lot more densely packed and more complex.
985020	987700	So there's definitely an involvement there.
988680	990960	This is the main PCB from the back.
990960	994280	With all the different testing points, there are 95 in sum.
994280	999020	And we tested 39 of them using the logic analyzer under different conditions.
999020	1004600	And we wanted to identify which testing points correlate to the SWD interface.
1004600	1010420	Unfortunately, Murphy's Law, this did not yield the desired result.
1010480	1016800	Instead, we found that testing points 25 and 28 are responsible for SWD clock
1016800	1022060	and input-output, respectively, after we desoldered the main CPU.
1022060	1025780	So if you want to follow up on this, these are the testing points to look for.
1027320	1032040	And this is what the flash memory and the main CPU look like desoldered.
1032040	1035240	And the interesting thing to note about the flash memory is that
1035240	1038560	we were not able to find any information on the public internet
1038560	1042340	about the manufacturer parts number on this chip.
1042340	1047060	We found one that was very similar, that had just one letter exchanged, essentially,
1047060	1048320	but it was bigger.
1048460	1052140	And this is why we think that it might be possible that this chip
1052140	1054820	is even custom-built for the Fitbit Ionix.
1060900	1065880	So, the thing is that it is not that practical to open up
1066780	1070840	a Fitbit to then change your step count or whatsoever.
1071200	1074200	So what we wanted to do is also to understand the wireless
1074840	1079880	firmware flashing process to flash our own firmware
1079880	1082840	that modifies something.
1082840	1086540	So, the firmware update process usually works as follows.
1086560	1092080	You just have the same mega-dump synchronization with the server
1092080	1094720	and the server realizes, hey, I have a new firmware
1094720	1099040	and then this firmware is actually shown to the user
1099040	1102840	and the user needs to confirm to do a firmware update.
1103200	1105820	And then again, the tracker is sending a micro-dump
1106440	1109060	and there is the firmware request to the server
1109620	1113860	and the answer to this contains two parts,
1113860	1117060	which Daniel was already talking about, a BSL and an app.
1117060	1119000	So, app here is not a smartphone application,
1119000	1124600	but the main application running on the Fitbit tracker.
1124600	1127620	And first, the BSL is flashed, validated and so on
1127620	1129600	and then there is a reboot to BSL
1129600	1132200	and then the same happens to the app.
1132240	1134940	So, the idea is that you cannot prick your tracker,
1134940	1140180	which means if I cannot reboot to BSL,
1140180	1143960	then my BSL was wrong and then I can still boot the app.
1144960	1146700	So far, so good.
1146700	1150380	Another thing that you need to understand for trackers
1150380	1154180	that still have a memory readout attack but do encryption
1154180	1157500	is how the encryption itself works.
1157620	1159280	So, we did a bit of reverse engineering
1160060	1166020	and found that the tracker is using LibTomCrypt
1166020	1169760	and with this it was also easier to find out
1169760	1172900	how the nonce is used, how the encryption key is used
1172900	1174280	and that they have a MAC.
1174280	1178340	So, the MAC also means that you cannot easily flip
1178780	1181400	a bit here and there to change the behavior
1181400	1185100	because then in the end it will no longer match
1185100	1186720	with the authentication MAC.
1186720	1190560	So, you really need to understand how the format works
1190560	1192260	and how the encryption works.
1193040	1196520	So, if you want to flash a modified firmware,
1196520	1199140	first of all you need to get the encryption key
1199140	1201840	or you have a tracker that is still in plain text.
1202400	1205800	You can achieve that actually if you buy one of the older trackers
1205800	1207520	and never connect it to the internet.
1207520	1210480	So, beginning of this year I was still buying trackers
1210480	1214240	that could be modified, but only the very old models
1214240	1217860	and then you need to find someone buying one of those models
1217860	1219500	that has never been unpacked.
1219640	1224400	So, if you have the key, you can then also read out the firmware.
1224500	1227160	If it's not already a firmware that we already have,
1227160	1230640	then you can copy the firmware, modify it with Nexmon
1230640	1233260	and copy it back to the smartphone app.
1233260	1238200	Our app actually already has a few firmware images built in.
1238200	1241980	So, if you just want to have one of the images that we provide,
1241980	1243340	you don't need to do this part,
1243340	1245820	but probably you are interested in binary patching
1245820	1247740	and want to have your own patches.
1249060	1252080	And then you need again to format and encrypt the firmware
1252080	1254680	and flash it back as I explained.
1255520	1258440	So, the pre-compiled firmware that we have
1258440	1260900	has a couple of funny features.
1260900	1264040	So, the first feature we actually did
1264040	1266660	when we had our first demo.
1268240	1270160	So, when we gave our first talk.
1270180	1273380	And it is just returning the step counts times 100.
1274220	1276460	So, you need to do less points.
1276880	1280000	And it will still look somewhat realistic to the server.
1280000	1281820	So, you could do some more advanced stuff here
1281820	1284820	like replaying activity records or something,
1284820	1287260	but we just do the steps times 100.
1288300	1289840	And another funny thing that happens,
1289840	1292900	so if you then are resetting the tracker that has this patch
1292900	1295580	and already have a high step count,
1295580	1299520	then it is like taking the square of this or something,
1299520	1301740	so it's getting like super high numbers.
1302060	1303800	And this is really funny,
1303800	1306340	because then if you have a Fitbit account in your inbox,
1306340	1308660	you will have like all the notifications of like,
1308660	1312560	you got the New Zealand badge of crossing all of New Zealand
1312560	1314400	in one day and so on, I don't know.
1315820	1318840	So, that's really funny what happens if you do this.
1318840	1322840	And yeah, you definitely don't need to do any more sports.
1324160	1326960	Maybe you shouldn't do too much of this,
1326960	1329700	because if you have a health insurance and want to tell the health insurance
1329700	1331840	I'm doing sports and then they are like,
1331840	1334740	yes, but you did like 2 billion steps,
1334740	1336300	then it might be strange.
1336440	1338180	So, be careful with this.
1339740	1341520	And then beginning of this year,
1341520	1344220	I also ported this code to the Fitbit ChargeHR,
1344880	1348660	which is also cool, because the Fitbit ChargeHR has a display.
1349100	1351560	And display means that you can impress your friends
1351560	1353980	without taking the smartphone app with you.
1353980	1356920	So, you can just show like, oh, I did a lot of steps today.
1357200	1360040	I was doing sports before coming to your party.
1360040	1362440	And then you don't need to move a lot on the party,
1362440	1363900	because otherwise they will think like,
1363900	1366040	how did you do 5,000 steps on the party?
1367740	1372060	Okay, so, the accelerometer is one thing that we thought
1372060	1373980	is very interesting to access,
1373980	1376580	because there is like, or at least has been,
1376580	1380400	no good tools with trackers that are waterproof
1380400	1384060	and still for experimentation to get accelerometer readings.
1384920	1388080	And there is almost no strings in the firmware,
1388080	1390120	so it's very hard to reverse engineer.
1390120	1393620	But one thing that is there is a factory test mode
1393620	1395620	with some basic console.
1395820	1399100	And luckily, so one of the very few things that has a string
1399100	1402000	is a command to test the accelerometer.
1403040	1407260	And with this, we found out how the accelerometer is configured.
1407540	1410800	And the most important part is the accelerometer is configured
1410800	1415040	to make measurements with a rate of 100 hertz,
1415040	1416980	so 100 measurements per second.
1416980	1420900	I think this type of accelerometer can also be configured differently,
1420900	1422480	so to something like 2 kilohertz,
1422480	1424460	which would mean that you could also record
1425000	1427560	or recognize some speech with this.
1427560	1430520	But the 100 hertz is totally sufficient
1431980	1435180	for recognizing some gestures and movements.
1435560	1439720	Actually, already something like 25 hertz would be okay,
1439720	1440620	so the question is,
1440620	1442920	could we get the readings of the accelerometer
1442920	1444520	somehow out of the tracker
1444520	1448580	with at least a rate of 25 hertz?
1449460	1452220	And the next problem is a bit that we are restricted
1452220	1454560	in how to patch this, because we do binary patching,
1454560	1458340	which means writing code from scratch aside,
1458340	1460900	it's easier to reuse existing functions.
1461120	1466640	So what we did is we made a switch into the live mode,
1466640	1468680	so we are using the live mode,
1468680	1475020	and then we are copying the XYZ values to the live mode.
1476200	1481000	And the rate of this is the Bluetooth LE packet rate,
1481000	1483840	and so you can put out the readings
1483840	1485920	with something like 66 hertz,
1485920	1488720	so it's not as much as the original readings,
1488720	1492040	but it's still sufficient if you want to develop something
1492040	1493920	that recognizes movements.
1496300	1498900	And the use cases are various,
1498900	1503420	so for example, you could now develop your own algorithms
1503420	1506380	that do something with accelerometers,
1506380	1508280	so recognize, I don't know, some gestures
1508280	1510480	on top of step counts.
1511200	1513140	And this you could do with Python
1513140	1518660	or whatever you like on your smartphone in Java, whatever.
1518720	1520220	And then once you have all the logic
1520220	1522580	of how to recognize those movements,
1522580	1525600	you can then point it back to C code with Nexamon,
1525600	1528020	because putting out the readings over Bluetooth
1528020	1529660	is draining the battery a lot,
1529660	1532420	so it's nothing to do forever,
1532420	1534840	but at least for development, it's very interesting.
1535560	1537220	So the versions that you can modify
1537220	1540240	is actually if you buy a Fitbit One Flex or ChargeHR
1540240	1542920	that has never ever been updated,
1542920	1545720	so a fresh one from the internet,
1546940	1551220	or if you updated it only a very, very, very long time ago,
1551220	1556500	so something like it was never updated since October 2017.
1557980	1560540	And the ChargeHR would also allow you
1560540	1562140	to access the heart rate sensor,
1562140	1564680	so there's also some help commands with this,
1564680	1568300	but we didn't release a patch for this so far,
1568300	1569620	but if someone is very interested,
1569620	1571240	we can look into this, of course.
1571240	1574460	Yeah, so much about the trackers,
1574460	1576120	and now we are going to tell you more
1576120	1578440	about the new smartwatch.
1581600	1584300	Okay, as Kiska said,
1584300	1586720	I'll be switching back to the Fitbit Ionic for a bit
1587280	1589020	and tell you about some of the insights
1589020	1591420	that we gained during testing.
1591500	1593060	So, as I've already mentioned,
1593060	1595080	the most interesting parts of the Fitbit Ionic
1595080	1596240	from our point of view
1597860	1599600	are Fitbit Pay,
1599600	1602380	the custom application installation capability,
1602380	1605940	as well as the way that the Ionic synchronizes data.
1605940	1607400	Synchronization is very interesting
1607400	1609700	because we found that it heavily relies
1609700	1611620	on the old Fitbit ecosystem
1611620	1613580	and reuses old functionality,
1613580	1616500	and we wanted to see whether all the old vulnerabilities
1616500	1618500	are still present there.
1618520	1620940	One thing to know about custom applications
1620940	1624960	is that the process of installing heavily relies
1624960	1626560	on the Wi-Fi interface,
1626560	1630020	and for this, Fitbit consistently uses TLS,
1630020	1631300	and sometimes, for example,
1631300	1633180	during the download of firmware,
1633180	1636220	they even use mutually authenticated TLS
1636220	1638280	using server and client certificates,
1638280	1640640	so it's rather hard to get in between the communication
1640640	1642880	or modify communication.
1644080	1645860	So I'll skip applications
1645860	1647520	and focus on Fitbit Pay
1647520	1649080	as well as synchronization
1649080	1651000	in the next couple of slides.
1651820	1654700	So one thing that I've talked quite a bit about already
1654700	1656160	is Bluetooth for Energy,
1656160	1657640	and as the name suggests,
1657640	1659340	it is closely related to Bluetooth,
1659340	1660620	yet a bit different,
1660620	1664280	because it has been designed for energy-constrained devices.
1664420	1667080	It operates on the 2.4 gigahertz frequency
1667080	1668940	and performs frequency hopping
1668940	1670560	on 40 channels,
1670560	1674000	of which 37 are used for data transmission.
1674620	1676060	The generic attribute profile
1676060	1679680	is another layer within the Bluetooth for Energy protocol stack,
1679680	1681220	and it groups related information
1681220	1683380	into services and characteristics,
1683380	1684920	and the smallest bit of information
1684920	1688520	on this layer is called an attribute,
1688520	1690920	hence the name generic attribute profile.
1691200	1692520	So the Fitbit Ionic
1692520	1694780	uses Bluetooth for Energy 4.2,
1694780	1697720	which is the latest Bluetooth for Energy version,
1697720	1700100	despite setting otherwise on the official website,
1700100	1700740	which is weird.
1700740	1702940	It says 4.0 on the website.
1703220	1704580	And Bluetooth for Energy
1704580	1706340	is not known for being
1706340	1709740	the most secure standard by design.
1709960	1711620	There is one pairing method
1711620	1713160	called JustWorks,
1713160	1715660	which essentially is the most
1715660	1717800	unsecure pairing method that you could use,
1717800	1721180	because it does not use authentication,
1721180	1723240	and depending on the Bluetooth for Energy version,
1723240	1725300	you can also launch active or passive
1725300	1728020	eavesdropping and man-in-the-middle attacks.
1728360	1730980	And this is precisely what the Fitbit Ionic uses.
1730980	1733240	It enforces the use of JustWorks pairing.
1733240	1736240	You cannot use anything else with your smartwatch,
1736240	1738820	and we assume that this is due to usability issues,
1738820	1741700	because it does not require user interaction.
1742760	1744060	Also, the Fitbit Ionic
1744060	1745780	exposes five different services
1745780	1748840	on the generic attribute profile layer,
1748840	1751640	and two of those services are proprietary,
1751640	1753020	and these are used by Fitbit
1753020	1757020	to layer their own application layer protocol on top.
1757600	1759400	And this application layer protocol
1759400	1762080	is what I'd like to dive a bit into
1762080	1763960	in the next couple of slides.
1764100	1765580	Some things are legacy
1765580	1768420	and have already been present in previous trackers,
1768420	1771400	and some things are new and specific to the Fitbit Ionic.
1771400	1773160	So one thing Jiska already mentioned
1773160	1775380	is the so-called live data,
1775380	1779040	which is the real-time fitness information of a user.
1779340	1782900	And this is still included and present on the Fitbit Ionic.
1782900	1785540	It is not protected in any way on the application layer
1785540	1789100	and sent between the smartwatch and the Ionic.
1789440	1791660	Another type of data that is present
1791660	1793380	on this application layer protocol
1793380	1795400	is so-called command messages.
1795400	1797080	They either instruct the receiving side
1797080	1800040	to take a certain action or signal a state.
1800700	1802560	And there have been modifications
1802560	1805680	to previous ones or older ones from older trackers
1805680	1807440	for the Fitbit Ionic.
1807440	1810360	And there are also a couple of new ones that have been introduced.
1810360	1812560	And they are also not protected on the application layer
1812560	1814620	and exchanged between the smartwatch
1814620	1817980	and the Fitbit application.
1818780	1821100	One thing that is new to the Fitbit Ionic
1821100	1823740	are something that we call app dumps.
1824080	1826360	App dumps because they are exchanged
1826360	1830100	between the Fitbit application and the Fitbit Ionic.
1830100	1834620	And they are encrypted dumps, encrypted blobs of data.
1835040	1838440	They are encrypted using AES in EAX mode
1838440	1840700	using a symmetric key of course.
1840700	1842940	And this key is derived using a proprietary
1842940	1845180	session key derivation protocol
1845180	1847080	that has been designed by Fitbit.
1847080	1849440	We reverse engineered this protocol.
1849440	1851080	And unfortunately for us,
1851080	1853480	we did not find a practical exploit
1853480	1855600	but only a theoretical attack on this protocol
1855600	1857680	because it has two independent stages.
1857680	1860340	And the semantics of the app dumps
1860340	1862340	are defined in a construct that is called
1862340	1863960	the Fitbit mobile data protocols
1863960	1866480	which essentially is a set of XML files
1866480	1870160	that define which bit and byte
1870160	1873360	within a protocol byte stream means what exactly.
1873400	1874960	And the normal thing about app dumps
1874960	1877600	is that it's the first time that the application
1877600	1880040	and the Fitbit tracker or smartwatch
1880040	1883580	has the capability of exchanging encrypted blobs of data.
1883580	1886300	Previously this was only present or possible
1886300	1889640	between the Fitbit tracker and the Fitbit servers.
1889840	1891960	And if you're interested how all of this works,
1891960	1893240	I have a little Python script
1893240	1895860	that demonstrates a little proof of concept
1895860	1899320	to show you how app dumps work
1899320	1901840	and how the session key derivation protocol works.
1902460	1903720	And last but not least,
1903720	1905100	I've already mentioned this,
1905100	1907440	server dumps are still present on the Fitbit Ionic.
1907440	1909160	They are exchanged between the Fitbit servers
1909160	1910500	and the smartwatch.
1910500	1912500	And they are also encrypted blobs of data
1912500	1914260	using a symmetric key.
1914260	1916380	And if you want to get to that data,
1916380	1918960	you either have to hack the Fitbit servers
1918960	1920160	or your Fitbit Ionic
1920160	1922320	because that's where the keys are.
1922320	1925360	It is completely transparent to the Fitbit mobile application.
1925480	1926700	And for the Fitbit Ionic,
1926700	1928860	the server dump header has been modified.
1930860	1932400	Another thing that we looked into
1932400	1936060	is the Fitbit pay capability.
1936240	1938760	And when I heard that you could now pay with your smartwatch,
1938760	1941280	I had really high hopes that it would be really insecure
1941280	1943260	so I could find a lot of things.
1943260	1945380	You can use Fitbit pay
1945380	1948460	if you have a supported credit or debit card
1948460	1951460	by one of the banks listed on Fitbit's website.
1951460	1952380	For instance,
1952380	1954000	the Bank of America is supported
1954000	1957280	or the German Landesbank Baden-Württemberg.
1957320	1958640	And all the payment traffic
1958640	1960420	is transmitted on the NFC interface
1960420	1963300	which means it is all transmitted wirelessly.
1963320	1964040	And the implementation
1964040	1965940	is according to the EMV standard
1965940	1967840	or EMV specifications.
1967840	1970460	And EMV is short for Europay International,
1970460	1972280	Mastercard and Visa.
1972280	1973840	And those are just three organizations
1973840	1975400	that work together to create a common
1976120	1978900	specification for credit card payments.
1979660	1981520	The credit card information
1981520	1984560	is managed using the Fitbit mobile application.
1984560	1985820	And for this purpose,
1985820	1987720	Fitbit registered a new web API
1988100	1989740	that is located under the domain
1989740	1990820	payables.co
1992320	1993900	And we focused on
1993900	1996180	analyzing the payment traffic.
1996180	1998100	And to do this, we used an app
1998100	1999480	that is called NFC Gate
1999480	2001340	which has been developed
2001340	2003280	within the CIMO Research Group,
2003280	2005760	the Secure Mobile Networking Lab.
2005840	2007000	And if you are interested in
2007000	2008940	sniffing your own payment traffic
2008940	2010960	using this very cost-effective setup,
2010960	2012760	you can go to the link below of this slide
2012760	2014760	which is nfc.wgf
2015480	2017220	And what NFC Gate does
2017220	2019480	essentially is it creates a Wi-Fi wormhole
2019480	2021360	so the first app on the first
2021360	2022880	smartphone captures the NFC traffic
2022880	2025040	from the Fitbit Ionic, sends it via Wi-Fi
2025040	2026980	to the NFC Gate server that is also
2026980	2028320	able to lock the traffic
2028320	2030300	and from there the traffic will be
2030940	2032420	relayed to the other NFC Gate app
2032800	2034780	where the data is sent via
2034780	2036840	NFC to its destination which in this case
2036840	2039660	is the payment terminal and vice versa.
2041780	2042680	Okay, so
2042680	2044980	after analyzing and
2044980	2047060	experimenting with this, we found
2048260	2048820	unfortunately
2048820	2051040	for us that it is rather secure
2051040	2052920	in terms of what is recommended
2052920	2054860	in the EMV standard.
2054860	2056400	So for instance
2056400	2058640	something that is called tokenization
2058640	2060780	is used during payment which means that
2060780	2062580	your credit card number is never
2062580	2064660	transmitted in plain text, instead it is
2064660	2066760	replaced with a so-called token
2066760	2068920	which essentially is a pseudonym
2068920	2070140	for your credit card
2070860	2072960	number. Also a so-called
2072960	2075060	authorization request cryptogram is used
2075060	2076520	which is a MAC that is
2076520	2078900	computed among other things over the
2078900	2080940	transaction details using a session
2080940	2083020	key that is derived from the credit card's
2083020	2085200	master key and a transaction counter.
2085280	2087000	And what this does is that the
2087000	2088800	transaction cannot be modified or
2088800	2091240	replayed. And last but not least
2091520	2092880	a four-digit PIN is used
2092880	2095040	as soon as you decide to set up Fitbit Pay
2095040	2096980	which is supposed to lessen the probability
2096980	2099120	of someone else paying with your watch
2099120	2101200	and it is also used during a process
2101200	2102960	that is called consumer device
2102960	2104920	cardholder verification which
2104920	2106820	proves your identity as a cardholder
2106820	2108720	towards the payment terminal.
2109240	2111080	And to sum all of this up
2111080	2113040	the security when
2113040	2115300	paying with your Fitbit Ionic
2115300	2117000	is pretty much the same than
2117000	2118800	paying with your contactless
2118800	2121020	plastic credit card.
2121740	2122480	Yeah.
2124160	2125000	Okay.
2125000	2127040	And next I would like to dive a bit into
2127040	2129000	all the vulnerabilities that we
2129000	2131080	found on the Bluetooth interface which is something
2131080	2133000	that we dedicated
2133200	2134660	a bit more time to.
2135180	2137040	And for this purpose I grouped all
2137040	2138940	the vulnerabilities we identified in two
2138940	2140980	categories. On the left-hand side
2140980	2143020	you see all the vulnerabilities that are new to
2143020	2145060	the Fitbit Ionic and have not been present
2145060	2146980	in previous trackers. And on
2146980	2148980	the right-hand side you see the vulnerabilities
2148980	2151000	that are due to legacy implementations
2151000	2152840	and have been known to be present
2152840	2154920	in previous trackers. And what is pretty
2154920	2157000	obvious is that the right-hand side is much
2157000	2158820	larger. There's much more vulnerabilities
2158820	2161100	and this is because Fitbit relies
2161100	2163000	on its old ecosystem and has the
2163000	2164700	need for backwards compatibility.
2164800	2166960	So they reuse a lot of
2166960	2168800	old stuff and implementations
2168800	2171220	and this of course causes all the old vulnerabilities
2171220	2172860	to still be present.
2173280	2175080	Instead of explaining each and every
2175080	2176920	one of those vulnerabilities, I'd
2176920	2179040	just like to point out the main points
2179040	2180600	of criticism that we have here
2180600	2182900	and that are or that essentially
2182900	2185220	cause all of these vulnerabilities.
2185220	2187080	So one thing that I've already talked to you about
2187080	2189080	of course is the weak Bluetooth Low Energy
2189080	2190940	pairing that just works pairing method
2191660	2192940	and also we found
2192940	2194760	that Bluetooth Low Energy security is
2194760	2196840	inconsistently enforced. This means
2196840	2198800	once the connection is set up between
2198800	2200580	your Fitbit Ionic and the smartphone
2200580	2202300	application,
2202300	2204580	Bluetooth Low Energy pairing does not instantly
2204580	2206660	kick in. Instead it takes some
2206660	2208740	time until pairing happens and during
2208740	2210680	this time all of your data will be transmitted
2210680	2212720	in plain text which of course is
2212720	2214860	not that great. So our recommendation
2214860	2216740	would be to use secure connections
2216740	2218680	whenever possible which is present in Bluetooth
2218680	2220900	4.2 and use a pairing
2220900	2223460	method that uses authentication.
2223460	2225480	Also Jiska already
2225480	2227520	said there is a problem with
2227520	2229300	reusable authentication credentials
2229300	2231580	for live data and this problem is
2231580	2233380	still present on the Fitbit Ionic
2233380	2235540	so if an attacker through whichever means
2235540	2237600	acquires those authentication credentials
2237600	2239640	they will forever be able to request
2239640	2241640	live data from your smartwatch and of
2241640	2243520	course this is also something that you do
2243520	2245420	definitely not want. So
2245420	2247440	the reuse of those authentication
2247440	2249580	credentials should be prevented for example
2249580	2251620	by associating them with a validity
2251620	2253600	period or if that's not possible
2253600	2255600	maybe just plainly store the last
2255600	2257620	used authentication credentials because they
2257620	2260340	are usually not swapped out that often.
2260800	2261840	Another problem
2261840	2263800	that persists is that live data
2263800	2265720	is not protected on the application layer
2265720	2267600	and this is a problem if you
2267600	2269700	use a weak Bluetooth 4.0 energy pairing
2269700	2271520	method as the Fitbit Ionic
2271520	2273660	does or if at
2273660	2275760	the beginning of each connection the traffic
2275760	2277700	is not instantly protected so our
2277700	2279620	recommendation at this point would be to
2279620	2281360	encrypt live data with a similar
2282600	2283800	mechanism that
2283800	2285600	EPTOMs are protected with and
2285600	2287520	this of course would introduce some additional
2287520	2289680	delays so your real
2289680	2291520	time data would not be entirely
2291520	2293700	real time anymore but security
2293700	2295620	has never been convenient so...
2296240	2297520	and last but not least
2297520	2299480	I also found some testing commands
2299480	2300920	to be present in production
2301560	2304040	for example I found a
2304040	2305840	command that allows you which is one command
2305840	2307400	to request a very large
2307400	2309480	test dump. It's just meaningless test data
2309480	2311460	but it's rather large and I was
2311460	2313420	able to keep the Fitbit Ionic sending
2313420	2315400	for 45 minutes straight. You could keep
2315400	2316940	this for even longer
2316940	2319420	and what it does is that it drains the Fitbit
2319420	2321480	Ionic's battery quite quickly and for
2321480	2323500	whatever reason the UI becomes
2323500	2325420	very sluggish and unresponsive so you
2325420	2327120	can't really use your smartwatch anymore
2327880	2328440	and
2329280	2331340	that's just pretty much unnecessary
2331340	2333480	so our recommendation would be
2333480	2335420	to employ a process that ensures
2335420	2337360	that all your testing code is not rolled
2337360	2339080	out to production which is probably
2339080	2341580	something that is standard in software
2341580	2342760	development.
2343480	2344320	Okay.
2346200	2346800	So
2347420	2348840	to conclude our
2349420	2349960	talk
2351260	2353360	we have three major points
2353360	2355300	which we want to
2355300	2356780	point out. So
2357160	2359300	in general we can say that Fitbit
2359300	2361300	products improved a lot during
2361300	2363320	the years which we observed them
2365020	2366180	in general
2366180	2367320	they have the problem of
2367320	2369420	compatibility for
2369420	2371100	older trackers so the app
2371100	2373380	still needs to have
2373380	2374600	this legacy protocol
2375500	2377260	which needs to talk via
2377260	2378800	Bluetooth and in general
2379580	2381340	it seems that Fitbit just
2381340	2383200	likes to implement
2383200	2385620	encryption in weird ways.
2385940	2387400	So that's it from our side
2387400	2388980	thanks for your time
2388980	2391140	and I guess we have now some time for
2391140	2392780	Q&A.
2402880	2403840	Questions?
2409780	2412160	So the question was if we already
2412160	2413680	looked into the app, right?
2413680	2416480	Do you want to talk about this?
2416720	2418160	Yeah, so we looked into the app
2418160	2420360	so Caroline did it and me too
2420940	2422460	for understanding for example
2422460	2423820	how the firmware is
2423820	2426200	and so on and we patched
2426200	2428080	the APK and made some
2428080	2430040	debug prints and so on to get an
2430040	2431620	idea of what is going on.
2454000	2455780	Okay, so the question was
2455780	2457970	with the secure connections
2458380	2459620	and the pairing
2459620	2461760	how it works and why it
2461760	2463000	kicks in later?
2464020	2465940	So, I do not know why
2465940	2467860	but I would expect that you pair
2467860	2470140	or use a secure
2470140	2471940	encrypted connection before you exchange
2471940	2473860	any data between the smartwatch and
2473860	2476160	the application and this just doesn't happen.
2476480	2478000	They exchange data for a couple
2478000	2479500	of seconds and then randomly
2479500	2481800	pairing starts.
2481800	2483900	I don't know why but I've seen
2483900	2485340	this quite a lot when testing.
2500220	2501420	Ah, so the question
2501420	2503140	was if we also looked into other
2503140	2505340	smartwatches. So actually another
2505340	2506640	group at our university
2507160	2508600	initially did a study on
2509160	2511140	fitness trackers in general. I think that was
2511140	2513160	back in 2017 or so
2513160	2515020	or 2016 and
2515020	2516540	they bought something like
2517220	2518180	16, 17
2519340	2521240	trackers, different kinds and
2521240	2523300	what they found out is that most
2523300	2525420	IOT fitness trackers do
2525420	2527460	not even encrypt the data.
2527840	2529060	So we actually
2529060	2531380	picked Fitbit because we thought it's like
2531700	2533860	a very interesting ecosystem.
2533860	2535680	They have encryption and so on.
2536060	2537260	So it's like we are
2537260	2538960	hacking the strongest
2538960	2541800	implementation. But yeah.
2543860	2545100	Yeah.
2550220	2551500	Ah, so the question is
2551500	2553560	there's some Fitbits with GPS.
2553560	2555800	I think it's the Fitbit search or something.
2555800	2557860	But that one has been
2557860	2559880	produced after 2015 so
2559880	2561080	it's encrypted.
2561680	2563700	And then it's harder to do it so
2563700	2565760	that's why we just went then
2565760	2568260	straight to the Ionic to see what changed.
2568440	2569920	I assume that some
2569920	2571940	stuff would be similar so if you would
2571940	2574020	open the PCB and so on
2574020	2575640	then you could maybe extract the firmware
2575640	2577740	again. But then you only
2577740	2579300	have access to this one tracker
2579940	2581720	with the one encryption key that is
2581720	2583400	on this very same tracker.
2583400	2585240	And that's a lot of effort
2585240	2587560	for just taking one device.
2594840	2595380	Okay, then
2595380	2597320	thank you for listening. We will be around here
2597320	2599060	for a bit more if you have any questions.
2599060	2601320	Also on how we patched
2601320	2603300	the firmware for example. That might be interesting for
2603300	2605280	some of you. Yeah.
2605280	2606120	Thank you.
