start	end	text
0	6680	I'd like to introduce Philippe who is going to be talking to us about secure systems on a chip systems.
7080	9900	And I'm really excited for this talk and I hope you are too.
9900	10700	Philippe?
10820	11480	Thank you.
12320	13400	Hi, everyone.
16860	23640	So, yeah, so today I'm going to talk about revolt and how you can get compromised by your secure system on chip.
24340	26340	So, hi, I'm Philippe.
29500	30360	I'm a senior software engineer.
30360	31980	I work on Windows systems.
32180	36720	And basically what I do is to look for vulnerabilities in third party software.
37040	45220	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.
45320	49320	So, that's what it is about.
49560	52200	What can you expect from today's presentation?
52520	55040	It's a 45 minute talk.
55040	61260	I'm going to go over some of the bugs we've reported to Dell and Broadcom like in the beginning of the year.
61680	64200	Targeting something called control vaults.
64240	69500	And all the bugs sit together, leads to like a full compromise of the system and we'll see like how that works.
70300	73300	So, if you've never seen that before, it's a laptop, right?
73300	78660	And here you have a fingerprint reader, an NFC card reader and a smart card reader.
78660	82360	And all of those peripherals connect into a control vault.
82540	89160	And if you look into the system panel in Windows, you can find this mysterious device called control vault.
89380	93640	And you don't really know what it is, but you know, that's the point of this presentation.
94060	99700	And if you open the laptop and remove the battery, you can find the control vault board like over here.
100140	104660	You can see it's like covered in tape and you have just like a little like flash module that sticks out.
104840	107860	And the various peripherals are like connected onto it.
108960	113180	So, now you can be like, okay, control vault, what the hell is that, right?
113900	116120	So, technically it's control vault 3.
116700	119520	It can be found in like 100 models of the laptops.
119560	122820	Mostly like the business lines, so like latitude and precisions.
123960	125680	And that the board is there.
126000	129040	It's a mix of software, firmware, hardware.
129220	131460	You have Windows API, Linux API.
131680	138140	You have like a firmware that like it's a real time OS that's running on this ARM chip here.
138360	142200	And the chip is like a Broadcom 58202.
143180	143980	Cool.
143980	146600	And it's meant to be a secure storage of secrets.
146600	152300	So, that little like flash module here is encrypted and it contains like the firmware and potential secrets.
152880	157580	So, yeah, technically it's called USH for Unified Secure Hub.
157580	162560	And the idea is like you connect like the peripherals I was mentioning before.
163740	165320	Yeah, it's control vault 3.
165320	167680	There is also the newer control vault 3 plus.
167680	170080	You find that in some of the Dell Pro machines.
170120	172640	It's also vulnerable to like all of my findings.
173160	177980	And before that, you had control vault 2 and control vault, you know, like no number.
178540	186200	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.
187300	195040	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.
195740	197160	And there is no documentation.
197200	201120	So, we're going to have to do some work here.
202180	204140	So, step one, what can you do?
204240	205860	Google stuff, right?
206060	213900	And this one pops up eventually, which is the Linux implementation of the host APIs for the control vault device.
214000	218400	And what is cool about it is that they compiled it with debug symbols.
218420	223200	So, you can import the host API in IDA, Ghidra, whatever.
223360	227980	And you will get a lot of data structures, enums, status codes.
228020	236820	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.
238520	241360	And the other one is kind of a weird one.
241360	245360	It's a certification for the system on chip for like it's cryptography module.
245360	251460	It doesn't give you much information, but kind of hints at the internals a little of what it can do.
251460	256480	And it also gives some information about the values acronyms that are being used.
256480	264720	For instance, here, SBI, for instance, stands for secure boot image, which is an extension of the boot ROM and should be trusted.
265560	266180	Okay.
266320	268960	So, why did I want to target that?
268960	274360	You know, okay, it's hundreds of models of Dell laptops, you know, probably millions of devices affected.
274360	277880	But really, like the beginning of that project were way more humble.
278500	285660	I was looking at that, which is just, you know, process manager to see, you know, what's running on my system.
286100	288300	And that one caught my attention.
288300	291780	So, I was listing the stuff that have like ASLR enabled.
292120	294880	And, you know, in 2025, everything should have ASLR.
294880	301580	So, that's address space layout randomization, which is a common security mitigation to make, you know, like exploitation much harder.
301820	303960	And it should be enabled everywhere.
303960	306120	So, when it's not, that's kind of worrisome.
306780	312420	And same like some of the DLL that are being used by that, also not ASLR enabled.
312660	316380	And all of that is in the Broadcom services that talk with control box.
316620	320880	So, I got really excited, you know, I started like healing, you know, through my windows.
320880	323220	You know, it's like, let's freaking hack the planet, guys, you know.
323220	326080	So, I was like really excited.
326440	330400	And next step was like less exciting, which was like looking at files.
330600	335760	So, extracting the installer and trying to understand what's in there, like what is control box, you know.
336020	337480	And there's like so many files.
337480	342680	You know, you have a driver, like USB driver, and then you have like all the peripherals of the drivers as well.
342860	347760	There's like Windows services, there's like DLLs that nothing use, so like I don't even know why they're there.
348440	351000	And then there's a firmware folder like full of files.
351120	353880	And there's like a few that kind of like look interesting.
354320	358380	So, we have like that famous like SBI that I was mentioning three slides ago.
358620	361420	The secure boot image, which is like, you know, part of the boot process.
361420	362820	And that was in clear text.
362900	366660	So, you can import it in either, like whatever you want and look at it.
367080	371500	And then there's that one called like Citadel, which turns out to be the application firmware.
371500	377020	So, that's the main stuff you talk with like when in normal operations.
377180	379120	But unfortunately, this one is encrypted.
379400	382240	So, it's pretty sad that we have more work to do.
382440	384340	But that's going to be fun, you know, challenge.
385580	392600	Before we go too far, like just to give an idea of the system architecture, here we have the main firmware.
392600	393440	That is like the boot ROM.
393440	394420	That's the SBI.
394420	395800	That's the main application.
396200	402980	And on the left side, you know, it talks with all of those hardware peripherals, you know, the flash, the NFC reader, et cetera.
402980	404940	Using, you know, like various buses.
405260	407900	And on the right side, you have the host.
407900	409280	So, like on our case, Windows.
409620	412360	And it talks over USB with all stuff.
412540	418100	And then inside, in the Windows side, you have like a USB driver that runs in kernel mode.
418100	425440	And then user land, you have some control APIs and value services and other stuff that talk with the driver.
426400	427060	Okay.
427060	430560	So, if we want to talk with that board, what can we do?
430560	435960	The way it works is the USB driver will create like a file device on Windows.
435960	444900	And user land, like any regular user on Windows can open that device and send comments to it via IO control commands.
445000	448580	And eventually, the driver will send USB packets to the firmware.
448940	458140	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.
458340	460260	Those are called like CV commands.
460260	466360	And you have like CV open, CV closed, CV create object, delete object, get object, you know, tons of that.
466360	468800	I think there is like 150 different commands.
468800	470800	So, it's a huge attack surface.
471740	476460	And they need a session handle and you get that with like CV open.
477640	485140	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.
485140	488400	So, it's called CV manager or CV manager SBI.
488540	493200	And all of that is clearly like an attack surface you want to mess with, you know.
495020	501760	But before we do that, let's, this is like a quick little example on how to communicate with the firmware like by hand.
502020	503080	Kind of.
503080	505200	So, it's like a little Python script I wrote.
505420	509400	Here, you just use C types to load the API DLL.
509680	512660	And then you define the function that you want to talk with.
512660	516480	In particular, like what are the arguments and the return value.
516640	520680	And for that, you can use the symbols you got from the Linux version of it.
520700	522220	And then you just call it.
522460	524420	And for instance, the result is that.
524420	526700	This 20 lines of code is you will get that.
526860	533420	So, with 20 lines of Python, you can talk with these devices in your laptop that does some crazy stuff.
533420	534260	So easy.
534660	538260	I was going to publish a tool about how to do that better, but I ran out of time.
538260	540480	So, for now, you only get that one slide.
540580	541640	Sorry about that.
542920	543460	Yeah.
543460	545460	Now, we know how to talk with it.
545460	546980	We want to like mess with it, right?
546980	548640	So, a little of that modeling.
548860	552800	Back to the model, the system model.
553240	557620	I see that kind of like four main attack surfaces that I was considering.
557860	560300	One is the main firmware stuff, you know.
560300	565480	So, the SBI and the application firmware, you know, they have a USB implementation.
565660	568480	They receive like this high level CV commands.
568480	571180	And then there's more interaction with like all of the services.
571300	573660	So, all of that is like super interesting to target.
574540	583540	Then, the firmware itself lives in something called like secure boots, which is meant to prevent, you know, unauthorized tampering with the firmware.
583640	587980	And for that, you know, you're going to have like some secure firmware update mechanism, some signature checks.
588040	589760	And that's something we also want to look at.
590600	593000	Then we have all the Windows services here.
593000	598700	So, originally I was just like, oh, I want to mess with that driver to maybe get an elevation of privilege on Windows.
599220	601140	But, you know, that's one angle.
601140	604080	But then you have like all the services, you know, all of that is really interesting.
604500	609420	And finally, something that I'm not going to talk about today, but I wanted to highlight it.
610060	615620	There is that side where like all the physical peripherals talk with the firmware as well.
615620	617580	And so it's kind of a funny question to ask.
617580	622400	Like, could a malicious, you know, smart card reader or fingerprint reader could mess with the firmware?
622540	626320	Or could a malicious firmware mess with the fingerprint reader or smart card reader?
626760	628860	Those are really exciting questions.
628860	633500	But trying to answer them in that project would like 10X the scope of it.
633500	635080	And I was like, okay, I don't have time for that.
635080	637160	But, you know, it's fun to explore.
638360	645240	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.
645240	653700	You have the boot from that verified SBI's and then the SBI gets some key material from something called a secure code descriptor.
653700	657380	And then it will be used to like start the application firmware.
657420	663760	And during a firmware update, all of that gets kind of like, can be modified and get, need to be verified.
663760	666540	And we kind of see like, how does that work?
667900	670240	And, okay, we want to hack stuff.
670240	673360	So let's talk about mitigations to like make it harder for us.
673360	677160	So have we seen, the Broadcom services don't come with ASLR.
677240	681880	But they come with DEP for data execution prevention.
682420	686960	So basically you cannot just like jump on the stack and execute everything.
686960	688320	You know, it's not the 90's.
688480	693460	And there is like something called stack cookie to make stack overflow exploitation harder.
694540	697840	And in that case, like sometimes it presents, sometimes it's not.
697840	700560	So it really depends on the complexity of the function.
700640	705700	It's kind of already weird because, you know, you should put it everywhere and, you know, but not the case here.
706280	710140	And on the firmware side, there's like one really cool feature.
710480	717120	It is the, the firmware is executed in place in the flash chip and it is encrypted.
717120	721400	So you can, you know, decrypt and execute the firmware like in one go, which I think is really cool.
721660	725540	And then you also have potentially the secure boots between quotes.
725540	727320	So, you know, a bit of foreshadowing here.
728660	737060	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.
737680	739760	DEP is a bit of a question mark.
739760	743160	If you try to jump on the stack, for instance, it's going to crash.
743600	751120	But there's also read, there and then jump there and it's done.
751120	756300	So if you can get memory corruption bugs, it's pretty much like done from there.
757200	757820	Okay.
757820	759340	So now we have an idea of the system.
759340	761580	Let's try to like reverse stuff a little.
761940	768460	The point was the application firmware is encrypted and we want to like decrypt it.
768460	773180	But we are only angle here is like looking at the SBI first.
773300	778580	So, yeah, as I said, we want to look for firmware decryption routines.
778740	781020	And for that, we can look for strings.
781440	786420	And that things pop up, which is like a lot of like sad failure about decryption.
786420	791680	But the failure of that thing is our success because that points us to where like decryption happens.
792100	797780	And in practice, the way it works, like doing firmware updates, it's like a three step process.
797840	803760	And you can find out like if you reverse the upgrade service on Windows or like one function in the Linux version.
804260	809020	And so, the host is going to send a field upgrade start command.
809360	817760	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.
817980	824140	But if there is no key present, it's going to use some hard-coded credential defaults, hard-coded keys.
824540	831860	And then it's going to generate new key material for the storage of the firmware like on the flash chip.
831860	834640	So every time you reinstall the thing, it's regenerate those keys.
835520	840880	Then the second step is like the update command that keeps sending blobs of encrypted firmware.
840880	842440	And that gets decrypted.
842440	847420	The one gotcha here, it's using a weird IV for the encryption mechanism.
847420	849000	And we'll see that in a few slides.
849240	859120	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.
859280	860920	Or what remains to be committed.
861420	863260	In practice, it looks like that.
863260	870480	In certain situation, the key material is going to be loaded into that SCD stuff I was talking about.
870480	872540	It's just like default key and default IV.
872820	879460	And that's going to be used to decrypt, to be fed that USH decrypt function.
879720	887720	And if we look into the USH decrypt function, it turns out it's just a wrapper around the cryptographic module APIs.
887820	889380	So we don't really know what it does.
889620	892560	But you can see here it's using the key we've seen just before.
893020	897660	But it's not a big deal that we don't know which algorithm it does because there's only so many.
897740	906340	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.
906600	913880	And it turns out like ASCBC with the actual default key and IVs we've seen, will get you something decrypted.
915640	924600	And the one gotcha here is like the SCD may have different endianness so the byte order might swap depending on stuff.
924600	927220	So it might be a problem sometimes.
928200	930400	So we decrypted the header.
930400	935280	Now we really want to decrypt the whole firmware , you know, just not just the beginning.
935480	938100	And for that, that's the update command.
938100	944460	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.
944660	949260	And it's like the same stuff except that it's using this like custom like IV command.
949260	954340	So the vector, initialization vector of the, for the ASCBC.
954860	956520	And the function looks like that.
956520	964820	So you can just copy paste that either in Visual Studio or like Python and this way it generates the proper IV for you.
964860	972320	And the idea is it will take the address, the mapping address of that chunk of flash.
972320	977640	So, you know, if it's loaded as whatever address in firmware that would be the input for that function.
978200	985860	And so we implement the whole stuff and we run the algorithm ourselves and we successfully decrypt the application firmware.
985920	988820	And I just run strings on it to kind of showcase that.
989280	990080	Cool.
990200	997040	So now we can import the application firmware in IDA and start looking for vulns.
997400	999640	But what vulns do we look for?
999780	1007560	As I said, all the CV, most of the CV commands except, expect, sorry, a handle, like a session handle.
1007560	1009060	And so you have to open a session.
1009220	1012520	And that's a function that does it.
1012780	1015900	But in practice , that's firmware side.
1016200	1020140	What the firmware does when you call that is it's going to allocate memory.
1020560	1026880	Going to write like a session tag, like, you know, the letter S-E-S-S in that memory.
1027040	1030200	And then just return that pointer as a session handle.
1030200	1038540	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.
1038580	1042420	You know, they could have used like random number or something to identify a session .
1042420	1047440	But here is like straight out the heap address of the decision is the handle.
1047640	1049940	So that's curious but, you know, sure.
1050960	1056920	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.
1057200	1060820	And for that you provide the handle which is a pointer.
1061140	1063140	And it's going to validate the session.
1063260	1070060	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.
1070140	1072840	And then it's going to look for the session tag.
1072920	1073980	And that's pretty much it.
1073980	1076040	There's a few extra checks that are like irrelevant.
1076600	1081280	And when you pass the check, it erases the tag and free the memory.
1081520	1082660	So far so good.
1082660	1089860	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.
1089880	1093540	And, you know, my question was like, do we have like an arbitrary free here?
1093560	1099220	Because really the only check is if the first four bytes of whatever pointer you provide is SESS.
1099220	1104020	So if we can place that in the heap, you could free something that's not a session.
1105180	1106600	But can it be done?
1107420	1108780	Yes, it can be.
1109120	1116200	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.
1116360	1121220	That being said, you don't control all of the metadata of those objects.
1121220	1125420	And also, you get a handle to that object.
1125420	1131040	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.
1131180	1136120	So we can place data on the, on the heap, but we don't know quite know where it is.
1136200	1138840	But still, you know, we have arbitrary data on the heap.
1139140	1141580	So now we want to locate that data.
1141940	1145080	And for that, uh, I picked one of the CV function.
1145240	1150380	Uh, CV get random that, you know, meant to return random data from the cryptography module.
1150580	1156020	But in our case, it takes the session, check if it's valid or not, you know, using the same function as before.
1156340	1161580	And whether or not it's valid, we'll return either like invalid session or do it stuff.
1161940	1164920	But with that, we really have a session oracle.
1164940	1169580	Like we can just, you know, ask CV get random, here's a pointer to the heap.
1169580	1171160	Is it a real, real session or not?
1171160	1173000	And it will tell you there's no side effect.
1173020	1176380	And it takes like, I don't know, like 30 seconds to swipe the whole heap.
1176540	1178500	So with that, we can locate objects.
1179100	1183280	So to kind of summarize that, CV create object lets you place it on the heap.
1183280	1188440	Get object and set object, uh, not on the slides, but lets you read and write your object data.
1188580	1191200	Get random lets you find, you know, your object on the heap.
1191200	1195840	And CV close lets you, uh, free, um, something that looks like a session.
1195840	1199460	So with all of that, yes, we do have an arbitrary free in the heap.
1200380	1204760	Uh, so are we going to do some cray cray, uh, exploitation, heap exploitation?
1205420	1209200	That's, that's me when I have to learn, you know, a new, uh, heap implementation.
1209760	1212400	Uh, so I was like, okay, let's, let's put a pin on that.
1212700	1214960	And let's just find more bugs, right?
1215380	1224940	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.
1225000	1227700	So you can reach it from, you know, user land.
1227760	1229920	And it takes a handle to an object.
1230080	1243540	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.
1243600	1248000	So here I was like, oh shit, do I have like a stack overflow, like just like that.
1248540	1254260	Um, so to do that, we would need to be able to control that specific field.
1254380	1256500	Uh, and it turns out, no, you can't.
1256500	1261860	Uh, at least there is like some protection and you don't have the control of that, at least in the easy way.
1262100	1268440	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.
1269020	1275700	And so to do that, we're going to, uh, overlap two objects and use one to modify the other.
1275780	1278740	So here's kind of like a beautiful diagram I made.
1278980	1282600	Um, it's not a one to one representation but to give the idea.
1282640	1289220	So there will be like one of those objects created by, uh, CV create object where we already put the session tag in it.
1289220	1293700	And purple is like what you can control and blue is what you cannot control.
1293760	1296180	Not one to one but just to simplify.
1296860	1303300	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.
1303520	1310420	And then we can allocate a smaller object that, you know, is meant to fit inside, you know, the hole we just poked.
1310420	1316340	And by the way the heap management works, it's going to be placed, you know, inside the, uh, bigger object.
1316340	1320540	So we kind of like overlapped two objects which, you know, not meant to happen.
1321000	1328220	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.
1328360	1338920	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.
1338980	1346960	And then we're going to feed the small object into secure bio identify and this time we actually trigger the stack overflow.
1347380	1353900	And because I said there is pretty much no security mitigation, it means we really can now execute code, uh, inside the firmware.
1354000	1356520	But the question is what do we want to do now?
1356520	1358860	Like what kind of stuff would we want to execute?
1359340	1362620	And so I have like kind of two, uh, cool ideas.
1362680	1373840	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.
1373980	1378120	And then you can use CV get object to retrieve that data.
1378140	1383840	And so this way you have kind of a two way communication with your, um, with your exploit.
1383840	1388520	Uh, which is pretty neat because with that you can, you know, make it dump RAM content.
1388520	1391520	So like if there's like key material in the RAM you can retrieve that.
1391520	1395060	The boot from that's, you know, like kind of critical to the security of it.
1395500	1396640	It's pretty fun.
1396800	1402340	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.
1402660	1404600	It's called SOTP read key.
1404600	1409520	And it basically, uh, retrieve key material from the fuse of the system on chip.
1409880	1411800	And that's for like key material.
1411800	1416320	And clearly like retrieving secret key material from our chip is something that sounds cool.
1416780	1418260	Uh, so that's the one angle.
1418260	1430000	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.
1430000	1437860	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.
1437900	1443920	And this way we can tamper with the firmware in a baby steps toward like firmware modification.
1444180	1448800	And it's, I'm just not talking about it today because I have better coming up.
1449320	1451380	Uh, overshadowing again.
1451780	1459820	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.
1460040	1462020	So hopefully you guys can see.
1462260	1469920	Uh, the process is, uh, first we use the CV get random to locate existing sessions because, you know, the board is being used.
1470300	1472920	And then we forge a new one and we free it.
1472920	1478700	We overlap the object, uh, set up the, the exploits to call, uh, SOTP red key.
1478700	1480260	And actually we do it twice.
1480320	1485200	And with that we, uh, we leaked an HMAC key and an AES key.
1485200	1487480	Uh, those are like for my device.
1487480	1490100	So, you know, it's okay if I put them on the slides, you know.
1490160	1492240	Uh, but those are like pretty important.
1492240	1494280	And that's why you should ask like keys.
1494280	1496180	What kind of keys do you talk about?
1496820	1498540	So, thank you.
1499200	1503680	Uh, so there is like seven, um, fuses, like key slots on the chip.
1504780	1510140	And two of them are the one we just leaked, uh, that are used to, uh, secure storage in the flash.
1510140	1514140	So when I said, you know, flash is encrypted, could be with that.
1514580	1521360	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.
1521760	1530200	The secure code descriptor contains an RSA key that is used during firmware updates to verify the signature of the firmware updates.
1530400	1537240	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.
1537380	1546760	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.
1547160	1552060	And now a question you can ask is like, how do you lose that SCD stuff that you keep talking about?
1552200	1554460	Well, there's a very, uh, simple explanation.
1554620	1557500	There's that file called, uh, clear SCD dot bin.
1557500	1561200	And, uh, I don't know if you can see, but it's like zero one two F a bunch of times.
1561200	1566800	And it's used legitimately during firmware updates to reboot in, uh, secure boot image mode.
1566800	1574540	So basically the host flashed that file in, over the legitimate SCD and reboot.
1574540	1581440	And, uh, to flash it, it's using that beautiful function called CVFlashUpdate that once again any user can call.
1581940	1586640	And you reboot and then the SBI is kind of like that, like confused.
1586860	1590880	And we're like, okay, we need to wait for, you know, proper firmware updates.
1591000	1599080	But the thing that's crazy here is that CVFlashUpdate is literally giving you an arbitrary flash write, like from user land.
1599080	1600980	You don't need any privilege to do that.
1601080	1604420	The one gotcha here is like everything should be encrypted.
1604620	1608540	And so, you know, but we leaked the keys that are used to encrypt it.
1608540	1618640	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?
1619120	1623580	So revisiting the secure boot process was a little more like details.
1623880	1637080	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.
1637140	1639640	Populates the execution in place and starts that.
1639740	1644740	But critically, there is no signature check of the application firmware during boot.
1644740	1650420	The whole security of it depends on, you know, that being secure and therefore that being secure.
1650420	1652880	But we just broke that and we can mess with that.
1652880	1655580	So that's, you know, a little worrisome.
1658640	1664100	So yeah, with that we can do some, can we do some firmware modification?
1664340	1666420	So we can dump the device keys.
1666560	1669200	We can retrieve the SID content and decrypt it.
1669240	1680440	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.
1683960	1686500	And it's a good way to break your device, you know.
1686500	1689320	So it's like, I don't want to try that, you know, a little risk adverse.
1689960	1692580	And instead, I was like, okay, we can be a little more crafty.
1692660	1697120	We can forge our own SID, you know, and also encrypt it and HMAC it properly.
1697120	1703180	But we're going to put our own RSA key in it so that we can sign our own firmware image updates.
1703340	1706780	And it's going to get accepted because it's using, you know, all key material.
1707620	1710500	And yeah, with that, did it work?
1710580	1712420	No, it did not.
1713820	1718440	So as I said, you know, I fucked up the NDS of the SID.
1718440	1723380	So I flashed, you know, kind of the wrong byte order and it just, the device just stopped working.
1723380	1727100	And here it's like me trying to fix it with a flash programmer.
1727320	1733260	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.
1733500	1743000	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.
1743040	1749320	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.
1749920	1754840	And that's, you know, sent from the, the firmware over USB to Windows.
1755300	1756440	So that's cool.
1756440	1768120	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.
1768760	1770400	So, yeah, that's opened.
1770520	1771420	Thank you.
1772560	1779040	So, so that one, yeah, opened the, the door to a payment implant.
1780440	1782120	So, that's cool.
1782120	1783840	But what can we do with that?
1784080	1788180	You know, how is the unified secure hub, how secure is it?
1788300	1790260	So I have this cool cute demo.
1790420	1802160	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.
1802280	1817860	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?
1818220	1821640	And so the question is like, can we make it say yes every time?
1822020	1824840	You know, that would be really nice, right?
1825400	1826440	So I tried that.
1826440	1831600	I modified the CV fingerprint identify function, uh, and it looks like that.
1831680	1838220	Uh, and just for context, that's a, a plastic finger that I got at Defcon last year, like at the 503 party.
1838280	1847980	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.
1848120	1854940	Uh, so it's like fingerprints, uh, plastic finger and a piece of green onion taped to it to, to trigger the organic detection.
1855840	1861500	And you run it, it's just like, also shout out to Trader Joe for the green onions.
1862080	1866280	And, uh, yeah, you unlock the, uh, you unlock the device.
1866280	1867020	Thank you.
1870070	1873110	So, yeah, that's cool, but can we do more?
1873110	1874590	Can we mess it further?
1875090	1877830	Uh, so that's like getting like a little in the weeds.
1877830	1882150	Uh, I need to talk about how data is passed between the firmware and the host.
1882370	1886330	And so the idea is like the data from the host is encapsulated.
1886710	1892150	And you got, you're going to have, uh, some kind of TLV, like tag length value type of thing.
1892190	1895690	And the encapsulation is described as that.
1895690	1901250	So for instance, that one, when data gets de-encapsulated, it will just like straight out copy the data into a buffer.
1901250	1907610	While that one will be split into a size that goes one way and the buffer that goes the next one.
1908170	1909930	Sure, like why is this so complicated?
1909930	1920610	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.
1922270	1929770	The whole thing, holy shit, the whole thing gets serialized, sends to the host, uh, the firmware.
1929870	1935250	And upon return, it gets deserialized and, uh, the data get back, copy to the user.
1935530	1939890	In practice, we see we get random, uh, it's little tiny, so I got to go fast.
1939890	1945230	Prepare the arguments, call the function, and, uh, deserialize and copy back to the user.
1945830	1949990	Uh, but the problem is the, the system shows the firmware too much.
1950230	1953090	And drink, that's like inside the firmware.
1953190	1961790	It's, uh, the type of encapsulation and the size of the, the parameters are redefined by the firmware before sending them back.
1962510	1967630	And the host shows that, which is not good because, you know, we've shown that we can be malicious.
1968090	1975390	So when everything gets processed, you get actually like overflows or type confusion bugs, which those will corrupt the host.
1975390	1979650	So, you know, with malicious data from the firmware, you can mess with Windows.
1981050	1985110	And to do that, like a quick example, uh, I'm going to backdoor, uh, CV get random.
1985110	1988690	So the function I was talking about before that return random value.
1989170	2004110	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.
2004110	2006690	And that's one of the specific encapsulation type.
2006690	2012170	But if we switch the encapsulation, we can make it so that, uh, yes, one second.
2012550	2020170	We can make it so that, like the, the integer is going to be confused with the buffer itself.
2020230	2021730	And we just straight out overflow that.
2022170	2029770	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.
2029770	2034470	So the firmware like checks, oh, if it's like magic size, it will send like the crazy payload.
2034470	2036450	And if it's not, it will just do its normal job.
2036690	2038150	So that's a different demo.
2038610	2044590	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.
2044810	2048390	If there is no argument on the command line, it just, uh, calls it.
2048690	2055030	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.
2055990	2058010	And so you just run it a few times.
2058010	2062150	I think that, yeah, like here I'm just showing that there is no, uh, shenanigans going on.
2062150	2063470	It's just calling the function.
2064290	2070810	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.
2070910	2071910	And it's cool.
2072170	2079530	And the third time, uh, it's going to return, um, a malicious payload that corrupt the PLN thing and exploit a stack overflow.
2079590	2082070	And I run it and suddenly, boom.
2082230	2083510	Pop calc.
2083610	2085930	So pretty happy with that.
2085930	2089150	It's like we can actually corrupt Windows, you know.
2089330	2096110	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.
2096190	2100330	So I was like, okay, we need to be a little more serious and we're going to go, you know, for the kill.
2100330	2102370	We won't like mess with the system service.
2102570	2109110	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.
2109550	2112590	And, uh, in a function that doesn't have a stack cookie.
2112590	2113990	So it's a bit of a tall order.
2114130	2119910	But, you know, targets, Broadcom services, uh, third party applications, I couldn't find any that use that.
2119910	2122990	But in the past, I think it used to be but not anymore.
2123610	2128070	Or Windows hello stuff, so the, what handles the fingerprints that we've only been messing with.
2128670	2132850	So I spent so much time, uh, looking at the stack of so many functions.
2132850	2139390	So that's me, uh, you know, when spending hours, uh, matching and be like, is it going to work?
2139390	2140250	No it doesn't.
2140250	2141690	But eventually I found that.
2141690	2143210	Uh, whoop.
2143490	2150150	Uh, that's the, uh, it's a function, it's a DLL that's used, uh, to interface with the Windows biometric framework.
2150150	2156350	So when you have a fingerprint reader, like that's kind of the glue code in between the Windows services and the firmware.
2156710	2160810	And what that function does is takes a handle to an object.
2161350	2163830	Retrieve, uh, the head of that object.
2164150	2166730	Using like, pretty much CV get object.
2166730	2169650	And, uh, yeah, the handle is here.
2169650	2174350	And it turns out the, the, that object is not even in the stack frame of the function.
2174350	2175790	It's in the next one somehow.
2175790	2180530	I don't know how that works, but, but the parent stack frame doesn't have stack cookie either.
2180530	2186270	So this is the best target because we've seen that, you know, we can, uh, overflow that type of stuff.
2186270	2191510	And here is as a straight line to corrupting the return address and, you know, starting a rope chain.
2191870	2198570	Uh, and just to like, summarize, that is being used with the Win biometric service, which run a system.
2198870	2204090	Uh, and you can interface with that stuff with some kind of IO control like interface.
2204090	2205750	And that any user can do.
2206190	2208990	And so that's kind of like the cold, cold trace of the thing.
2208990	2211950	So we can exploit that function that will corrupt all of that.
2211950	2214850	And that is still within, you know, the Broadcom storage adapter.
2215950	2219430	So we can overflow that and corrupt the stack.
2219430	2235530	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.
2235870	2243310	So, uh, the demo here, um, just FYI, I already flashed the firmware with the malicious code.
2243310	2248910	And we just going to trigger the vulnerable code pass and requesting that, uh, object.
2249970	2257050	So, on the right side, you have the, uh, the Windows biometric framework running on those SVC hosts.
2257050	2263470	So we run the exploit and we see here, uh, suddenly it pops Netcat, uh, to start a reverse shell.
2263650	2271030	And from our own stuff, you know, we connect to this reverse shell and, uh, suddenly we get a system shell.
2271970	2273710	So that's cool.
2274770	2277650	Um, so yeah.
2278350	2280190	So far, what have we done?
2280190	2288670	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.
2289010	2291750	And we got, like, uh, system privilege.
2292590	2293730	Can we do more?
2294430	2296850	Why, when am I going to stop, right?
2296910	2299950	Uh, and the other is just a cute little, uh, demo.
2299950	2305410	Uh, the stuff I was talking about, like, you know, that, actually that board, it's so tiny in real life.
2305410	2309650	It's, it has like a ribbon cable that has some USB wires to it.
2309650	2314090	And I was like, can I just plug it into any computer to, like, mess with it physically?
2314510	2317050	Uh, and yeah, that's sort of that contraption.
2317050	2320810	You know, most of those, uh, cables are just, you know, 3 volt or 5 volt.
2320810	2325370	But 2 of them are, uh, USB, uh, data and whatever.
2325690	2327430	And so we can just, like, connect them.
2327530	2332870	Uh, I was going to do a nice, super sleek, you know, circuit board and, you know, I ran out of time.
2332870	2336130	So instead we have our, uh, beautiful setup here.
2336390	2338910	But in practice, you know, that's my setup.
2338910	2341050	Every time you touch a cable, everything breaks.
2341730	2345670	Uh, but, you know, that's why it's, like, you know, ready to be plugged.
2345670	2352610	But when you plug that cable, a new, uh, uh, Dell control, uh, control device pops up here.
2353130	2356330	Uh, because there's a new one that we just connected physically with.
2356410	2360450	And just here to show that, uh, you can actually communicate with it for real.
2360610	2367550	And the, the previous one, uh, so I disabled it for the demo.
2367590	2376590	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.
2376590	2385390	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.
2385450	2388890	So it's a whole new, like, physical attack vector that got unlocked here.
2390290	2391930	So, yeah, pretty quick, right?
2392210	2397450	So, uh, similar, like, cute, you know, overall diagram.
2397450	2400330	There's, like, two main attack scenarios that I wanted to highlight.
2400430	2406950	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.
2406950	2417790	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.
2418110	2426970	And then a physical attacker can also do that and, you know, either, like, bypass the fingerprint or, uh, you know, uh, compromise Windows.
2428890	2431710	So, uh, reports and stuff like that.
2431710	2434990	Uh, we reported that to Dell, you know, like, early this year.
2435070	2436730	An advisory was released in June.
2437130	2441770	We just, I think, released some of these, like, uh, reports, uh, on the Talos website.
2442610	2447430	Uh, many CVs and, uh, a few more are going to come, like, later, like, in the year.
2448270	2451330	And there are, like, two, uh, our two blog posts about it.
2451330	2454190	Like, one level, a high-level overview that was released early this week.
2454190	2460190	And the technical deep dive of, like, 5,000 plus words, uh, that was released today.
2460190	2464830	Uh, and shout out to all the people who helped me get that one published because that was a lot of work.
2465370	2466690	Um, and yeah.
2466690	2468190	So, what can we say?
2468190	2472670	I think the firmware security is, it's not new, but it's, like, so important.
2472910	2479710	I think the, um, we need to understand the security exposure of, like, you know, the things that are, like, inside our systems.
2479910	2483270	That board, like, it exists since, like, 2, 5, 15 years, you know.
2483490	2485950	And as far as I can tell, there's no research about it.
2485950	2488130	There's barely any documentation about it.
2488170	2493970	So, I think it's either, like, us hackers, you know, can, you know, reverse that, document it, share, like, our knowledge.
2493990	2502790	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.
2503110	2503770	So, I don't know.
2503770	2506350	I think that's, uh, pretty much all I have for you today.
2506570	2507910	Thank you.
2507910	2511470	Uh, you can reach out, uh, to me on Twitter and what not.
2511630	2515030	And, uh, otherwise, like, I have a few minutes for questions, I think.
2516310	2517090	Thank you.
