1 00:00:00,000 --> 00:00:05,740 Welcome. Thank you for spending your time and skipping the loss of testimony to come see me. 2 00:00:06,760 --> 00:00:08,220 It makes me feel great. 3 00:00:08,620 --> 00:00:12,260 So I'm here to talk about automotive bootloaders. 4 00:00:13,340 --> 00:00:17,080 So I guess, first of all, a little bit about who I am. 5 00:00:17,580 --> 00:00:22,880 I'm Phil Lepchinsky, so it's lap with all the consonants and then ski. 6 00:00:24,540 --> 00:00:29,040 I'm a software engineer, a senior staff engineer at Renesas, 7 00:00:29,040 --> 00:00:32,840 and we make chips and all kinds of things. 8 00:00:35,220 --> 00:00:36,800 So what am I here to talk about? 9 00:00:38,420 --> 00:00:39,960 Embedded bootloaders in automotive. 10 00:00:40,320 --> 00:00:41,400 So what does a bootloader do? 11 00:00:42,060 --> 00:00:46,120 Essentially, it owns the reset vector in the microcontroller, 12 00:00:46,600 --> 00:00:52,260 and on reset, the bootloader is going to determine if your application is valid or not. 13 00:00:52,780 --> 00:00:56,060 If it's valid, it allows you to load the application. 14 00:00:56,780 --> 00:00:58,040 On a big system, on a chip, 15 00:00:58,140 --> 00:00:58,500 it might say, 16 00:00:59,040 --> 00:01:00,980 copy that over into RAM and execute it. 17 00:01:01,440 --> 00:01:07,340 For embedded devices, though, it typically will just jump to the start vector of your application. 18 00:01:10,040 --> 00:01:12,220 Also, in deeply embedded devices, 19 00:01:12,460 --> 00:01:17,340 the bootloader usually allows you to reprogram the memory, the flash and the micro. 20 00:01:17,940 --> 00:01:18,320 So, 21 00:01:21,800 --> 00:01:24,300 so here you have the root letter vector. 22 00:01:24,580 --> 00:01:25,560 Jump into the bootloader. 23 00:01:25,640 --> 00:01:28,400 It's going to do some stuff, determine if you have a valid application or not, 24 00:01:28,440 --> 00:01:29,020 and then jump to the bootloader. 25 00:01:29,040 --> 00:01:29,980 And then it's going to do some stuff, determine if your application is valid or not. 26 00:01:32,500 --> 00:01:32,900 And then it's going to do some stuff, determine if you have a valid application or not. 27 00:01:32,900 --> 00:01:34,420 So, we've got these in the car. 28 00:01:34,500 --> 00:01:35,300 We know that they're in there. 29 00:01:35,680 --> 00:01:36,820 How do we talk to them? 30 00:01:36,920 --> 00:01:39,640 Well, it makes it, we make it easy in automotive. 31 00:01:40,180 --> 00:01:42,440 We have a proprietary connector for OBD, 32 00:01:42,560 --> 00:01:45,940 and you have to get special dongles, like the car hacking village dongle. 33 00:01:46,460 --> 00:01:48,200 So everybody go buy one of those, they're 80 bucks. 34 00:01:50,480 --> 00:01:52,420 But that allows us to connect to the CAN bus. 35 00:01:52,660 --> 00:01:56,420 So that's defined by ISO protocol, released in 86. 36 00:01:56,760 --> 00:01:58,940 But it's 2008, become mandatory. 37 00:01:59,040 --> 00:02:03,400 So we know that any vehicle after 2008, it's in there, we can talk to it. 38 00:02:03,620 --> 00:02:10,220 And so that's the physical layer connected through the OBD2 dongle. 39 00:02:12,460 --> 00:02:17,120 To start talking to these things, so CAN, only 8-byte payloads. 40 00:02:17,140 --> 00:02:19,040 That doesn't give us a lot of information. 41 00:02:19,120 --> 00:02:22,520 We can send small commands, but we can't send, like, large amounts of data. 42 00:02:23,320 --> 00:02:24,360 So I know. 43 00:02:26,160 --> 00:02:28,580 So we got the transport layer, 15765. 44 00:02:29,720 --> 00:02:36,540 That's the underlying transport layer that sits on top of CAN and between CAN and the diagnostic layer. 45 00:02:36,760 --> 00:02:44,860 So this basically allows us to send payloads up to 4K by segmenting the messages. 46 00:02:47,160 --> 00:02:52,960 So on top of that, we're just going to make layers and layers and layers of protocols to make it confusing. 47 00:02:53,380 --> 00:02:57,540 We've got ISO 14229, and that's Unified Diagnostic Services. 48 00:02:58,240 --> 00:02:58,520 So. 49 00:02:59,040 --> 00:03:09,840 This is a ISO spec that basically defines a whole bunch of common services, essentially creating the API. 50 00:03:10,140 --> 00:03:11,640 It's client-server. 51 00:03:11,760 --> 00:03:17,360 So you send it a request with your client, and the server running on the ECU will send the response. 52 00:03:19,340 --> 00:03:25,500 Essentially, this spec defines all of the different standard services. 53 00:03:25,820 --> 00:03:29,020 There can be also OEM or supplier-specific services. 54 00:03:29,040 --> 00:03:29,640 There can be OEM or supplier-specific services as well. 55 00:03:31,580 --> 00:03:33,180 And there's also security levels. 56 00:03:33,400 --> 00:03:37,500 So there's different sessions to get elevated privileges. 57 00:03:40,640 --> 00:03:43,620 For bootloaders, we're typically talking about the programming session. 58 00:03:43,840 --> 00:03:46,520 ISO defines session two as the programming session. 59 00:03:46,800 --> 00:03:53,920 So if you send a session control change request to go into the programming session, now you go into the bootloader. 60 00:03:54,280 --> 00:03:56,020 So this is where things get interesting. 61 00:03:56,640 --> 00:03:57,160 Thank you. 62 00:03:59,340 --> 00:04:01,500 And I guess before I jump to that, let me explain. 63 00:04:03,140 --> 00:04:12,940 On an embedded device in automotive, the bootloader is typically a whole separate executable program that's separately compiled from the application. 64 00:04:13,320 --> 00:04:22,880 So there's some kind of inter-process communication that happens between, like, your normal application and the bootloader when you're sending, passing the information through. 65 00:04:22,960 --> 00:04:24,380 So that's usually done through, like, a reset. 66 00:04:24,560 --> 00:04:27,840 So you might get a programming, like, a session control request. 67 00:04:27,840 --> 00:04:31,140 And it'll set some flags and then cause a reset. 68 00:04:31,320 --> 00:04:33,620 And then the bootloader says, oh, hey, I'm in programming session. 69 00:04:33,840 --> 00:04:34,920 Let's go do something interesting. 70 00:04:37,220 --> 00:04:40,720 So what does this look like, the typical programming sequence? 71 00:04:42,120 --> 00:04:46,780 It's broken up into three distinct kind of groups. 72 00:04:46,940 --> 00:04:51,140 There's this pre-programming sequence, which happens before you program. 73 00:04:51,560 --> 00:04:55,060 There's the programming sequence, which is when you're doing the programming. 74 00:04:55,560 --> 00:04:57,200 These are really easily named. 75 00:04:57,200 --> 00:05:01,700 And then the post-programming sequence, which I bet you guys can guess, it's after you program. 76 00:05:04,340 --> 00:05:06,740 All right, so pre-programming, what happens here? 77 00:05:07,680 --> 00:05:13,060 This is, like, usually OEM-specific, really what you're doing. 78 00:05:14,320 --> 00:05:19,840 But in the ISO spec, there's common things that typically happen. 79 00:05:20,840 --> 00:05:24,580 Oftentimes, you'll do a session control and jump into this, the extended session. 80 00:05:24,720 --> 00:05:25,840 So that's session three. 81 00:05:27,200 --> 00:05:34,860 And the extended diagnostic session gives you, like, elevated services than your normal diagnostic default session 82 00:05:34,860 --> 00:05:37,120 that would be, like, you're driving around in the car. 83 00:05:37,760 --> 00:05:40,200 So what you do is you go into this extended session, 84 00:05:40,380 --> 00:05:43,580 and you start doing things that are going to prepare the vehicle for programming. 85 00:05:43,780 --> 00:05:47,000 So one of the common things is to turn off DTCs. 86 00:05:47,020 --> 00:05:52,720 So I'm going to, like, change my application software on the car, 87 00:05:52,880 --> 00:05:56,000 and all these other ECUs are still talking to each other or they're looking for messages. 88 00:05:57,200 --> 00:06:01,840 And if there's an ECU that's down, not, you know, sending its messages, 89 00:06:02,280 --> 00:06:05,700 everybody else that relies on my messages is going to say, what the hell is going on? 90 00:06:06,320 --> 00:06:08,020 It'll start setting DTCs. 91 00:06:08,020 --> 00:06:09,380 It'll, you know, it doesn't know what's going on. 92 00:06:09,560 --> 00:06:14,900 So typically, when the diagnostic tester is going to initiate a programming session, 93 00:06:15,840 --> 00:06:18,200 it turns off all the DTCs. 94 00:06:18,200 --> 00:06:20,940 It might turn off, disable the non-diagnostic communication. 95 00:06:21,400 --> 00:06:25,980 And so say, okay, everybody be quiet on the bus because I want to start reprogramming ECUs. 96 00:06:27,400 --> 00:06:31,680 This may or may not require security access to get into this session. 97 00:06:31,940 --> 00:06:37,100 Again, this is all OEM-specific, and the OEM specs are all secretly guarded and under NDA. 98 00:06:37,660 --> 00:06:39,960 And there's a bunch of OEM people here that they weren't. 99 00:06:40,120 --> 00:06:41,480 They don't let me tell the secrets. 100 00:06:44,300 --> 00:06:45,800 So then there's the programming step. 101 00:06:46,080 --> 00:06:51,820 And this is when you basically activate the bootloader and unlock it. 102 00:06:52,840 --> 00:06:56,800 UDS defines a security seed key exchange, so service 27. 103 00:06:57,920 --> 00:07:04,000 And you basically, the tester will say, hey, go give me a seed, sends the seed back, 104 00:07:04,140 --> 00:07:07,040 and then the tester will send the response. 105 00:07:07,220 --> 00:07:08,300 It's a challenge response protocol. 106 00:07:09,220 --> 00:07:13,960 But again, the way this is programmed, the actual algorithm is not defined by ISO. 107 00:07:14,120 --> 00:07:16,580 That's defined specifically by the OEM. 108 00:07:17,940 --> 00:07:24,180 One thing to note, you know, again, the industry is continually trying to strive for better security. 109 00:07:24,180 --> 00:07:31,720 But historically, OEMs didn't always do a great job with their security algorithms. 110 00:07:31,980 --> 00:07:37,860 It might be a secret algorithm that's, you know, some engineer made up one day. 111 00:07:38,720 --> 00:07:42,540 And the secrecy of it is because it's hidden in a desk somewhere. 112 00:07:43,820 --> 00:07:49,700 But lots of smart reverse engineers out there that can figure things like that out. 113 00:07:50,840 --> 00:07:53,540 So historically, that's been a problem. 114 00:07:54,180 --> 00:08:02,380 The industry is working towards better types of security there and also other things like better entropy on the seeds. 115 00:08:02,680 --> 00:08:03,920 That's another problem. 116 00:08:05,760 --> 00:08:08,340 Anyway, so you unlock this thing, service 27. 117 00:08:10,020 --> 00:08:18,640 There may be some write data by identifier service where you write, like, a fingerprint or some specific information. 118 00:08:18,960 --> 00:08:23,700 So this is typically, like, the tester might do, like, write the programming date. 119 00:08:24,380 --> 00:08:26,640 And then it's like, hey, this was flashed into the ECU, like, the last time it did it. 120 00:08:26,780 --> 00:08:28,300 Or write its, like, serial number. 121 00:08:28,480 --> 00:08:33,920 So, like, the tester's serial number into it and say, hey, this was flashed by, you know, Ben's serial number. 122 00:08:35,600 --> 00:08:36,520 One, two, three, four. 123 00:08:38,840 --> 00:08:39,560 Very professional. 124 00:08:41,180 --> 00:08:46,280 So then what it'll do is, again, this is, a lot of this stuff is, it's defined by ISO. 125 00:08:46,460 --> 00:08:49,040 But exactly how it's done is OEM specific. 126 00:08:49,400 --> 00:08:54,160 So some OEMs will have a secondary bootloader that you download. 127 00:08:54,180 --> 00:08:58,160 And typically what's in that is, like, the actual flash routines. 128 00:08:58,500 --> 00:09:01,680 So residing in the ECU normally, they're not in there. 129 00:09:01,800 --> 00:09:08,960 So you can't, like, just, you know, gain, do, like, some buffer overflow and get into there and rewrite the ECU. 130 00:09:09,020 --> 00:09:11,320 Because the code for that's not even in there. 131 00:09:13,440 --> 00:09:16,480 The flash drivers are actually downloaded by the tester. 132 00:09:17,720 --> 00:09:19,900 And they're set up specifically for that ECU. 133 00:09:20,180 --> 00:09:23,580 So you download that and then you activate that. 134 00:09:24,580 --> 00:09:29,280 And so that enables now the programming routines. 135 00:09:31,580 --> 00:09:36,660 So the next thing that happens then is we're going to get into this. 136 00:09:36,700 --> 00:09:39,520 So once we've activated the bootloader, we're going to get into this download step. 137 00:09:40,820 --> 00:09:45,340 And the way that looks is you have a request download. 138 00:09:45,520 --> 00:09:50,860 So service 34, which says you send basically your address and the length. 139 00:09:51,640 --> 00:09:54,100 And there's different types of addressing, like some OEMs. 140 00:09:54,180 --> 00:09:56,940 So we'll have, like, actual address-based addressing. 141 00:09:57,860 --> 00:10:02,120 Some have what's called, like, logical blocks, where you give it the logical block identifier. 142 00:10:04,100 --> 00:10:06,740 Again, it's, all of this stuff is proprietary. 143 00:10:09,520 --> 00:10:14,440 Then you have the service 36, which is the transfer data. 144 00:10:14,680 --> 00:10:21,040 So you're sending this, and you can send basically, you know, 4K at a time until you have all of your data there. 145 00:10:21,480 --> 00:10:24,140 Once that's happened, you do a transfer. 146 00:10:24,180 --> 00:10:24,680 And then you do a transfer data exit. 147 00:10:24,960 --> 00:10:36,420 And so this is typically where you do something like a checksum or do an integrity check of all of this data before activating it. 148 00:10:37,800 --> 00:10:46,360 So there may be, like, a routine control after that that says, hey, do this check routine and, you know, check the checksum on it. 149 00:10:46,480 --> 00:10:50,460 That's the basic, least secure way is just doing the checksum. 150 00:10:51,180 --> 00:10:53,020 You know, it varies wildly. 151 00:10:53,160 --> 00:10:54,060 It's all OEM-specific. 152 00:10:54,180 --> 00:10:55,020 It's all OEM-specific and proprietary. 153 00:10:55,680 --> 00:11:00,940 So a lot of times this could be also where you do, like, the code signing check verification. 154 00:11:03,440 --> 00:11:07,420 But really that could be done in the transfer data exit, or it could be done with a special routine. 155 00:11:07,840 --> 00:11:12,360 It's all up to an OEM to decide how to do that in their specifications. 156 00:11:14,600 --> 00:11:16,480 So, okay, all the data's got there. 157 00:11:16,940 --> 00:11:20,540 We sent it to the ECU. 158 00:11:20,700 --> 00:11:22,480 We've verified that the data's good. 159 00:11:22,700 --> 00:11:24,160 It's good to go. 160 00:11:24,180 --> 00:11:25,600 It looks authentic-ish. 161 00:11:26,660 --> 00:11:27,560 Now what happens? 162 00:11:28,580 --> 00:11:32,420 The tester will say, okay, go back into the diagnostics or the extended session. 163 00:11:33,060 --> 00:11:35,680 We start getting it ready for the post-programming. 164 00:11:35,740 --> 00:11:40,660 So you turn the DTCs back on because now your application is all working great. 165 00:11:40,940 --> 00:11:46,520 And you can turn the normal diagnostic communication, non-diagnostic communications on. 166 00:11:46,920 --> 00:11:49,660 And then you usually do, like, a session control to the default session. 167 00:11:49,940 --> 00:11:51,920 And so this usually happens through, like, a reset. 168 00:11:52,060 --> 00:11:53,560 So the bootloader says, okay, we're done. 169 00:11:54,180 --> 00:11:54,620 We reset. 170 00:11:54,900 --> 00:11:56,840 And you jump back into the application. 171 00:11:59,220 --> 00:12:08,800 So, okay, now that you have, like, the most basic understanding of how ECU bootloaders or automotive bootloaders work, 172 00:12:09,740 --> 00:12:13,000 how are these used potentially as an attack factor? 173 00:12:13,160 --> 00:12:16,960 Well, there's lots of things that it can do. 174 00:12:17,860 --> 00:12:19,100 It's a very powerful. 175 00:12:19,240 --> 00:12:19,980 It's its own application. 176 00:12:21,300 --> 00:12:24,060 And so just by... 177 00:12:26,360 --> 00:12:35,460 What it does, its normal operation, it necessity, like, by necessity, has to do things like, well, it prevents the application from running because it's its own application. 178 00:12:35,740 --> 00:12:40,280 So if you can say, hey, go into the bootloader, well, now the application is not working. 179 00:12:41,780 --> 00:12:44,120 And why would you want to turn the application off? 180 00:12:44,240 --> 00:12:46,700 Well, what if you're trying to, like, spoof messages? 181 00:12:47,780 --> 00:12:52,900 If you're spoofing messages on the bus and the ECU is also sending out its valid messages, 182 00:12:53,200 --> 00:12:54,100 well, now you're... 183 00:12:54,180 --> 00:13:00,360 You have this contention or confliction, if you like to make up words. 184 00:13:05,860 --> 00:13:11,460 So if you have this, you know, now you can turn the ECU off and you can send its messages and spoof the messages. 185 00:13:13,020 --> 00:13:19,700 Most automotives right now are not using, like, CAN is not, by the protocol itself, is not sending authenticated messages. 186 00:13:19,900 --> 00:13:20,640 It's a bus protocol. 187 00:13:20,860 --> 00:13:24,160 So if I send messages with this ID, with this... 188 00:13:24,180 --> 00:13:31,860 With this signal, I can now, you know, the ECUs that are listening to this can now have to listen to it if you're on the same bus and all those other things. 189 00:13:32,980 --> 00:13:38,300 So turn the ECU off and send your own messages and spoof those. 190 00:13:39,660 --> 00:13:40,460 It's also... 191 00:13:40,920 --> 00:13:44,940 It is auto-reset the decision maker, right? 192 00:13:45,080 --> 00:13:47,500 It's deciding, is this application valid or not? 193 00:13:47,760 --> 00:13:53,640 And meaning you could also say, if you can make it so that it thinks the application is not valid, 194 00:13:54,180 --> 00:13:57,020 it's not going to run that application and you're permanently disabled. 195 00:13:57,300 --> 00:14:06,840 Or if you can somehow subvert the validity checks, now you can execute non-signed code or you can execute whatever you want, right? 196 00:14:08,540 --> 00:14:15,980 It also, by nature, has ways to input data or export data, you know, exfiltrate data. 197 00:14:16,220 --> 00:14:21,740 So some OEMs implement request upload. 198 00:14:22,080 --> 00:14:23,400 Part of the ISO spec. 199 00:14:24,620 --> 00:14:25,500 It's available. 200 00:14:28,260 --> 00:14:36,340 The general practice is not to do that because then you could just send requests to pull all the code out of there, your firmware. 201 00:14:38,540 --> 00:14:40,320 But some OEMs do it. 202 00:14:40,420 --> 00:14:42,920 Or the supplier implements it for whatever reason. 203 00:14:44,980 --> 00:14:48,260 By the nature of the ruler, you can write data to it, request download. 204 00:14:48,540 --> 00:14:52,260 That's, you know, if you can write something into RAM, 205 00:14:52,860 --> 00:14:54,060 then maybe you can execute. 206 00:14:54,180 --> 00:14:59,780 Like a couple slides back, we've got this programming step where you're downloading a flash driver. 207 00:15:00,400 --> 00:15:02,900 So that's basically downloaded and run out of RAM. 208 00:15:06,760 --> 00:15:08,480 You can read interesting data, right? 209 00:15:08,540 --> 00:15:11,420 There's the service 22, read data by ID. 210 00:15:11,840 --> 00:15:14,500 So if you have IDs, you can read certain things out of there. 211 00:15:14,540 --> 00:15:17,520 That might be interesting in getting things out of it. 212 00:15:18,680 --> 00:15:23,480 Again, it might have, because it's its own separate application, it's a different session. 213 00:15:24,180 --> 00:15:27,480 There may be different DIDs available than what are in the application. 214 00:15:27,820 --> 00:15:34,040 So there's more or at least different information sometimes out of the bootloader. 215 00:15:35,480 --> 00:15:37,720 You may be able to read a specific spot in memory. 216 00:15:37,880 --> 00:15:40,320 There's a service 23, read memory by address. 217 00:15:40,600 --> 00:15:45,280 And again, these are all like, these are just the ISO services that are defined, right? 218 00:15:46,880 --> 00:15:48,520 That's, you know, you can look them up online. 219 00:15:50,100 --> 00:15:52,020 Write specific parameter data. 220 00:15:52,200 --> 00:15:53,140 So write data by ID. 221 00:15:53,220 --> 00:15:53,920 That's available. 222 00:15:54,180 --> 00:15:55,600 Write memory by address. 223 00:15:56,060 --> 00:15:57,740 That's, you know, that's a service. 224 00:15:59,040 --> 00:16:02,600 Usually there's range checking and stuff in there if it's done, implemented correctly. 225 00:16:03,200 --> 00:16:12,160 But again, there's, you know, there's a lot of powerful things available if you can get around, you know, security there. 226 00:16:14,280 --> 00:16:17,400 Another attack factor is man in the middle of the programming sequence. 227 00:16:17,660 --> 00:16:24,160 So if you have a valid tester, even without knowledge of, you know, the security or anything like that, 228 00:16:25,100 --> 00:16:27,540 you may be able to record the programming sequence. 229 00:16:28,480 --> 00:16:30,640 You may be able to replace certain parts of it. 230 00:16:31,460 --> 00:16:40,280 You could potentially intercept firmware over the wire because lots of OEMs don't, like, encrypt the data once it gets to the CAN bus. 231 00:16:40,420 --> 00:16:41,680 It might be encrypted at rest. 232 00:16:41,860 --> 00:16:43,620 It might be encrypted in the cloud when they pull it down. 233 00:16:43,760 --> 00:16:51,220 But the ECU doesn't have, like, the symmetric keys in it to, like, decrypt the firmware. 234 00:16:51,380 --> 00:16:53,580 So it's usually just transmitted over. 235 00:16:53,580 --> 00:16:55,160 You know, unencrypted. 236 00:16:57,420 --> 00:17:02,060 Again, this, you know, it's all OEM specific and people are moving towards encrypted firmware, of course. 237 00:17:04,480 --> 00:17:06,580 But, you know, that could be with a valid tester. 238 00:17:06,680 --> 00:17:15,440 That could be easier than, you know, trying to get JTAG on a device and pulling the firmware, right, if you can just snoop it off the bus. 239 00:17:16,680 --> 00:17:20,380 Again, I mentioned this before, replay attacks on certain sequences. 240 00:17:20,640 --> 00:17:23,240 So if the tester is validly doing something. 241 00:17:23,840 --> 00:17:24,240 Interesting. 242 00:17:24,340 --> 00:17:26,040 Maybe you can record that in CAN and then replay it. 243 00:17:27,080 --> 00:17:28,460 And how would you do something like that? 244 00:17:28,560 --> 00:17:31,240 Well, I'll get to that in a second. 245 00:17:34,520 --> 00:17:46,780 Also, by nature of what the tools have to do, right, the programming tool is going to have the images, right? 246 00:17:46,860 --> 00:17:49,580 You have to flash these images to the ECU. 247 00:17:49,720 --> 00:17:52,880 So if the tool itself is not well programmed. 248 00:17:53,680 --> 00:17:54,080 Protected. 249 00:17:55,000 --> 00:18:05,820 That may be, like, an easier attack vector than trying to, like, you know, get a buffer overflow in a bootloader or trying to get JTAG or somehow, like, taking this, you know, pulling the firmware off the ECU. 250 00:18:06,600 --> 00:18:11,160 Because the programming tool itself needs to have the firmware because it's sending it to the ECU. 251 00:18:11,900 --> 00:18:23,060 You can also get information about the proprietary programming sequences and things like that because, you know, unless you have specs from an OEM or, you know, have access to this stuff. 252 00:18:23,580 --> 00:18:26,280 It's all highly secretly guarded, right? 253 00:18:28,520 --> 00:18:41,800 Also, anytime, you know, it's using any kind of, like, symmetric keys, like if it's the CT algorithm is not authenticated all the way to, like, a back end, the tool itself, you know, may have the symmetric keys for CT. 254 00:18:42,040 --> 00:18:52,480 So instead of trying to reverse engineer this firmware or, you know, hack into an HSM on an ECU, the programming tool might just have all the algorithms in it. 255 00:18:54,000 --> 00:19:06,260 Another thing that's awesome about UDS is that so that the way a seed key is designed is basically it's like a, you know, it's like a blind butler. 256 00:19:06,340 --> 00:19:09,580 Like, you do the secret knock and he opens the door and then anybody can go in. 257 00:19:09,740 --> 00:19:19,460 So once you've, you know, once you've unlocked the ECU or gotten into that session, then you can just kind of keep that session alive from a valid tester and then send whatever messages you want. 258 00:19:20,800 --> 00:19:22,640 So kind of snooping. 259 00:19:24,100 --> 00:19:28,180 So a valid session, you could hijack that and send kind of other things. 260 00:19:29,440 --> 00:19:35,380 So having access to these testers or if you're on the bus at the same time, it's kind of, you have lots of access there. 261 00:19:38,340 --> 00:19:39,420 Other attack vectors. 262 00:19:40,760 --> 00:19:42,100 A bootloader trojan. 263 00:19:42,300 --> 00:19:53,300 So, you know, there's ways to even gain persistence on an ECU by downloading a bootloader that overwrites the bootloader, right? 264 00:19:53,860 --> 00:19:57,840 There's products that do this for updating bootloaders. 265 00:20:00,360 --> 00:20:10,400 And essentially you program an application into the, as the new application has to look like a valid application and then it just overwrites your bootloader with its own bootloader. 266 00:20:10,600 --> 00:20:11,700 You might lose your keys. 267 00:20:11,920 --> 00:20:15,400 You might, you know, now you gain permanent persistence on the ECU. 268 00:20:17,640 --> 00:20:19,780 So what makes this even more scary? 269 00:20:21,940 --> 00:20:23,560 So before, for all of this, you had to have a bootloader. 270 00:20:23,580 --> 00:20:25,140 You have physical access to the vehicle, right? 271 00:20:26,100 --> 00:20:28,140 So it doesn't scale well. 272 00:20:28,300 --> 00:20:36,680 I can't physically walk to a thousand or a million different vehicles and start changing the firmware on them. 273 00:20:37,620 --> 00:20:38,860 But don't worry. 274 00:20:39,000 --> 00:20:43,260 Everyone solved this problem because now everyone wants to add over-the-air programming. 275 00:20:45,360 --> 00:20:47,620 So many OEMs are incorporating this. 276 00:20:48,780 --> 00:20:52,460 Implementing it just like a diagnostic tester that's connected to the Internet, right? 277 00:20:52,540 --> 00:20:52,680 Right. 278 00:20:52,680 --> 00:20:53,320 So depending. 279 00:20:53,580 --> 00:20:57,860 So depending on how secure that is, that can put in a lot of challenges, right? 280 00:20:58,480 --> 00:20:59,440 OTA is awesome. 281 00:20:59,860 --> 00:21:01,060 It's great for fixing bugs. 282 00:21:01,400 --> 00:21:02,340 We can add features. 283 00:21:02,560 --> 00:21:03,760 We can do security updates. 284 00:21:03,960 --> 00:21:12,180 It helps facilitate, you know, rolling out recalls, like fixing recalls and stuff because you can push these things out quickly. 285 00:21:16,480 --> 00:21:19,900 But OTA basically is remote code execution. 286 00:21:20,820 --> 00:21:22,760 And generally that's bad. 287 00:21:24,880 --> 00:21:26,620 In terms of a security model. 288 00:21:27,520 --> 00:21:32,660 So it's like, it's the savior, but it's also the thing that can really hurt us. 289 00:21:32,740 --> 00:21:33,640 It's kind of a two-edged sword. 290 00:21:36,100 --> 00:21:41,660 And it opens up some interesting challenges that we might not have had before. 291 00:21:42,040 --> 00:21:45,320 So attacks on, like, repositories itself. 292 00:21:46,460 --> 00:21:48,460 There's, you know, DEF CON's huge, right? 293 00:21:48,500 --> 00:21:51,160 There's all kinds of fun talks going on. 294 00:21:51,280 --> 00:21:53,300 And I'm sure somebody, maybe this year. 295 00:21:53,580 --> 00:22:04,340 Or certainly in previous years, we've talked about, like, repository attacks on updaters, like for Ubuntu and, you know, Windows Update and all that. 296 00:22:04,520 --> 00:22:06,320 Same thing with automotive, right? 297 00:22:06,340 --> 00:22:18,200 If we're doing OTA updates, it's opening up attack vectors for, you know, exfiltrating code, signing keys, you know, repository poisoning, things like that. 298 00:22:22,000 --> 00:22:23,480 Also, there's some challenges. 299 00:22:23,580 --> 00:22:32,460 There's some challenges in keeping OTA going because the car has intermittent connectivity. 300 00:22:32,960 --> 00:22:37,720 You know, if it's parked in a garage, it doesn't, you might not have access for who knows, right? 301 00:22:37,840 --> 00:22:41,920 Or somebody might park this car in a garage for 20 years and then turn it on. 302 00:22:41,980 --> 00:22:46,100 And now you have, you know, 6 million software updates. 303 00:22:46,240 --> 00:22:48,740 You can't drive your car for three weeks because it's downloading. 304 00:22:51,980 --> 00:22:53,420 And then, like, man in the middle. 305 00:22:53,440 --> 00:22:53,560 Type of thing. 306 00:22:53,580 --> 00:22:54,500 Type of tax to the vehicle. 307 00:22:54,720 --> 00:22:58,820 You know, it's literally a moving network, computer network. 308 00:22:59,020 --> 00:23:04,540 So, it's a really challenging IT problem to maintain this kind of infrastructure and securing all of that. 309 00:23:04,720 --> 00:23:11,120 So, there's a lot of new challenges that could prevent updates or pass bad information to the cloud or to the vehicle. 310 00:23:12,820 --> 00:23:20,520 And so, it kind of, it's pushing, you know, OEMs to have to really think about the full end-to-end lifecycle for updates. 311 00:23:22,480 --> 00:23:23,100 Oh, yeah. 312 00:23:23,100 --> 00:23:23,860 Yeah, and cars move. 313 00:23:24,100 --> 00:23:29,460 So, if you brick your phone, usually that's, you know, that's a bummer. 314 00:23:29,560 --> 00:23:36,640 But if you brick somebody's car and they're in the middle of, I don't know, the desert, they're not going to be particularly happy. 315 00:23:39,220 --> 00:23:42,200 There's also all kinds of, like, OTA attacks. 316 00:23:43,600 --> 00:23:52,060 So, there's a project called Optane that's doing, like, a security model framework for OTA attacks. 317 00:23:52,220 --> 00:23:53,020 And they've kind of enumerated. 318 00:23:53,020 --> 00:23:53,080 Okay. 319 00:23:53,080 --> 00:24:01,480 So, there's a whole bunch of different things, like malicious software attacks, you know, updating, trying to poison the cache with bad updates. 320 00:24:01,620 --> 00:24:08,180 Freeze attacks where you're stopping the, basically stopping the updates from happening by slowing it down. 321 00:24:08,400 --> 00:24:15,880 Or maybe you have, like, bad vulnerable software trying to get the ECU to roll it back to a bad version. 322 00:24:17,100 --> 00:24:22,140 There's a lot of challenges and lots of ways to, like, DOS the system. 323 00:24:22,140 --> 00:24:24,620 So, it's quite a big challenge. 324 00:24:28,720 --> 00:24:33,720 So, now that I've bummed everybody out, or maybe made them excited because maybe they're trying to hack cars. 325 00:24:34,380 --> 00:24:35,840 This is the car hacking village, right? 326 00:24:37,100 --> 00:24:40,300 So, what's the industry trying to do to make it more secure? 327 00:24:40,540 --> 00:24:45,120 And for people that don't care about that, that also means what might not be implemented right now. 328 00:24:46,880 --> 00:24:48,300 Things like code signing, right? 329 00:24:48,340 --> 00:24:50,420 Where I take a message digest. 330 00:24:50,780 --> 00:24:52,120 You're signing it with private key. 331 00:24:52,920 --> 00:24:54,080 Penning that to the data. 332 00:24:54,840 --> 00:24:59,900 And then verifying it on the ECU side. 333 00:25:00,240 --> 00:25:03,460 So, this is one of the, like, I mentioned that Optane project. 334 00:25:03,960 --> 00:25:16,180 This is one of the things that that project is really trying to, like, set up delegations for how you make a signature scheme for automotive really fault tolerant against different types of attacks. 335 00:25:16,700 --> 00:25:18,540 So, a lot of work being done there. 336 00:25:20,540 --> 00:25:21,200 Secure boot. 337 00:25:21,320 --> 00:25:22,060 Push and secure boot. 338 00:25:22,140 --> 00:25:27,640 You know, so this is like building a chain of trust to ensure the authenticity and integrity of code at startup. 339 00:25:28,760 --> 00:25:35,700 Small ECUs that have just like a, like a She module, which is like a small HSM. 340 00:25:37,140 --> 00:25:39,500 You know, these might have like a really simple secure boot. 341 00:25:39,640 --> 00:25:48,160 But if you get into like the systems on a chip, there's the main line talk, I think, yesterday about the Qualcomm firmware. 342 00:25:48,440 --> 00:25:51,200 And he showed like the Qualcomm firmware secure boot chain. 343 00:25:51,460 --> 00:25:51,900 Right. 344 00:25:52,140 --> 00:25:56,920 like, it was like 45 different things. So each one of these might have like, could have 345 00:25:56,920 --> 00:26:00,800 a vulnerability, right? And you have to try to protect that whole thing. So these can 346 00:26:00,800 --> 00:26:08,520 get really complicated and really, really tricky. And also who owns the keys for a 347 00:26:08,520 --> 00:26:13,680 secure chain as it becomes really complicated. Because it could be in automotive, we have 348 00:26:13,680 --> 00:26:21,480 this big, huge supply chain and different stakeholders might need to own different parts 349 00:26:21,480 --> 00:26:27,120 of it. So like an OEM might want to own some things, but the original equipment, like tier 350 00:26:27,120 --> 00:26:32,080 one supplier might also, you know, need a stake in it. So it's like, these things can get 351 00:26:32,080 --> 00:26:38,620 really complicated and they're hard to, they're tricky to really secure. But we're working 352 00:26:38,620 --> 00:26:47,120 on it. Another big thing, like this is, you know, what I work on all the time. Hardware 353 00:26:47,120 --> 00:26:51,460 security modules. So this is like hardware acceleration. So this is like hardware 354 00:26:51,480 --> 00:26:55,780 acceleration to help facilitate some of these things. So like I mentioned before, you know, 355 00:26:55,780 --> 00:27:01,060 you've got the seed key. So often one of the big problems with that is like really, really 356 00:27:01,060 --> 00:27:05,960 poor entropy on your seeds. So somebody might just implement, because we don't have like, 357 00:27:06,020 --> 00:27:09,800 there's no like real time clock. There's no, you know, good timers. You don't have a good 358 00:27:09,800 --> 00:27:15,140 source of entropy on these ECUs. So, you know, people would implement this like super 359 00:27:15,140 --> 00:27:21,460 awesome proprietary random drummer generator and, you know, it throws out four different 360 00:27:21,480 --> 00:27:27,340 random numbers or something. So it's really easy to replay these seeds. So hardware 361 00:27:27,980 --> 00:27:31,360 facilitated true random number generation, that really helps with certain things like that. 362 00:27:32,540 --> 00:27:40,700 Protected key storage. AES hardware acceleration for symmetric crypto or other symmetric crypto 363 00:27:40,700 --> 00:27:46,560 accelerators. Having public key crypto accelerators in there. Again, you know, the idea is 364 00:27:46,560 --> 00:27:51,460 to protect all the keys and also try to help accelerate some of these things. So, you know, 365 00:27:51,480 --> 00:27:57,720 we can do, enable things like real time authentication and encryption and message 366 00:27:57,720 --> 00:28:05,900 authentication and things like that. There's also things to like enable secure boot in 367 00:28:05,900 --> 00:28:12,480 hardware. One of the challenging things with this, though, is that there's not like a one spec 368 00:28:12,480 --> 00:28:19,880 to rule them all in automotive. So a lot of stuff is using like TPMs for, you know, like IOT or 369 00:28:21,480 --> 00:28:27,880 AT and, you know, traditional AT. In automotive there's this like baseline specification from 370 00:28:28,180 --> 00:28:37,540 the, this is like the hilarious German pun here. They called it the HISS she. So HISS is like the 371 00:28:37,540 --> 00:28:44,520 Hersteller Initiative software. It's like a consortia of like a bunch of German suppliers and 372 00:28:44,520 --> 00:28:51,460 OEMs. And they created this she spec which is a secure hardware extension. And it just defined a 373 00:28:51,480 --> 00:28:58,360 little bit of, like, certain things in hardware that they would, that they specified for security. 374 00:28:58,920 --> 00:29:05,260 And it's, it's kind of like a standalone peripheral. And so a lot of silicon vendors have 375 00:29:05,260 --> 00:29:11,460 implemented that. And have, have support for that. But OEMs are, you know, moving even beyond 376 00:29:11,460 --> 00:29:16,100 that. A lot of people need more keys or they need, you know, more specific stuff like a secure 377 00:29:16,100 --> 00:29:21,460 execution environment. There's a, there's another, there's another few years in the range of some of 378 00:29:21,460 --> 00:29:28,460 years later, a group in Europe called Aveda, it was like a government, EU sponsored consortia. 379 00:29:29,620 --> 00:29:33,780 And they came up with like another spec that kind of divided it up into like three different 380 00:29:34,560 --> 00:29:41,580 levels. So this low, medium, full Aveda spec. And so this is like the highest one, you know, 381 00:29:41,580 --> 00:29:49,000 has a secure code execution, a coprocessor and everything like that. So again, SOC inventors 382 00:29:49,000 --> 00:29:53,620 are like implementing stuff like that. Like we have one called ICUM for that. But other 383 00:29:53,620 --> 00:29:58,720 SOC inventors like NXP has the CSC, which is the cryptographic services engine and Finneon's 384 00:29:58,720 --> 00:30:04,860 got their own stuff. Arm has the Trust Zone. And, you know, there's been a bunch of talks 385 00:30:04,860 --> 00:30:09,240 on Trust Zone hacking stuff. So if you're interested in that, there's lots of information 386 00:30:09,240 --> 00:30:17,380 on Trust Zone stuff. So it's kind of a big challenge because there are so many different 387 00:30:17,380 --> 00:30:17,900 varieties. 388 00:30:18,040 --> 00:30:18,980 And I don't know if you've heard of it, but there's a lot of information on Trust Zone 389 00:30:18,980 --> 00:30:23,980 hacking stuff. There's no like just common, you know, API for, okay, here's the automotive 390 00:30:24,660 --> 00:30:34,660 API and spec for building this secure hardware as a chip vendor. So every OEM kind of just 391 00:30:34,660 --> 00:30:41,520 has their own flavor of how it works. So again, this is a challenge. But there's also committees 392 00:30:41,520 --> 00:30:47,080 that are working on kind of creating more common specs. There's an SAE group for that. 393 00:30:47,080 --> 00:30:53,040 And there's also an ISO group that's working on kind of like common security practices. 394 00:30:56,220 --> 00:31:05,480 Some more stuff. So ECU hardening. This is just like general security, good hygiene stuff. But, 395 00:31:05,520 --> 00:31:12,860 you know, you'd be surprised how often this doesn't happen. And most of the OEMs have specs 396 00:31:12,860 --> 00:31:17,060 now that say like, yeah, you have to lock the JTAG. But, you know, you have to lock the JTAG. 397 00:31:17,060 --> 00:31:22,300 Or, you know, tamper protection. Things like if the tamper protection is detected, it erases 398 00:31:22,300 --> 00:31:26,680 your keys out of the HSM. So even if somebody gains access, they can't get the keys out. 399 00:31:28,020 --> 00:31:35,580 Or can't use the, you know, can't use the thing. Again, good crypto hygiene. Don't use 400 00:31:35,580 --> 00:31:44,820 the same key across all of your cars like some OEMs have done. But, you know, this hardware 401 00:31:44,820 --> 00:31:46,620 stuff basically helps. 402 00:31:47,400 --> 00:31:53,080 Enable some of the higher level, like protocol level kind of security. Like doing authenticated 403 00:31:53,080 --> 00:32:02,520 CAN. So there's a thing called AUTOSAR, which is like a software and it's open standard software 404 00:32:02,520 --> 00:32:06,560 initiative or something. I've had it and I'm forgetting what it stands for. I should know 405 00:32:06,560 --> 00:32:16,600 that. Yeah. But anyway. It defines like a protocol for doing secure authentication. So 406 00:32:23,120 --> 00:32:23,440 it's like a protocol for doing, you know, something to confirm a security. You know, 407 00:32:23,440 --> 00:32:23,700 for a security that's not gonna be as well known or as well known for a car. So, you know, 408 00:32:25,540 --> 00:32:28,200 thing to do. So, you know, we've got the default OEMs. And then we have a little bit of 409 00:32:28,200 --> 00:32:29,440 authentication. So, if you have, you know, an OEM is a very common problem that people have. So, 410 00:32:29,980 --> 00:32:46,300 you know, there's a lot of options. And then there's also authentication. So if you have, you know, 411 00:32:46,300 --> 00:32:50,020 know, some signed piece of information that you can verify with a public key. 412 00:32:53,680 --> 00:33:00,060 So I'm going to do it on time. So on summary here, bootloaders give you powerful access 413 00:33:00,060 --> 00:33:09,600 to automotive ECUs. We started adding OTA to these things and it's making everyone's 414 00:33:09,600 --> 00:33:16,640 lives really difficult. But it's keeping us all employed, so that's good. It really 415 00:33:16,640 --> 00:33:22,140 opens up the attack service for remote exploitation. It's the enabler to be able to do updates 416 00:33:22,140 --> 00:33:27,260 and to push security patches and things like that, but it makes stuff extremely difficult. 417 00:33:27,660 --> 00:33:34,200 I think automotive vehicles is one of the most difficult things to do OTA on because 418 00:33:34,980 --> 00:33:38,680 it's this big thing that's moving that could smash into something. 419 00:33:40,400 --> 00:33:45,920 And then, of course, we're working on this. We're working on securing the ECUs, but are 420 00:33:45,920 --> 00:33:50,680 we doing it fast enough? Are we there yet? Of course, the answer is no. We're still working 421 00:33:50,680 --> 00:34:01,040 on that. It's improving incrementally, of course. So thank you. I really appreciate 422 00:34:01,040 --> 00:34:07,400 you guys taking your time to lose your happy hour drink prices and sit here and watch and 423 00:34:07,400 --> 00:34:07,860 listen to me. 424 00:34:10,080 --> 00:34:11,540 Thank you. 425 00:34:11,600 --> 00:34:12,200 Thank you.