1 00:00:00,000 --> 00:00:06,680 I'd like to introduce Philippe who is going to be talking to us about secure systems on a chip systems. 2 00:00:07,080 --> 00:00:09,900 And I'm really excited for this talk and I hope you are too. 3 00:00:09,900 --> 00:00:10,700 Philippe? 4 00:00:10,820 --> 00:00:11,480 Thank you. 5 00:00:12,320 --> 00:00:13,400 Hi, everyone. 6 00:00:16,860 --> 00:00:23,640 So, yeah, so today I'm going to talk about revolt and how you can get compromised by your secure system on chip. 7 00:00:24,340 --> 00:00:26,340 So, hi, I'm Philippe. 8 00:00:29,500 --> 00:00:30,360 I'm a senior software engineer. 9 00:00:30,360 --> 00:00:31,980 I work on Windows systems. 10 00:00:32,180 --> 00:00:36,720 And basically what I do is to look for vulnerabilities in third party software. 11 00:00:37,040 --> 00:00:45,220 And we find stuff, we report the stuff to the vendors and when everything is fixed, we publish reports and publish the research as I'm doing today. 12 00:00:45,320 --> 00:00:49,320 So, that's what it is about. 13 00:00:49,560 --> 00:00:52,200 What can you expect from today's presentation? 14 00:00:52,520 --> 00:00:55,040 It's a 45 minute talk. 15 00:00:55,040 --> 00:01:01,260 I'm going to go over some of the bugs we've reported to Dell and Broadcom like in the beginning of the year. 16 00:01:01,680 --> 00:01:04,200 Targeting something called control vaults. 17 00:01:04,240 --> 00:01:09,500 And all the bugs sit together, leads to like a full compromise of the system and we'll see like how that works. 18 00:01:10,300 --> 00:01:13,300 So, if you've never seen that before, it's a laptop, right? 19 00:01:13,300 --> 00:01:18,660 And here you have a fingerprint reader, an NFC card reader and a smart card reader. 20 00:01:18,660 --> 00:01:22,360 And all of those peripherals connect into a control vault. 21 00:01:22,540 --> 00:01:29,160 And if you look into the system panel in Windows, you can find this mysterious device called control vault. 22 00:01:29,380 --> 00:01:33,640 And you don't really know what it is, but you know, that's the point of this presentation. 23 00:01:34,060 --> 00:01:39,700 And if you open the laptop and remove the battery, you can find the control vault board like over here. 24 00:01:40,140 --> 00:01:44,660 You can see it's like covered in tape and you have just like a little like flash module that sticks out. 25 00:01:44,840 --> 00:01:47,860 And the various peripherals are like connected onto it. 26 00:01:48,960 --> 00:01:53,180 So, now you can be like, okay, control vault, what the hell is that, right? 27 00:01:53,900 --> 00:01:56,120 So, technically it's control vault 3. 28 00:01:56,700 --> 00:01:59,520 It can be found in like 100 models of the laptops. 29 00:01:59,560 --> 00:02:02,820 Mostly like the business lines, so like latitude and precisions. 30 00:02:03,960 --> 00:02:05,680 And that the board is there. 31 00:02:06,000 --> 00:02:09,040 It's a mix of software, firmware, hardware. 32 00:02:09,220 --> 00:02:11,460 You have Windows API, Linux API. 33 00:02:11,680 --> 00:02:18,140 You have like a firmware that like it's a real time OS that's running on this ARM chip here. 34 00:02:18,360 --> 00:02:22,200 And the chip is like a Broadcom 58202. 35 00:02:23,180 --> 00:02:23,980 Cool. 36 00:02:23,980 --> 00:02:26,600 And it's meant to be a secure storage of secrets. 37 00:02:26,600 --> 00:02:32,300 So, that little like flash module here is encrypted and it contains like the firmware and potential secrets. 38 00:02:32,880 --> 00:02:37,580 So, yeah, technically it's called USH for Unified Secure Hub. 39 00:02:37,580 --> 00:02:42,560 And the idea is like you connect like the peripherals I was mentioning before. 40 00:02:43,740 --> 00:02:45,320 Yeah, it's control vault 3. 41 00:02:45,320 --> 00:02:47,680 There is also the newer control vault 3 plus. 42 00:02:47,680 --> 00:02:50,080 You find that in some of the Dell Pro machines. 43 00:02:50,120 --> 00:02:52,640 It's also vulnerable to like all of my findings. 44 00:02:53,160 --> 00:02:57,980 And before that, you had control vault 2 and control vault, you know, like no number. 45 00:02:58,540 --> 00:03:06,200 The first control vault was 2010 and from my reversing, it looks like at least some of the vaults that I've reported were also present then. 46 00:03:07,300 --> 00:03:15,040 And yeah, control vault 3 and 3 plus estimate is in the tens of millions of devices that you can find like in Dell laptops. 47 00:03:15,740 --> 00:03:17,160 And there is no documentation. 48 00:03:17,200 --> 00:03:21,120 So, we're going to have to do some work here. 49 00:03:22,180 --> 00:03:24,140 So, step one, what can you do? 50 00:03:24,240 --> 00:03:25,860 Google stuff, right? 51 00:03:26,060 --> 00:03:33,900 And this one pops up eventually, which is the Linux implementation of the host APIs for the control vault device. 52 00:03:34,000 --> 00:03:38,400 And what is cool about it is that they compiled it with debug symbols. 53 00:03:38,420 --> 00:03:43,200 So, you can import the host API in IDA, Ghidra, whatever. 54 00:03:43,360 --> 00:03:47,980 And you will get a lot of data structures, enums, status codes. 55 00:03:48,020 --> 00:03:56,820 So, with all of that, it's really helpful for reversing because the same data structure that are used on the host are also going to be processed by the firmware itself. 56 00:03:58,520 --> 00:04:01,360 And the other one is kind of a weird one. 57 00:04:01,360 --> 00:04:05,360 It's a certification for the system on chip for like it's cryptography module. 58 00:04:05,360 --> 00:04:11,460 It doesn't give you much information, but kind of hints at the internals a little of what it can do. 59 00:04:11,460 --> 00:04:16,480 And it also gives some information about the values acronyms that are being used. 60 00:04:16,480 --> 00:04:24,720 For instance, here, SBI, for instance, stands for secure boot image, which is an extension of the boot ROM and should be trusted. 61 00:04:25,560 --> 00:04:26,180 Okay. 62 00:04:26,320 --> 00:04:28,960 So, why did I want to target that? 63 00:04:28,960 --> 00:04:34,360 You know, okay, it's hundreds of models of Dell laptops, you know, probably millions of devices affected. 64 00:04:34,360 --> 00:04:37,880 But really, like the beginning of that project were way more humble. 65 00:04:38,500 --> 00:04:45,660 I was looking at that, which is just, you know, process manager to see, you know, what's running on my system. 66 00:04:46,100 --> 00:04:48,300 And that one caught my attention. 67 00:04:48,300 --> 00:04:51,780 So, I was listing the stuff that have like ASLR enabled. 68 00:04:52,120 --> 00:04:54,880 And, you know, in 2025, everything should have ASLR. 69 00:04:54,880 --> 00:05:01,580 So, that's address space layout randomization, which is a common security mitigation to make, you know, like exploitation much harder. 70 00:05:01,820 --> 00:05:03,960 And it should be enabled everywhere. 71 00:05:03,960 --> 00:05:06,120 So, when it's not, that's kind of worrisome. 72 00:05:06,780 --> 00:05:12,420 And same like some of the DLL that are being used by that, also not ASLR enabled. 73 00:05:12,660 --> 00:05:16,380 And all of that is in the Broadcom services that talk with control box. 74 00:05:16,620 --> 00:05:20,880 So, I got really excited, you know, I started like healing, you know, through my windows. 75 00:05:20,880 --> 00:05:23,220 You know, it's like, let's freaking hack the planet, guys, you know. 76 00:05:23,220 --> 00:05:26,080 So, I was like really excited. 77 00:05:26,440 --> 00:05:30,400 And next step was like less exciting, which was like looking at files. 78 00:05:30,600 --> 00:05:35,760 So, extracting the installer and trying to understand what's in there, like what is control box, you know. 79 00:05:36,020 --> 00:05:37,480 And there's like so many files. 80 00:05:37,480 --> 00:05:42,680 You know, you have a driver, like USB driver, and then you have like all the peripherals of the drivers as well. 81 00:05:42,860 --> 00:05:47,760 There's like Windows services, there's like DLLs that nothing use, so like I don't even know why they're there. 82 00:05:48,440 --> 00:05:51,000 And then there's a firmware folder like full of files. 83 00:05:51,120 --> 00:05:53,880 And there's like a few that kind of like look interesting. 84 00:05:54,320 --> 00:05:58,380 So, we have like that famous like SBI that I was mentioning three slides ago. 85 00:05:58,620 --> 00:06:01,420 The secure boot image, which is like, you know, part of the boot process. 86 00:06:01,420 --> 00:06:02,820 And that was in clear text. 87 00:06:02,900 --> 00:06:06,660 So, you can import it in either, like whatever you want and look at it. 88 00:06:07,080 --> 00:06:11,500 And then there's that one called like Citadel, which turns out to be the application firmware. 89 00:06:11,500 --> 00:06:17,020 So, that's the main stuff you talk with like when in normal operations. 90 00:06:17,180 --> 00:06:19,120 But unfortunately, this one is encrypted. 91 00:06:19,400 --> 00:06:22,240 So, it's pretty sad that we have more work to do. 92 00:06:22,440 --> 00:06:24,340 But that's going to be fun, you know, challenge. 93 00:06:25,580 --> 00:06:32,600 Before we go too far, like just to give an idea of the system architecture, here we have the main firmware. 94 00:06:32,600 --> 00:06:33,440 That is like the boot ROM. 95 00:06:33,440 --> 00:06:34,420 That's the SBI. 96 00:06:34,420 --> 00:06:35,800 That's the main application. 97 00:06:36,200 --> 00:06:42,980 And on the left side, you know, it talks with all of those hardware peripherals, you know, the flash, the NFC reader, et cetera. 98 00:06:42,980 --> 00:06:44,940 Using, you know, like various buses. 99 00:06:45,260 --> 00:06:47,900 And on the right side, you have the host. 100 00:06:47,900 --> 00:06:49,280 So, like on our case, Windows. 101 00:06:49,620 --> 00:06:52,360 And it talks over USB with all stuff. 102 00:06:52,540 --> 00:06:58,100 And then inside, in the Windows side, you have like a USB driver that runs in kernel mode. 103 00:06:58,100 --> 00:07:05,440 And then user land, you have some control APIs and value services and other stuff that talk with the driver. 104 00:07:06,400 --> 00:07:07,060 Okay. 105 00:07:07,060 --> 00:07:10,560 So, if we want to talk with that board, what can we do? 106 00:07:10,560 --> 00:07:15,960 The way it works is the USB driver will create like a file device on Windows. 107 00:07:15,960 --> 00:07:24,900 And user land, like any regular user on Windows can open that device and send comments to it via IO control commands. 108 00:07:25,000 --> 00:07:28,580 And eventually, the driver will send USB packets to the firmware. 109 00:07:28,940 --> 00:07:38,140 But because it's mega tedious to do that by hand, you know, they have like a high level DLL that implements many high level functions. 110 00:07:38,340 --> 00:07:40,260 Those are called like CV commands. 111 00:07:40,260 --> 00:07:46,360 And you have like CV open, CV closed, CV create object, delete object, get object, you know, tons of that. 112 00:07:46,360 --> 00:07:48,800 I think there is like 150 different commands. 113 00:07:48,800 --> 00:07:50,800 So, it's a huge attack surface. 114 00:07:51,740 --> 00:07:56,460 And they need a session handle and you get that with like CV open. 115 00:07:57,640 --> 00:08:05,140 And on the other side of that, on the firmware, you have like a handler that's going to receive those commands and dispatch them to the proper implementation. 116 00:08:05,140 --> 00:08:08,400 So, it's called CV manager or CV manager SBI. 117 00:08:08,540 --> 00:08:13,200 And all of that is clearly like an attack surface you want to mess with, you know. 118 00:08:15,020 --> 00:08:21,760 But before we do that, let's, this is like a quick little example on how to communicate with the firmware like by hand. 119 00:08:22,020 --> 00:08:23,080 Kind of. 120 00:08:23,080 --> 00:08:25,200 So, it's like a little Python script I wrote. 121 00:08:25,420 --> 00:08:29,400 Here, you just use C types to load the API DLL. 122 00:08:29,680 --> 00:08:32,660 And then you define the function that you want to talk with. 123 00:08:32,660 --> 00:08:36,480 In particular, like what are the arguments and the return value. 124 00:08:36,640 --> 00:08:40,680 And for that, you can use the symbols you got from the Linux version of it. 125 00:08:40,700 --> 00:08:42,220 And then you just call it. 126 00:08:42,460 --> 00:08:44,420 And for instance, the result is that. 127 00:08:44,420 --> 00:08:46,700 This 20 lines of code is you will get that. 128 00:08:46,860 --> 00:08:53,420 So, with 20 lines of Python, you can talk with these devices in your laptop that does some crazy stuff. 129 00:08:53,420 --> 00:08:54,260 So easy. 130 00:08:54,660 --> 00:08:58,260 I was going to publish a tool about how to do that better, but I ran out of time. 131 00:08:58,260 --> 00:09:00,480 So, for now, you only get that one slide. 132 00:09:00,580 --> 00:09:01,640 Sorry about that. 133 00:09:02,920 --> 00:09:03,460 Yeah. 134 00:09:03,460 --> 00:09:05,460 Now, we know how to talk with it. 135 00:09:05,460 --> 00:09:06,980 We want to like mess with it, right? 136 00:09:06,980 --> 00:09:08,640 So, a little of that modeling. 137 00:09:08,860 --> 00:09:12,800 Back to the model, the system model. 138 00:09:13,240 --> 00:09:17,620 I see that kind of like four main attack surfaces that I was considering. 139 00:09:17,860 --> 00:09:20,300 One is the main firmware stuff, you know. 140 00:09:20,300 --> 00:09:25,480 So, the SBI and the application firmware, you know, they have a USB implementation. 141 00:09:25,660 --> 00:09:28,480 They receive like this high level CV commands. 142 00:09:28,480 --> 00:09:31,180 And then there's more interaction with like all of the services. 143 00:09:31,300 --> 00:09:33,660 So, all of that is like super interesting to target. 144 00:09:34,540 --> 00:09:43,540 Then, the firmware itself lives in something called like secure boots, which is meant to prevent, you know, unauthorized tampering with the firmware. 145 00:09:43,640 --> 00:09:47,980 And for that, you know, you're going to have like some secure firmware update mechanism, some signature checks. 146 00:09:48,040 --> 00:09:49,760 And that's something we also want to look at. 147 00:09:50,600 --> 00:09:53,000 Then we have all the Windows services here. 148 00:09:53,000 --> 00:09:58,700 So, originally I was just like, oh, I want to mess with that driver to maybe get an elevation of privilege on Windows. 149 00:09:59,220 --> 00:10:01,140 But, you know, that's one angle. 150 00:10:01,140 --> 00:10:04,080 But then you have like all the services, you know, all of that is really interesting. 151 00:10:04,500 --> 00:10:09,420 And finally, something that I'm not going to talk about today, but I wanted to highlight it. 152 00:10:10,060 --> 00:10:15,620 There is that side where like all the physical peripherals talk with the firmware as well. 153 00:10:15,620 --> 00:10:17,580 And so it's kind of a funny question to ask. 154 00:10:17,580 --> 00:10:22,400 Like, could a malicious, you know, smart card reader or fingerprint reader could mess with the firmware? 155 00:10:22,540 --> 00:10:26,320 Or could a malicious firmware mess with the fingerprint reader or smart card reader? 156 00:10:26,760 --> 00:10:28,860 Those are really exciting questions. 157 00:10:28,860 --> 00:10:33,500 But trying to answer them in that project would like 10X the scope of it. 158 00:10:33,500 --> 00:10:35,080 And I was like, okay, I don't have time for that. 159 00:10:35,080 --> 00:10:37,160 But, you know, it's fun to explore. 160 00:10:38,360 --> 00:10:45,240 And just to double down on the secure boot like architecture, like that's kind of like a really high level overview of how that works. 161 00:10:45,240 --> 00:10:53,700 You have the boot from that verified SBI's and then the SBI gets some key material from something called a secure code descriptor. 162 00:10:53,700 --> 00:10:57,380 And then it will be used to like start the application firmware. 163 00:10:57,420 --> 00:11:03,760 And during a firmware update, all of that gets kind of like, can be modified and get, need to be verified. 164 00:11:03,760 --> 00:11:06,540 And we kind of see like, how does that work? 165 00:11:07,900 --> 00:11:10,240 And, okay, we want to hack stuff. 166 00:11:10,240 --> 00:11:13,360 So let's talk about mitigations to like make it harder for us. 167 00:11:13,360 --> 00:11:17,160 So have we seen, the Broadcom services don't come with ASLR. 168 00:11:17,240 --> 00:11:21,880 But they come with DEP for data execution prevention. 169 00:11:22,420 --> 00:11:26,960 So basically you cannot just like jump on the stack and execute everything. 170 00:11:26,960 --> 00:11:28,320 You know, it's not the 90's. 171 00:11:28,480 --> 00:11:33,460 And there is like something called stack cookie to make stack overflow exploitation harder. 172 00:11:34,540 --> 00:11:37,840 And in that case, like sometimes it presents, sometimes it's not. 173 00:11:37,840 --> 00:11:40,560 So it really depends on the complexity of the function. 174 00:11:40,640 --> 00:11:45,700 It's kind of already weird because, you know, you should put it everywhere and, you know, but not the case here. 175 00:11:46,280 --> 00:11:50,140 And on the firmware side, there's like one really cool feature. 176 00:11:50,480 --> 00:11:57,120 It is the, the firmware is executed in place in the flash chip and it is encrypted. 177 00:11:57,120 --> 00:12:01,400 So you can, you know, decrypt and execute the firmware like in one go, which I think is really cool. 178 00:12:01,660 --> 00:12:05,540 And then you also have potentially the secure boots between quotes. 179 00:12:05,540 --> 00:12:07,320 So, you know, a bit of foreshadowing here. 180 00:12:08,660 --> 00:12:17,060 And then there is no ASLR, no stack cookie, meaning that if you can get memory corruption, like a stack overflow or something, it's going to be really easy to exploit stuff. 181 00:12:17,680 --> 00:12:19,760 DEP is a bit of a question mark. 182 00:12:19,760 --> 00:12:23,160 If you try to jump on the stack, for instance, it's going to crash. 183 00:12:23,600 --> 00:12:31,120 But there's also read, there and then jump there and it's done. 184 00:12:31,120 --> 00:12:36,300 So if you can get memory corruption bugs, it's pretty much like done from there. 185 00:12:37,200 --> 00:12:37,820 Okay. 186 00:12:37,820 --> 00:12:39,340 So now we have an idea of the system. 187 00:12:39,340 --> 00:12:41,580 Let's try to like reverse stuff a little. 188 00:12:41,940 --> 00:12:48,460 The point was the application firmware is encrypted and we want to like decrypt it. 189 00:12:48,460 --> 00:12:53,180 But we are only angle here is like looking at the SBI first. 190 00:12:53,300 --> 00:12:58,580 So, yeah, as I said, we want to look for firmware decryption routines. 191 00:12:58,740 --> 00:13:01,020 And for that, we can look for strings. 192 00:13:01,440 --> 00:13:06,420 And that things pop up, which is like a lot of like sad failure about decryption. 193 00:13:06,420 --> 00:13:11,680 But the failure of that thing is our success because that points us to where like decryption happens. 194 00:13:12,100 --> 00:13:17,780 And in practice, the way it works, like doing firmware updates, it's like a three step process. 195 00:13:17,840 --> 00:13:23,760 And you can find out like if you reverse the upgrade service on Windows or like one function in the Linux version. 196 00:13:24,260 --> 00:13:29,020 And so, the host is going to send a field upgrade start command. 197 00:13:29,360 --> 00:13:37,760 And with that, it's going to provide an encrypted header for the firmware that's going to get decrypted and verified like cryptographically verified. 198 00:13:37,980 --> 00:13:44,140 But if there is no key present, it's going to use some hard-coded credential defaults, hard-coded keys. 199 00:13:44,540 --> 00:13:51,860 And then it's going to generate new key material for the storage of the firmware like on the flash chip. 200 00:13:51,860 --> 00:13:54,640 So every time you reinstall the thing, it's regenerate those keys. 201 00:13:55,520 --> 00:14:00,880 Then the second step is like the update command that keeps sending blobs of encrypted firmware. 202 00:14:00,880 --> 00:14:02,440 And that gets decrypted. 203 00:14:02,440 --> 00:14:07,420 The one gotcha here, it's using a weird IV for the encryption mechanism. 204 00:14:07,420 --> 00:14:09,000 And we'll see that in a few slides. 205 00:14:09,240 --> 00:14:19,120 And finally, when the whole firmware has been sent, it calls, like the host calls the complete command that will verify the signature and commit everything to flash. 206 00:14:19,280 --> 00:14:20,920 Or what remains to be committed. 207 00:14:21,420 --> 00:14:23,260 In practice, it looks like that. 208 00:14:23,260 --> 00:14:30,480 In certain situation, the key material is going to be loaded into that SCD stuff I was talking about. 209 00:14:30,480 --> 00:14:32,540 It's just like default key and default IV. 210 00:14:32,820 --> 00:14:39,460 And that's going to be used to decrypt, to be fed that USH decrypt function. 211 00:14:39,720 --> 00:14:47,720 And if we look into the USH decrypt function, it turns out it's just a wrapper around the cryptographic module APIs. 212 00:14:47,820 --> 00:14:49,380 So we don't really know what it does. 213 00:14:49,620 --> 00:14:52,560 But you can see here it's using the key we've seen just before. 214 00:14:53,020 --> 00:14:57,660 But it's not a big deal that we don't know which algorithm it does because there's only so many. 215 00:14:57,740 --> 00:15:06,340 So what we can do is a bit of trial and error by taking the encrypted header and just trying to decrypt it with different stuff. 216 00:15:06,600 --> 00:15:13,880 And it turns out like ASCBC with the actual default key and IVs we've seen, will get you something decrypted. 217 00:15:15,640 --> 00:15:24,600 And the one gotcha here is like the SCD may have different endianness so the byte order might swap depending on stuff. 218 00:15:24,600 --> 00:15:27,220 So it might be a problem sometimes. 219 00:15:28,200 --> 00:15:30,400 So we decrypted the header. 220 00:15:30,400 --> 00:15:35,280 Now we really want to decrypt the whole firmware , you know, just not just the beginning. 221 00:15:35,480 --> 00:15:38,100 And for that, that's the update command. 222 00:15:38,100 --> 00:15:44,460 And we can see here you have that while loop that's going to keep decrypting, you know, like blobs, like junk of the firmware. 223 00:15:44,660 --> 00:15:49,260 And it's like the same stuff except that it's using this like custom like IV command. 224 00:15:49,260 --> 00:15:54,340 So the vector, initialization vector of the, for the ASCBC. 225 00:15:54,860 --> 00:15:56,520 And the function looks like that. 226 00:15:56,520 --> 00:16:04,820 So you can just copy paste that either in Visual Studio or like Python and this way it generates the proper IV for you. 227 00:16:04,860 --> 00:16:12,320 And the idea is it will take the address, the mapping address of that chunk of flash. 228 00:16:12,320 --> 00:16:17,640 So, you know, if it's loaded as whatever address in firmware that would be the input for that function. 229 00:16:18,200 --> 00:16:25,860 And so we implement the whole stuff and we run the algorithm ourselves and we successfully decrypt the application firmware. 230 00:16:25,920 --> 00:16:28,820 And I just run strings on it to kind of showcase that. 231 00:16:29,280 --> 00:16:30,080 Cool. 232 00:16:30,200 --> 00:16:37,040 So now we can import the application firmware in IDA and start looking for vulns. 233 00:16:37,400 --> 00:16:39,640 But what vulns do we look for? 234 00:16:39,780 --> 00:16:47,560 As I said, all the CV, most of the CV commands except, expect, sorry, a handle, like a session handle. 235 00:16:47,560 --> 00:16:49,060 And so you have to open a session. 236 00:16:49,220 --> 00:16:52,520 And that's a function that does it. 237 00:16:52,780 --> 00:16:55,900 But in practice , that's firmware side. 238 00:16:56,200 --> 00:17:00,140 What the firmware does when you call that is it's going to allocate memory. 239 00:17:00,560 --> 00:17:06,880 Going to write like a session tag, like, you know, the letter S-E-S-S in that memory. 240 00:17:07,040 --> 00:17:10,200 And then just return that pointer as a session handle. 241 00:17:10,200 --> 00:17:18,540 So it's kind of really funky already because straight out of the gates, like, the API is leaking like heap addresses back to the user. 242 00:17:18,580 --> 00:17:22,420 You know, they could have used like random number or something to identify a session . 243 00:17:22,420 --> 00:17:27,440 But here is like straight out the heap address of the decision is the handle. 244 00:17:27,640 --> 00:17:29,940 So that's curious but, you know, sure. 245 00:17:30,960 --> 00:17:36,920 And then what we can do also, you know, you open the session, you're a good boy, you close the session too, you know. 246 00:17:37,200 --> 00:17:40,820 And for that you provide the handle which is a pointer. 247 00:17:41,140 --> 00:17:43,140 And it's going to validate the session. 248 00:17:43,260 --> 00:17:50,060 And to do that, it's going to make sure it's within the range of the heap, you know, because that's memory address that you're sending. 249 00:17:50,140 --> 00:17:52,840 And then it's going to look for the session tag. 250 00:17:52,920 --> 00:17:53,980 And that's pretty much it. 251 00:17:53,980 --> 00:17:56,040 There's a few extra checks that are like irrelevant. 252 00:17:56,600 --> 00:18:01,280 And when you pass the check, it erases the tag and free the memory. 253 00:18:01,520 --> 00:18:02,660 So far so good. 254 00:18:02,660 --> 00:18:09,860 But, you know, if you like to play CTF, you know, you have a bit of CTF brain rot, you might be like, it looks like fragile, you know. 255 00:18:09,880 --> 00:18:13,540 And, you know, my question was like, do we have like an arbitrary free here? 256 00:18:13,560 --> 00:18:19,220 Because really the only check is if the first four bytes of whatever pointer you provide is SESS. 257 00:18:19,220 --> 00:18:24,020 So if we can place that in the heap, you could free something that's not a session. 258 00:18:25,180 --> 00:18:26,600 But can it be done? 259 00:18:27,420 --> 00:18:28,780 Yes, it can be. 260 00:18:29,120 --> 00:18:36,200 So you have that function, CV create object that take, you know, a blob of data, a size, and it will put it on the heap for you. 261 00:18:36,360 --> 00:18:41,220 That being said, you don't control all of the metadata of those objects. 262 00:18:41,220 --> 00:18:45,420 And also, you get a handle to that object. 263 00:18:45,420 --> 00:18:51,040 And that one is not the address like for the session, but it's like some random value that, you know, ties to the object. 264 00:18:51,180 --> 00:18:56,120 So we can place data on the, on the heap, but we don't know quite know where it is. 265 00:18:56,200 --> 00:18:58,840 But still, you know, we have arbitrary data on the heap. 266 00:18:59,140 --> 00:19:01,580 So now we want to locate that data. 267 00:19:01,940 --> 00:19:05,080 And for that, uh, I picked one of the CV function. 268 00:19:05,240 --> 00:19:10,380 Uh, CV get random that, you know, meant to return random data from the cryptography module. 269 00:19:10,580 --> 00:19:16,020 But in our case, it takes the session, check if it's valid or not, you know, using the same function as before. 270 00:19:16,340 --> 00:19:21,580 And whether or not it's valid, we'll return either like invalid session or do it stuff. 271 00:19:21,940 --> 00:19:24,920 But with that, we really have a session oracle. 272 00:19:24,940 --> 00:19:29,580 Like we can just, you know, ask CV get random, here's a pointer to the heap. 273 00:19:29,580 --> 00:19:31,160 Is it a real, real session or not? 274 00:19:31,160 --> 00:19:33,000 And it will tell you there's no side effect. 275 00:19:33,020 --> 00:19:36,380 And it takes like, I don't know, like 30 seconds to swipe the whole heap. 276 00:19:36,540 --> 00:19:38,500 So with that, we can locate objects. 277 00:19:39,100 --> 00:19:43,280 So to kind of summarize that, CV create object lets you place it on the heap. 278 00:19:43,280 --> 00:19:48,440 Get object and set object, uh, not on the slides, but lets you read and write your object data. 279 00:19:48,580 --> 00:19:51,200 Get random lets you find, you know, your object on the heap. 280 00:19:51,200 --> 00:19:55,840 And CV close lets you, uh, free, um, something that looks like a session. 281 00:19:55,840 --> 00:19:59,460 So with all of that, yes, we do have an arbitrary free in the heap. 282 00:20:00,380 --> 00:20:04,760 Uh, so are we going to do some cray cray, uh, exploitation, heap exploitation? 283 00:20:05,420 --> 00:20:09,200 That's, that's me when I have to learn, you know, a new, uh, heap implementation. 284 00:20:09,760 --> 00:20:12,400 Uh, so I was like, okay, let's, let's put a pin on that. 285 00:20:12,700 --> 00:20:14,960 And let's just find more bugs, right? 286 00:20:15,380 --> 00:20:24,940 Um, and so let me introduce you a different function called, uh, secure bio identify, which is also a CV command even if it doesn't have CV in the name. 287 00:20:25,000 --> 00:20:27,700 So you can reach it from, you know, user land. 288 00:20:27,760 --> 00:20:29,920 And it takes a handle to an object. 289 00:20:30,080 --> 00:20:43,540 And then what it does, uh, copy the properties of the object or which of them and then mem copy, uh, one of those property into this data to buffer and data to is really just like a stack variable. 290 00:20:43,600 --> 00:20:48,000 So here I was like, oh shit, do I have like a stack overflow, like just like that. 291 00:20:48,540 --> 00:20:54,260 Um, so to do that, we would need to be able to control that specific field. 292 00:20:54,380 --> 00:20:56,500 Uh, and it turns out, no, you can't. 293 00:20:56,500 --> 00:21:01,860 Uh, at least there is like some protection and you don't have the control of that, at least in the easy way. 294 00:21:02,100 --> 00:21:08,440 But that does not matter because we've just seen we can mess with the heap and so we can mess with the objects on the heap. 295 00:21:09,020 --> 00:21:15,700 And so to do that, we're going to, uh, overlap two objects and use one to modify the other. 296 00:21:15,780 --> 00:21:18,740 So here's kind of like a beautiful diagram I made. 297 00:21:18,980 --> 00:21:22,600 Um, it's not a one to one representation but to give the idea. 298 00:21:22,640 --> 00:21:29,220 So there will be like one of those objects created by, uh, CV create object where we already put the session tag in it. 299 00:21:29,220 --> 00:21:33,700 And purple is like what you can control and blue is what you cannot control. 300 00:21:33,760 --> 00:21:36,180 Not one to one but just to simplify. 301 00:21:36,860 --> 00:21:43,300 Uh, we can call CV free, CV close to, you know, free that session and it's going to poke a hole inside the object. 302 00:21:43,520 --> 00:21:50,420 And then we can allocate a smaller object that, you know, is meant to fit inside, you know, the hole we just poked. 303 00:21:50,420 --> 00:21:56,340 And by the way the heap management works, it's going to be placed, you know, inside the, uh, bigger object. 304 00:21:56,340 --> 00:22:00,540 So we kind of like overlapped two objects which, you know, not meant to happen. 305 00:22:01,000 --> 00:22:08,220 And with that, oh yeah, what we can do, you can see here purple is, you know, something we can control and blue is something we shouldn't be able to control. 306 00:22:08,360 --> 00:22:18,920 But because they overlap we can, um, we can modify the content of the large object which really is going to modify the metadata of the small object which we're not supposed to do. 307 00:22:18,980 --> 00:22:26,960 And then we're going to feed the small object into secure bio identify and this time we actually trigger the stack overflow. 308 00:22:27,380 --> 00:22:33,900 And because I said there is pretty much no security mitigation, it means we really can now execute code, uh, inside the firmware. 309 00:22:34,000 --> 00:22:36,520 But the question is what do we want to do now? 310 00:22:36,520 --> 00:22:38,860 Like what kind of stuff would we want to execute? 311 00:22:39,340 --> 00:22:42,620 And so I have like kind of two, uh, cool ideas. 312 00:22:42,680 --> 00:22:53,840 One is you can just, you know, run your exploits and any data that you would want your exploit to return to you, you can, uh, make it return inside the large object, you know, in a different area of it. 313 00:22:53,980 --> 00:22:58,120 And then you can use CV get object to retrieve that data. 314 00:22:58,140 --> 00:23:03,840 And so this way you have kind of a two way communication with your, um, with your exploit. 315 00:23:03,840 --> 00:23:08,520 Uh, which is pretty neat because with that you can, you know, make it dump RAM content. 316 00:23:08,520 --> 00:23:11,520 So like if there's like key material in the RAM you can retrieve that. 317 00:23:11,520 --> 00:23:15,060 The boot from that's, you know, like kind of critical to the security of it. 318 00:23:15,500 --> 00:23:16,640 It's pretty fun. 319 00:23:16,800 --> 00:23:22,340 But there is a function, uh, you're not supposed to be able to access it, but because we can run code we can now. 320 00:23:22,660 --> 00:23:24,600 It's called SOTP read key. 321 00:23:24,600 --> 00:23:29,520 And it basically, uh, retrieve key material from the fuse of the system on chip. 322 00:23:29,880 --> 00:23:31,800 And that's for like key material. 323 00:23:31,800 --> 00:23:36,320 And clearly like retrieving secret key material from our chip is something that sounds cool. 324 00:23:36,780 --> 00:23:38,260 Uh, so that's the one angle. 325 00:23:38,260 --> 00:23:50,000 And the other that, uh, won't be developed further today, but, um, we can, uh, patch memory addresses, um, that are like function pointers, you know, like V table for like some object and devices and so on. 326 00:23:50,000 --> 00:23:57,860 And with that idea we can redirect a code execution flow from, you know, a legitimate function into some payload we would have placed in memory. 327 00:23:57,900 --> 00:24:03,920 And this way we can tamper with the firmware in a baby steps toward like firmware modification. 328 00:24:04,180 --> 00:24:08,800 And it's, I'm just not talking about it today because I have better coming up. 329 00:24:09,320 --> 00:24:11,380 Uh, overshadowing again. 330 00:24:11,780 --> 00:24:19,820 Um, so yeah, first demo, uh, I'm just, uh, going to run the, uh, the attack to leak the keys as I, as I've described. 331 00:24:20,040 --> 00:24:22,020 So hopefully you guys can see. 332 00:24:22,260 --> 00:24:29,920 Uh, the process is, uh, first we use the CV get random to locate existing sessions because, you know, the board is being used. 333 00:24:30,300 --> 00:24:32,920 And then we forge a new one and we free it. 334 00:24:32,920 --> 00:24:38,700 We overlap the object, uh, set up the, the exploits to call, uh, SOTP red key. 335 00:24:38,700 --> 00:24:40,260 And actually we do it twice. 336 00:24:40,320 --> 00:24:45,200 And with that we, uh, we leaked an HMAC key and an AES key. 337 00:24:45,200 --> 00:24:47,480 Uh, those are like for my device. 338 00:24:47,480 --> 00:24:50,100 So, you know, it's okay if I put them on the slides, you know. 339 00:24:50,160 --> 00:24:52,240 Uh, but those are like pretty important. 340 00:24:52,240 --> 00:24:54,280 And that's why you should ask like keys. 341 00:24:54,280 --> 00:24:56,180 What kind of keys do you talk about? 342 00:24:56,820 --> 00:24:58,540 So, thank you. 343 00:24:59,200 --> 00:25:03,680 Uh, so there is like seven, um, fuses, like key slots on the chip. 344 00:25:04,780 --> 00:25:10,140 And two of them are the one we just leaked, uh, that are used to, uh, secure storage in the flash. 345 00:25:10,140 --> 00:25:14,140 So when I said, you know, flash is encrypted, could be with that. 346 00:25:14,580 --> 00:25:21,360 And it's also used for, uh, the secret code, the secure code descriptor that, you know, we've seen in some of the slides early. 347 00:25:21,760 --> 00:25:30,200 The secure code descriptor contains an RSA key that is used during firmware updates to verify the signature of the firmware updates. 348 00:25:30,400 --> 00:25:37,240 And also the AES and HMAC key that were used for the execution in place, uh, but that one gets updated every time you do a firmware update. 349 00:25:37,380 --> 00:25:46,760 And finally, as I've said, uh, there's also the hard-coded defaults, uh, that are actually being used if the SCD is, uh, missing. 350 00:25:47,160 --> 00:25:52,060 And now a question you can ask is like, how do you lose that SCD stuff that you keep talking about? 351 00:25:52,200 --> 00:25:54,460 Well, there's a very, uh, simple explanation. 352 00:25:54,620 --> 00:25:57,500 There's that file called, uh, clear SCD dot bin. 353 00:25:57,500 --> 00:26:01,200 And, uh, I don't know if you can see, but it's like zero one two F a bunch of times. 354 00:26:01,200 --> 00:26:06,800 And it's used legitimately during firmware updates to reboot in, uh, secure boot image mode. 355 00:26:06,800 --> 00:26:14,540 So basically the host flashed that file in, over the legitimate SCD and reboot. 356 00:26:14,540 --> 00:26:21,440 And, uh, to flash it, it's using that beautiful function called CVFlashUpdate that once again any user can call. 357 00:26:21,940 --> 00:26:26,640 And you reboot and then the SBI is kind of like that, like confused. 358 00:26:26,860 --> 00:26:30,880 And we're like, okay, we need to wait for, you know, proper firmware updates. 359 00:26:31,000 --> 00:26:39,080 But the thing that's crazy here is that CVFlashUpdate is literally giving you an arbitrary flash write, like from user land. 360 00:26:39,080 --> 00:26:40,980 You don't need any privilege to do that. 361 00:26:41,080 --> 00:26:44,420 The one gotcha here is like everything should be encrypted. 362 00:26:44,620 --> 00:26:48,540 And so, you know, but we leaked the keys that are used to encrypt it. 363 00:26:48,540 --> 00:26:58,640 So that's pretty cool in a way, like a good spot to kind of like asking the question, how secure is the boot process now that, you know, we have leaked critical keys, you know? 364 00:26:59,120 --> 00:27:03,580 So revisiting the secure boot process was a little more like details. 365 00:27:03,880 --> 00:27:17,080 The way it works, the boot ROM verified the SBI's and then the SBI's get the keys, you know, the fuse keys from OTP memories and decrypt the secure code descriptor that contains the RSA keys, AES, HMAC, et cetera. 366 00:27:17,140 --> 00:27:19,640 Populates the execution in place and starts that. 367 00:27:19,740 --> 00:27:24,740 But critically, there is no signature check of the application firmware during boot. 368 00:27:24,740 --> 00:27:30,420 The whole security of it depends on, you know, that being secure and therefore that being secure. 369 00:27:30,420 --> 00:27:32,880 But we just broke that and we can mess with that. 370 00:27:32,880 --> 00:27:35,580 So that's, you know, a little worrisome. 371 00:27:38,640 --> 00:27:44,100 So yeah, with that we can do some, can we do some firmware modification? 372 00:27:44,340 --> 00:27:46,420 So we can dump the device keys. 373 00:27:46,560 --> 00:27:49,200 We can retrieve the SID content and decrypt it. 374 00:27:49,240 --> 00:28:00,440 But then that's why it gets a little messy because to modify the execution in place code, we'd have to forge, you know, to encrypt flash blobs and also sign them with HMAC key and et cetera. 375 00:28:03,960 --> 00:28:06,500 And it's a good way to break your device, you know. 376 00:28:06,500 --> 00:28:09,320 So it's like, I don't want to try that, you know, a little risk adverse. 377 00:28:09,960 --> 00:28:12,580 And instead, I was like, okay, we can be a little more crafty. 378 00:28:12,660 --> 00:28:17,120 We can forge our own SID, you know, and also encrypt it and HMAC it properly. 379 00:28:17,120 --> 00:28:23,180 But we're going to put our own RSA key in it so that we can sign our own firmware image updates. 380 00:28:23,340 --> 00:28:26,780 And it's going to get accepted because it's using, you know, all key material. 381 00:28:27,620 --> 00:28:30,500 And yeah, with that, did it work? 382 00:28:30,580 --> 00:28:32,420 No, it did not. 383 00:28:33,820 --> 00:28:38,440 So as I said, you know, I fucked up the NDS of the SID. 384 00:28:38,440 --> 00:28:43,380 So I flashed, you know, kind of the wrong byte order and it just, the device just stopped working. 385 00:28:43,380 --> 00:28:47,100 And here it's like me trying to fix it with a flash programmer. 386 00:28:47,320 --> 00:28:53,260 I was, you know, I knew that could happen so I made a backup of the flash before doing it and that proved to be useful. 387 00:28:53,500 --> 00:29:03,000 But then, you know, I put the computer back together like it was restored and I flashed the right SID that, you know, with the right byte order and it worked. 388 00:29:03,040 --> 00:29:09,320 This time, you know, like, I don't know if you guys can see but now it's calling itself Control Pwned, you know, because I'm 12. 389 00:29:09,920 --> 00:29:14,840 And that's, you know, sent from the, the firmware over USB to Windows. 390 00:29:15,300 --> 00:29:16,440 So that's cool. 391 00:29:16,440 --> 00:29:28,120 The application firmware was actually modified and that one, you know, it's a persistent modification that even if you reinstall Windows, you do whatever, like it's modified and, you know, you'd have to reinstall the firmware to change it. 392 00:29:28,760 --> 00:29:30,400 So, yeah, that's opened. 393 00:29:30,520 --> 00:29:31,420 Thank you. 394 00:29:32,560 --> 00:29:39,040 So, so that one, yeah, opened the, the door to a payment implant. 395 00:29:40,440 --> 00:29:42,120 So, that's cool. 396 00:29:42,120 --> 00:29:43,840 But what can we do with that? 397 00:29:44,080 --> 00:29:48,180 You know, how is the unified secure hub, how secure is it? 398 00:29:48,300 --> 00:29:50,260 So I have this cool cute demo. 399 00:29:50,420 --> 00:30:02,160 There is that function, uh, CV fingerprint identify that is used by, uh, Windows Halo when your computer is locked and but you've set it up so that you can, uh, unlock it with your fingerprints. 400 00:30:02,280 --> 00:30:17,860 The, the Halo is going to talk with, you know, some driver, driver or whatever, which will talk with the firmware and call that function and ask, oh, does the fingerprints, you know, on the reader match any of those recorded handles that we have? 401 00:30:18,220 --> 00:30:21,640 And so the question is like, can we make it say yes every time? 402 00:30:22,020 --> 00:30:24,840 You know, that would be really nice, right? 403 00:30:25,400 --> 00:30:26,440 So I tried that. 404 00:30:26,440 --> 00:30:31,600 I modified the CV fingerprint identify function, uh, and it looks like that. 405 00:30:31,680 --> 00:30:38,220 Uh, and just for context, that's a, a plastic finger that I got at Defcon last year, like at the 503 party. 406 00:30:38,280 --> 00:30:47,980 So I wanted to shout out to, uh, Magneto and, uh, Azriel that made the, the finger, the finger and just like, didn't know I would use it for that, but, uh, it's probably a fun usage. 407 00:30:48,120 --> 00:30:54,940 Uh, so it's like fingerprints, uh, plastic finger and a piece of green onion taped to it to, to trigger the organic detection. 408 00:30:55,840 --> 00:31:01,500 And you run it, it's just like, also shout out to Trader Joe for the green onions. 409 00:31:02,080 --> 00:31:06,280 And, uh, yeah, you unlock the, uh, you unlock the device. 410 00:31:06,280 --> 00:31:07,020 Thank you. 411 00:31:10,070 --> 00:31:13,110 So, yeah, that's cool, but can we do more? 412 00:31:13,110 --> 00:31:14,590 Can we mess it further? 413 00:31:15,090 --> 00:31:17,830 Uh, so that's like getting like a little in the weeds. 414 00:31:17,830 --> 00:31:22,150 Uh, I need to talk about how data is passed between the firmware and the host. 415 00:31:22,370 --> 00:31:26,330 And so the idea is like the data from the host is encapsulated. 416 00:31:26,710 --> 00:31:32,150 And you got, you're going to have, uh, some kind of TLV, like tag length value type of thing. 417 00:31:32,190 --> 00:31:35,690 And the encapsulation is described as that. 418 00:31:35,690 --> 00:31:41,250 So for instance, that one, when data gets de-encapsulated, it will just like straight out copy the data into a buffer. 419 00:31:41,250 --> 00:31:47,610 While that one will be split into a size that goes one way and the buffer that goes the next one. 420 00:31:48,170 --> 00:31:49,930 Sure, like why is this so complicated? 421 00:31:49,930 --> 00:32:00,610 I don't know, but, you know, and the trick here is the host, uh, going to prepare the arguments and the size both ways for what it's sending to the firmware, but also what it's expecting back from the firmware. 422 00:32:02,270 --> 00:32:09,770 The whole thing, holy shit, the whole thing gets serialized, sends to the host, uh, the firmware. 423 00:32:09,870 --> 00:32:15,250 And upon return, it gets deserialized and, uh, the data get back, copy to the user. 424 00:32:15,530 --> 00:32:19,890 In practice, we see we get random, uh, it's little tiny, so I got to go fast. 425 00:32:19,890 --> 00:32:25,230 Prepare the arguments, call the function, and, uh, deserialize and copy back to the user. 426 00:32:25,830 --> 00:32:29,990 Uh, but the problem is the, the system shows the firmware too much. 427 00:32:30,230 --> 00:32:33,090 And drink, that's like inside the firmware. 428 00:32:33,190 --> 00:32:41,790 It's, uh, the type of encapsulation and the size of the, the parameters are redefined by the firmware before sending them back. 429 00:32:42,510 --> 00:32:47,630 And the host shows that, which is not good because, you know, we've shown that we can be malicious. 430 00:32:48,090 --> 00:32:55,390 So when everything gets processed, you get actually like overflows or type confusion bugs, which those will corrupt the host. 431 00:32:55,390 --> 00:32:59,650 So, you know, with malicious data from the firmware, you can mess with Windows. 432 00:33:01,050 --> 00:33:05,110 And to do that, like a quick example, uh, I'm going to backdoor, uh, CV get random. 433 00:33:05,110 --> 00:33:08,690 So the function I was talking about before that return random value. 434 00:33:09,170 --> 00:33:24,110 Uh, and from the screenshots, I wanted to highlight some kind of deserialization or decapsulation where you're here, you're going to have like the integer that's meant to receive, uh, the size that was, that was being returned by, uh, the firmware and the data. 435 00:33:24,110 --> 00:33:26,690 And that's one of the specific encapsulation type. 436 00:33:26,690 --> 00:33:32,170 But if we switch the encapsulation, we can make it so that, uh, yes, one second. 437 00:33:32,550 --> 00:33:40,170 We can make it so that, like the, the integer is going to be confused with the buffer itself. 438 00:33:40,230 --> 00:33:41,730 And we just straight out overflow that. 439 00:33:42,170 --> 00:33:49,770 And, you know, to not just destroy the CV get random function, I made it so that it will only happen if you ask for a specific size. 440 00:33:49,770 --> 00:33:54,470 So the firmware like checks, oh, if it's like magic size, it will send like the crazy payload. 441 00:33:54,470 --> 00:33:56,450 And if it's not, it will just do its normal job. 442 00:33:56,690 --> 00:33:58,150 So that's a different demo. 443 00:33:58,610 --> 00:34:04,590 Uh, on the right side, like the video is kind of eh, but it's a toy binary I made that I just called CV get random. 444 00:34:04,810 --> 00:34:08,390 If there is no argument on the command line, it just, uh, calls it. 445 00:34:08,690 --> 00:34:15,030 And if it's, if there's an argument on the command line, it will send the special size that triggers all the, uh, the nastiness. 446 00:34:15,990 --> 00:34:18,010 And so you just run it a few times. 447 00:34:18,010 --> 00:34:22,150 I think that, yeah, like here I'm just showing that there is no, uh, shenanigans going on. 448 00:34:22,150 --> 00:34:23,470 It's just calling the function. 449 00:34:24,290 --> 00:34:30,810 And on the left side, I'm going to call it like twice with like no arguments so that it just do its normal job and return some random data. 450 00:34:30,910 --> 00:34:31,910 And it's cool. 451 00:34:32,170 --> 00:34:39,530 And the third time, uh, it's going to return, um, a malicious payload that corrupt the PLN thing and exploit a stack overflow. 452 00:34:39,590 --> 00:34:42,070 And I run it and suddenly, boom. 453 00:34:42,230 --> 00:34:43,510 Pop calc. 454 00:34:43,610 --> 00:34:45,930 So pretty happy with that. 455 00:34:45,930 --> 00:34:49,150 It's like we can actually corrupt Windows, you know. 456 00:34:49,330 --> 00:34:56,110 Uh, but the point is like that's just a toy binary and I was really looking for places that would use that function but I couldn't find any. 457 00:34:56,190 --> 00:35:00,330 So I was like, okay, we need to be a little more serious and we're going to go, you know, for the kill. 458 00:35:00,330 --> 00:35:02,370 We won't like mess with the system service. 459 00:35:02,570 --> 00:35:09,110 Problem is like we need to find something, uh, that has a high privilege, use that control vault DLL that's, you know, like unsafe. 460 00:35:09,550 --> 00:35:12,590 And, uh, in a function that doesn't have a stack cookie. 461 00:35:12,590 --> 00:35:13,990 So it's a bit of a tall order. 462 00:35:14,130 --> 00:35:19,910 But, you know, targets, Broadcom services, uh, third party applications, I couldn't find any that use that. 463 00:35:19,910 --> 00:35:22,990 But in the past, I think it used to be but not anymore. 464 00:35:23,610 --> 00:35:28,070 Or Windows hello stuff, so the, what handles the fingerprints that we've only been messing with. 465 00:35:28,670 --> 00:35:32,850 So I spent so much time, uh, looking at the stack of so many functions. 466 00:35:32,850 --> 00:35:39,390 So that's me, uh, you know, when spending hours, uh, matching and be like, is it going to work? 467 00:35:39,390 --> 00:35:40,250 No it doesn't. 468 00:35:40,250 --> 00:35:41,690 But eventually I found that. 469 00:35:41,690 --> 00:35:43,210 Uh, whoop. 470 00:35:43,490 --> 00:35:50,150 Uh, that's the, uh, it's a function, it's a DLL that's used, uh, to interface with the Windows biometric framework. 471 00:35:50,150 --> 00:35:56,350 So when you have a fingerprint reader, like that's kind of the glue code in between the Windows services and the firmware. 472 00:35:56,710 --> 00:36:00,810 And what that function does is takes a handle to an object. 473 00:36:01,350 --> 00:36:03,830 Retrieve, uh, the head of that object. 474 00:36:04,150 --> 00:36:06,730 Using like, pretty much CV get object. 475 00:36:06,730 --> 00:36:09,650 And, uh, yeah, the handle is here. 476 00:36:09,650 --> 00:36:14,350 And it turns out the, the, that object is not even in the stack frame of the function. 477 00:36:14,350 --> 00:36:15,790 It's in the next one somehow. 478 00:36:15,790 --> 00:36:20,530 I don't know how that works, but, but the parent stack frame doesn't have stack cookie either. 479 00:36:20,530 --> 00:36:26,270 So this is the best target because we've seen that, you know, we can, uh, overflow that type of stuff. 480 00:36:26,270 --> 00:36:31,510 And here is as a straight line to corrupting the return address and, you know, starting a rope chain. 481 00:36:31,870 --> 00:36:38,570 Uh, and just to like, summarize, that is being used with the Win biometric service, which run a system. 482 00:36:38,870 --> 00:36:44,090 Uh, and you can interface with that stuff with some kind of IO control like interface. 483 00:36:44,090 --> 00:36:45,750 And that any user can do. 484 00:36:46,190 --> 00:36:48,990 And so that's kind of like the cold, cold trace of the thing. 485 00:36:48,990 --> 00:36:51,950 So we can exploit that function that will corrupt all of that. 486 00:36:51,950 --> 00:36:54,850 And that is still within, you know, the Broadcom storage adapter. 487 00:36:55,950 --> 00:36:59,430 So we can overflow that and corrupt the stack. 488 00:36:59,430 --> 00:37:15,530 And I apply the same methodology where I backdoor the CV get object function so that if you request the object, uh, 1-3-3-7, uh, it will, uh, return like the whole nasty payload that triggers the bug as opposed to, you know, any legitimate object. 489 00:37:15,870 --> 00:37:23,310 So, uh, the demo here, um, just FYI, I already flashed the firmware with the malicious code. 490 00:37:23,310 --> 00:37:28,910 And we just going to trigger the vulnerable code pass and requesting that, uh, object. 491 00:37:29,970 --> 00:37:37,050 So, on the right side, you have the, uh, the Windows biometric framework running on those SVC hosts. 492 00:37:37,050 --> 00:37:43,470 So we run the exploit and we see here, uh, suddenly it pops Netcat, uh, to start a reverse shell. 493 00:37:43,650 --> 00:37:51,030 And from our own stuff, you know, we connect to this reverse shell and, uh, suddenly we get a system shell. 494 00:37:51,970 --> 00:37:53,710 So that's cool. 495 00:37:54,770 --> 00:37:57,650 Um, so yeah. 496 00:37:58,350 --> 00:38:00,190 So far, what have we done? 497 00:38:00,190 --> 00:38:08,670 Uh, we got code execution on the application firmware, permanent modification of that application firmware, bypass of the login screen, you know, like if you have some green onions. 498 00:38:09,010 --> 00:38:11,750 And we got, like, uh, system privilege. 499 00:38:12,590 --> 00:38:13,730 Can we do more? 500 00:38:14,430 --> 00:38:16,850 Why, when am I going to stop, right? 501 00:38:16,910 --> 00:38:19,950 Uh, and the other is just a cute little, uh, demo. 502 00:38:19,950 --> 00:38:25,410 Uh, the stuff I was talking about, like, you know, that, actually that board, it's so tiny in real life. 503 00:38:25,410 --> 00:38:29,650 It's, it has like a ribbon cable that has some USB wires to it. 504 00:38:29,650 --> 00:38:34,090 And I was like, can I just plug it into any computer to, like, mess with it physically? 505 00:38:34,510 --> 00:38:37,050 Uh, and yeah, that's sort of that contraption. 506 00:38:37,050 --> 00:38:40,810 You know, most of those, uh, cables are just, you know, 3 volt or 5 volt. 507 00:38:40,810 --> 00:38:45,370 But 2 of them are, uh, USB, uh, data and whatever. 508 00:38:45,690 --> 00:38:47,430 And so we can just, like, connect them. 509 00:38:47,530 --> 00:38:52,870 Uh, I was going to do a nice, super sleek, you know, circuit board and, you know, I ran out of time. 510 00:38:52,870 --> 00:38:56,130 So instead we have our, uh, beautiful setup here. 511 00:38:56,390 --> 00:38:58,910 But in practice, you know, that's my setup. 512 00:38:58,910 --> 00:39:01,050 Every time you touch a cable, everything breaks. 513 00:39:01,730 --> 00:39:05,670 Uh, but, you know, that's why it's, like, you know, ready to be plugged. 514 00:39:05,670 --> 00:39:12,610 But when you plug that cable, a new, uh, uh, Dell control, uh, control device pops up here. 515 00:39:13,130 --> 00:39:16,330 Uh, because there's a new one that we just connected physically with. 516 00:39:16,410 --> 00:39:20,450 And just here to show that, uh, you can actually communicate with it for real. 517 00:39:20,610 --> 00:39:27,550 And the, the previous one, uh, so I disabled it for the demo. 518 00:39:27,590 --> 00:39:36,590 But anyway, so with that, what, what that means is all of this talk about, you know, oh, malicious user or something, someone compromised, you know, mess with the board. 519 00:39:36,590 --> 00:39:45,390 Really, like, it's also someone can open your laptop, you know, physically unplug the cable from the motherboard and plug to their own thing and do the attack as well. 520 00:39:45,450 --> 00:39:48,890 So it's a whole new, like, physical attack vector that got unlocked here. 521 00:39:50,290 --> 00:39:51,930 So, yeah, pretty quick, right? 522 00:39:52,210 --> 00:39:57,450 So, uh, similar, like, cute, you know, overall diagram. 523 00:39:57,450 --> 00:40:00,330 There's, like, two main attack scenarios that I wanted to highlight. 524 00:40:00,430 --> 00:40:06,950 One is, like, as I said, like a post-compromise, which is the most likely, like, uh, you know, user gets compromised by some threat actor. 525 00:40:06,950 --> 00:40:17,790 And if the threat actor is aware of this type of stuff, could modify the firmware and, um, and then, you know, use it to have, like, a Windows compromise and kind of an implant in the system. 526 00:40:18,110 --> 00:40:26,970 And then a physical attacker can also do that and, you know, either, like, bypass the fingerprint or, uh, you know, uh, compromise Windows. 527 00:40:28,890 --> 00:40:31,710 So, uh, reports and stuff like that. 528 00:40:31,710 --> 00:40:34,990 Uh, we reported that to Dell, you know, like, early this year. 529 00:40:35,070 --> 00:40:36,730 An advisory was released in June. 530 00:40:37,130 --> 00:40:41,770 We just, I think, released some of these, like, uh, reports, uh, on the Talos website. 531 00:40:42,610 --> 00:40:47,430 Uh, many CVs and, uh, a few more are going to come, like, later, like, in the year. 532 00:40:48,270 --> 00:40:51,330 And there are, like, two, uh, our two blog posts about it. 533 00:40:51,330 --> 00:40:54,190 Like, one level, a high-level overview that was released early this week. 534 00:40:54,190 --> 00:41:00,190 And the technical deep dive of, like, 5,000 plus words, uh, that was released today. 535 00:41:00,190 --> 00:41:04,830 Uh, and shout out to all the people who helped me get that one published because that was a lot of work. 536 00:41:05,370 --> 00:41:06,690 Um, and yeah. 537 00:41:06,690 --> 00:41:08,190 So, what can we say? 538 00:41:08,190 --> 00:41:12,670 I think the firmware security is, it's not new, but it's, like, so important. 539 00:41:12,910 --> 00:41:19,710 I think the, um, we need to understand the security exposure of, like, you know, the things that are, like, inside our systems. 540 00:41:19,910 --> 00:41:23,270 That board, like, it exists since, like, 2, 5, 15 years, you know. 541 00:41:23,490 --> 00:41:25,950 And as far as I can tell, there's no research about it. 542 00:41:25,950 --> 00:41:28,130 There's barely any documentation about it. 543 00:41:28,170 --> 00:41:33,970 So, I think it's either, like, us hackers, you know, can, you know, reverse that, document it, share, like, our knowledge. 544 00:41:33,990 --> 00:41:42,790 Or maybe, like, what, uh, Nick was saying yesterday, uh, you know, maybe calling for, like, more transparency, you know, from the vendors and so on to, like, you know, be more open. 545 00:41:43,110 --> 00:41:43,770 So, I don't know. 546 00:41:43,770 --> 00:41:46,350 I think that's, uh, pretty much all I have for you today. 547 00:41:46,570 --> 00:41:47,910 Thank you. 548 00:41:47,910 --> 00:41:51,470 Uh, you can reach out, uh, to me on Twitter and what not. 549 00:41:51,630 --> 00:41:55,030 And, uh, otherwise, like, I have a few minutes for questions, I think. 550 00:41:56,310 --> 00:41:57,090 Thank you.