It's either as a boot kit or in some cases as a firmware implant as we will see later. What's good also is that code here is hidden from the OS and the hypervisor. So antivirus, EDRs, or anti-cheat engines won't see these things, right? Now in terms of privilege level this is just a simplification but we can think about it like this. We have our applications, like for instance our browser, running at the very top of ring three. Then we have our OS, ring zero, and if we have a hypervisor it's down the OS of course and only then we have SMM. Now how does this work? We can divide the uh the thing in two phases. We have boot time where the firmware BIOS UFI code will after initializing the the hardware will load the SMM code into an special area of memory called SM RAM. And then it will hand off the execution to the OS loader then the OS loads and as you can see SMM is just a run time concept. It will provide services for the for the platform. For instance power management, security, and the OS can invoke some services from it as well. So how does that happen? Well there's this concept of system management interrupt. When an SMI occurs the processor gets interrupted and then this the the current register set of the processor is saved into the SM RAM into a safety area. And then whatever needs to happen happens some um good feature for the system and it then comes back to the OS. In this case we are doing a synchronous SMI like a software SMI the OS is um invoking a service from SMM. Now we've been working on this area for a bit. Uh we published some some blogs. We've done some some presentations before. How are you on Hexagon? We have a couple of CVEs in 2023 and we also released some tools for um checking for misconfigurations and known issues. Um all of these things that we've done before are mostly related to either misconfigurations from vendors or software vulnerabilities in components. Now we're going to present today is an architectural flaw in the AMD processor itself. So that's very different. And so for that we're going to just see again what is what makes the security of SMM. So we can think on the CPU when it's an SMM mode we have the memory controller in the middle and we can just access this area with where the SMM code and data lives. We can execute instructions from this area. We can write to this area and read. However when the CPU is in normal mode meaning non-SMM, the memory controller just rejects um if if you read from this uh from this memory you're just going to return receive Fs. Writes are discarded and of course execution is disallowed. How does this hap- how is this happening? Well we have um what's called a TSEC region or top of memory segment region. Essentially the firmware after loads uh after it loads SMM at boot time, it will hopefully configure these two registers. And the idea is to overlap um have this region to overlap with all the contents of SM RAM to protect it. We have uh two registers we have the TSEC base and the TSEC mask which is the length. The TSEC mask as you can see have also uh additional fields. And yeah essentially this is the way. The memory controller will see that uh the CPU is executing in normal mode and will just reject to read the content or write the content of the SM RAM. Has to be enabled. That's why the T-valid is there. Now the layout of SM RAM uh basically is up to the vendor to define but most systems out there are going to follow what the EDK2 has which is TianoCore. This is reference code. And uh essentially it's going to consist at the very bottom you can see here um SMM core area. This is just supporting code for the rest of of what's going to be in there. And then for each core we're going to have an SMM base and at a specific offset 8000 from the SMM base we're going to have the entry point. Which is where the processor, the core is going to start executing from when the SMI happens. And then we have a safe state at offset FE00. This is TianoCore right? It can be laid out differently by the vendor. And then we have the SMI handlers at the very top which are going to be the functions that are are going to be useful for for us for the system. Handling power, security or whatever. Um so yeah just a summary of the SM RAM registers. We have the three that we just mentioned and we also have an SMM block. That's very important. Hopefully the firmware code is going to set this bit so that the whatever runs at run time the OS cannot tamper with these registers. We don't want for example at run time having the OS disabling the TSEC location because this will just um update or change the code at the SM RAM location and execute with these additional privileges right? Now this needs to be configured for each core. With that we can see a first difference between how Intel and AMD manage the access to MSRs. On Intel systems these MSRs that are related to SMM are only accessible while the CPU is in SMM. In fact obtaining the SMM base for example on Intel could be considered a leak. On AMD all these MSRs are accessible from ring zero, no problem. Again if we have the SMM block bit set then the configuration cannot be changed. Not even SMM can change the configuration until the next power cycle in which I mean the firmware will take over again and configure this in the same way. But we can now spot the bug in the documentation. This is the same TSEC mask register and the fields just a picture from the documentation. We can see how the SMM block is covering all of the fields except for two over there. These two fields are going to be what we're going to be talking about in this session. And we have T-CLOSE and A-CLOSE. We're just going to focus on T-CLOSE. A-CLOSE stands for the same feature but for a previous region called ASEC which overlaps on the video memory. It's not used anymore so it doesn't matter. But what happens is when this bit is set, the data accesses that the core that the core performs when it's running in SMM are going to be directed to MMIO instead of to SMRAM. And that's cool because as we said before, we can set this bit from ring zero because it's not blocked by the SMM block, right? It actually in the A-CLOSE description it also says hey, don't forget to unset this when you're returning from SMM because otherwise your safety are going to be erroneously read from MMIO. That's bad. The documentation says as well hey, if you have a valid T-CLOSE region and you're in SMM and the T-CLOSE is set, then instruction fetches are still going to be directed to DRAM but data accesses are going to go to MMIO instead. If you're not in SMM then both accesses, both type of accesses are going to go to MMIO. So we can say X86 behaves in a Harvard, like a Harvard architecture. It goes to Harvard, right? If we have our core zero for example running in normal mode, both data and instruction fetches just go to MMIO. If we have our core zero now in SMM with the T-CLOSE off, this is what happens. No problem. We read and execute from SM RAM. However when we set T-CLOSE on, now data fetches go like this. And this is a problem because this portion can be controlled by an attacker. So triggering the condition is super easy. We just need to set this bit, this T-CLOSE bit, and call into an SMI and the system will immediately freeze, hang, or you're going to spot the problem right there. This feature exists because, well AMD wanted to have the ability to reuse the physical address space and have SMM code access an IO device that were using the same SM RAM physical memory essentially. Um, we haven't seen any vendor using this feature. Um, but yeah, that's why. And it was, on what we could track is in 2006 there was this document that first mentioned the feature. So it means it's been around at least for 18 years. Now, for people familiarized with um, biosecurity they're probably going to remember this vulnerability presented by Christopher Domas in 2015 called the memory sinkhole attack. And what happened was that he was able to remap the APIC which is a specific device um, available and overlap it with the T-SEC area and it caused the same effect. Uh, data fetches will go to MMIO instead of SM RAM. Now the difference here of course is that that was only limited to the APIC and it only affected the 4K region where the APIC was overlapped with. The SYNCLOSE behavior changed uh, how the entire T-SEC works. Um, any device in theory could be overlapped, right? Because we just direct any access to the MMIO space. So, we can bring some attack ideas in. Our easy thing will be, the easiest thing will be to just grab any PCI device and hopefully we'll have a good register layout on its bar so that we can take control of the execution at the very beginning of the entry point. As there are multiple integrated devices that we could use, we could just try remapping one of those and based on what we read, the register should become visible at the T-SEC location from the OS. However this failed. We can see here how uh, we have an ethernet controller uh, with its original uh, bar 2 uh, D0714000. We have some registers right here, they're visible registers. And we're going to try to overlap, when we try to overlap it with the SMM entry uh, BFED0000, we can see that we're still reading F's. So, the remapping failed. Registers are not available. Um, we can see that the registers were moved from their original location. Uh, something happened. When we restore, we can see the the the priority of the memory probably failed, right? So what that that led us to try to understand okay, how that does, how how is that working? I have this register called top of memory or TOM. Um, this thing defines a limit between the usable DRAM before 4 gigabytes on the physical address space and MMIO space on top. Now, on Intel, this register has a lock bit. Once it's configured, you cannot tamper with it anymore at run time. But on AMD, it doesn't have such a lock so we can just, you know, modify this and maybe that's good for us. The idea is simple, we have this is uh, imagine this is the layout, right? And we'll move the MMIO space of the TOM that defines the MMIO space to match with the TSEC base. So we have something like that. Maybe then, trying the same trick that we uh, did before could work. Unfortunately, we could move the TSEC, no problem, but it didn't change the behavior that we saw before. In practice, it didn't work. So that led us to dig, dig, dig uh, deeper into uh, into augmentation and we found there are some actual priorities when the core access um, some portion of the physical address space. Essentially determines what, where it's going. And we can see that the TSEC and ASIC mechanisms are listed 4, which means 1, 2 and 3, whatever is listed there has less, less priority than this. And at the, at number 1, we can see the TOM is, is listed there. So we have, that's why it never worked, right? It would have never worked. What's at 5, where we have the MMIO configuration space and the APIC? Uh, that makes sense. We, the APIC was used before in the Intel attack. The MMIO config space we cannot use really. Um, and then at 6 we have this Norbridge address space uh, routing but uh, that probably stands for older architectures. This is not seen in modern, modern stuff. So we cannot use it. For the APIC, we cannot really use it and we're going to explain why. But for that, I'm going to give an analysis of, of um, how the SMM entry point code works. When the SMM, when the SMI occurs, the SMM core uh, that, that the core um, executing at SMM starts executing in real mode. In 16 bit mode, flat. No protection whatsoever. What it has to do is quickly go to protected mode 32 bit and then goes to long mode and then passes the execution to the handlers. This is a very simplified view. Now, that first step going to, from real mode to protected mode is, is key, right? That's the first thing that needs to happen. For this, um, on x86, we need, essentially are enabled segmentation. Uh, segmentation provides um, the ability for the, for the core to see the memory in a segmented way. That's, that's how it's called. Essentially, we can have different segments for memory and assigns uh, different permissions or like um, the ability to execute code or, or just read data and stuff like that. We have this key data structure called global descriptor table of GD or GDT. And we have a register on the processor that is called GDTR that's going to point to the base of our GDT structure and it's going to have a limit in bytes. And so the GDT is just really an array of descriptors. And we can have different types of descriptors. We can have, we can have code descriptors, data descriptors. Each one is going to have a base. The first one is never used. That's why it's called, it's called null descriptor. But then, when we have a jump, you can see we'll have um, a jump. It's not only having an offset like a target location but it's also going to have like a segment selector right here. That segment selector picks the descriptor we're going to use for the, for, for our, our code segment. And then the top, the, the offset is added to the base that is indicated by the GDT. Forming the final linear address. With that we can do uh, an analysis of um, the EDK2 SMM entry point. Essentially um, we can see that at the very beginning we are moving into the register BX, the entry point plus 4D. This is, this is a decom, like um, extracted from a, from, from a compiled um, SMM code. So you can see at 4D right there we have a GDT description ready to, to, to be loaded into the GDTR. The next instruction that matters for us is the load GDT. This is the instruction that is going to load the GDTR with the content that BX points to. And finally, we have a jump over here that's gonna perform the actual um, going into protected mode. And it has the selector of code as well and the offset. Now, with this, what, what will happen if we over, overlap a device that we control on the entry point? And we control offset 4D. What will happen is that the load GDT will be loading something that we control. So we can load our fake GDT right? So that's what we're trying to do here. We're trying to get control over the offset 4D with any device that we can find so that the, the fake GDT then provides the descriptors we need and we can take control and jump down there. That's the whole idea of the attack. And that's why the APIC is a problem. Two things. First, the system becomes unstable when the APIC is moved. Super unstable. Second, the APIC racers are not useful for taking control in the way we need. We can see that at 4D we have this reserved regions with all zeros. Rights are discarded here. We're not able to control here and if we load a GDTR with all zeros we're essentially saying to the processor, hey, here's an empty GDT. So this won't work. And at this point we found another device not documented by the, the specification that also has priority over uh, the TSEC region. That's the spike controller and Christophe's going to describe it for us. Alright. So the spike controller is a very nice device for us because it's present in all the systems we've tested and it's basically used to access the spike flash on um, AMD uh, systems. So for example for reading, writing, erasing the spike flash, it always goes for the spike controller. And it has a couple of key features that are really uh, interesting to us. First of all, we can relocate the bar over the SMM entry point. Secondly, the portions which are interesting to us at offset 4D, we can control them. And three, it actually takes precedence over uh, SMRAM when TCLOS is enabled. So with that in mind, what we will do for our attack is simply take the spike bar, relocate it over the SMM entry point of core zero, and then afterwards manipulate the values at offset 4D within that bar. Um, the um, registers that actually correspond to that portion of memory in the bar uh, are the memory range and ROM protection zero register. Those were used in the past to uh, lock down access to the spike flash, but mostly these are not configured, they're not fixed, so we can fully control them. On some systems they are fixed, but actually they are fixed to values which are still useful for us. So, before I dive into the exploits, uh, I also want to uh, show you a little bit our debugging stuff because it's a little bit special. Um, so we were facing actually two challenges uh, when we tried to develop the exploit. First of all, we didn't really have a way to know whether our payload ran because the system just crashes, reboots, and memory is just all wiped. Uh, and secondly, we didn't really have any debugging framework for SMM. Um, and like for example when crashes happen, we want to be able to modify the code however we see fit. So to resolve the first issue, we actually took a PCI squirrel, which is typically used with PCI leach for DMA attacks, but the nice thing about it is, actually is that it has a bar buffer, as we call it, where when we write to it, it actually survives across reboots. So for instance, a payload can write a value to uh, the bar buffer, kind of like a checkpoint so we know it ran, and then when the system reboots, it's still going to be there. Right. And if we want to modify, for example, for the second issue, if we want to modify uh, code in SMM for some extra debugging capabilities, for that we just um, injected a firmware implant, uh, that loads a nice SMM module that allows us to do all of that. So the setup looks like this, we just have the PCI squirrel connected to our target device via an M2 uh, adapter, and all of this is powered externally by a power supply. So, it's time to get our hands dirty, so let's take a look at how uh, the exploit looks like. In the first attempt, uh, we remap the spy bar, just like mentioned before, over the SMM entry point of core zero, then we tweak uh, these values at offset 4D. We create a fake GDT in the beginning of the address space, uh, with the, with a nice base address that will allow us when the jump happens to redirect the execution to our own payload. And then when we uh, execute the SMM entry point code with TCLOS enabled, what's going to happen is uh, the old GDT is actually going to load the GDT register uh, with a value that points to our own fake GDT, so that's great. And afterwards, when the jump happens, a descriptor from the fake GDT is going to be taken that we control, um, and it's going to be used as a base uh, for the jump. So, and um, this is going to redirect the execution like this, at least in theory. So, um, an interesting detail is actually how we pick the base address in the GDT descriptor, um, and for that we have to understand how it normally executes and how it executes with TCLOS in this case. So, um, when the for jump happens, um, and the normal execution, what happens is the GDT register is going to point to a GDT within SMRAM where it's nicely protected, um, and the segment selector is going to index into that table, um, and the base is going to be actually fixed to zero. Which means with the base of zero when we add it uh, to the for jump offset, what's going to happen is the linear address is going to be the same. Now in our case, actually we have a bit of an issue. We want to read the execution, um, outside of TSEG. The only problem is that within the first four gigs of memory, after TSEG, there's not really any spot where we can put a payload, right? So, if we increase the base a little bit, sure the instruction pointer is going to go a bit more up, up, up, up, and the address space, we don't really have DRAM over there that we control. So we wondered, okay, what happens if we actually increase the base such that when we, uh, the base of the GDT descriptor, such that when we add it to the for jump offset, it actually overflows. Um, yeah, it just overflows. So we thought, okay, this isn't going to be possible, but actually it was. Uh, this is nice because, uh, if we choose the base sufficiently big and we add the offset, we can actually make it wrap around and make it jump to our own payload in the beginning of the physical address space. The beginning of the physical address space, we have DRAM there, great, we control all of that. So, uh, that was one of the key takeaways actually that we had from the research as well. So this worked, our payload actually ran, and we saw this because it would write a value, this nice checkpoint to our bar buffer, but the system would crash and we wondered, okay, why is this happening? Um, the reason was the SMM safe state. So like Enrique mentioned, when a CPU goes to SMM mode, it actually saves the current register state into the, uh, SMM safe state. When it returns, it just restores it. What happens is when TCLOS is enabled, actually the writes, when the core enters SMM, are going to be discarded, which means when we return with TCLOS disabled, actually it's just going to use stale values that were still there, that were stored before. And to resolve this, the trick is actually pretty straightforward. We trigger the SMM twice. One time, um, without TCLOS and the second time with TCLOS. So we first put the core zero into a known controlled state, and then trigger an SMI without TCLOS. This is going to prime the SMM safe state, and afterwards when we trigger the bug, with TCLOS enabled, the code is going to go for the same execution path, and it's just going to reuse the values that we stored before. So that worked, but unfortunately it crashed again. But this time around we did see actually that the, uh, the core zero was returning from SMM, so that was great. We had full control of core zero, OS code was running, we saw our checkpoints, great. But no matter what we tried, this damn thing was still crashing. Um, so we spent an eternity debugging this thing until we stumbled into this. When we enable TCLOS, what happens is, we enable it on core zero only, but actually it gets enabled on both cores. Core zero and core one. Um, and we found that the culprit for this is symmetric multi-threading, so this is AMD's implementation of Intel hyper-threading. Um, and what it does is it divides a physical core into two logical cores. And some of the resources on these logical cores are shared and some of them are not. So for instance the SMM base MSR is separate, so every logical core has a different base MSR. But the TSEC mask is actually shared, which is what we just saw, right? And we wondered, is this the actual issue? Because we assume when an SMI gets triggered, that only one core goes into SMM at the time. And we put this to the test and what we saw is the following. When we have multiple cores running in normal mode, so outside of SMM, um, when we, when one of them triggers an SMI, an interrupt gets asserted on all of the cores and all of the cores are going to go into SMM mode and going to start executing the SMM entry point codes, um, for each and one of them. So, our assumptions were actually wrong, right? We assumed the SMIs are local, but they're actually not. And we thought that this was actually the case because the IDK2 code has a so-called rendezvous routine, which will, every time you enter into SMM, this routine is going to be triggered and that core which entered into SMM will send an explicit interprocessor interrupt to all of the logical cores to explicitly pull them from whatever state they were in into SMM. And, well, what's the point of that if actually all the cores always go into SMM anyway, right? Um, and we dug a little bit deeper into the documentation and we found that the IO hub seems to be responsible for this to, uh, basically assert this interrupt on all of the cores. So, we're out of luck. So, to summarize, we had all cores always going into SMM and T-Cores being enabled on two cores at the same time and not just one as we initially thought. And this will actually make just core 1 go haywire, right? We have control of core 0 but core 1 is, uh, just going to go nuts and crash the whole system. So, to tackle the problem, we had to get control of core 1 some way. Uh, and we dug deep into our bag of tricks to really, uh, see if maybe there's a nice elegant solution to this to just take core 1 out of the running. Um, so we tried to, um, we tried to find another device to overlap with the entry point of core 1. There was none. Uh, we tried to disable SMT in the BIOS. That also didn't work. We tried to, uh, use the, uh, so-called init IPI and also the SKL instruction to put core 1 into a state that would actually make it ignore SMIs. That also didn't work. And finally, we also tried to send a so-called SMI IPI which, at least according to the documentation, would allow us to trigger an SMI on individual cores. And it also didn't work. So, despite the documentation indicating one thing, in practice, we didn't manage to, uh, get it to work. So, we're running out of options and we had to take a step back and analyze the problem. And we realized, okay, the LGDT has the actual problem because it's going to be load- loading the GDT register with all Fs, right? So, is this, is there maybe some way we can actually still take advantage of this? Um, so, when the supplementary point normally executes what happens with the GDT register is, it's going to be loaded with a nice value for the base. It's going to be pointing to the GDT within, uh, SMRAM, right? And afterwards, the segment selector is going to be taken, added to it, uh, and the base within that, uh, descriptor is going to be used to calculate the final linear address. Now, in our case, what's going to happen when TICOS is enabled, uh, the GDT register is going to be loaded with all Fs, both the limits and the base. And what's going to happen then is, when the for jump, the segment selector is going to be added to it. And once again, we have our good old friend's integer overflow. It's actually going to result in the physical address 7. And this is actually awesome because address 7 in the physical address space, once again, that's DRAM. We control DRAM. So, we can take advantage of that. We can put our GDT at the beginning of DRAM and we can just overflow this thing like this. And afterwards, uh, from the GDT we control, we set a nice base so that afterwards, uh, the code jumps wherever we want it to. So, to summarize, we have two types of wraparounds. One is between the GDT descriptor base and the for jump offset. And the second one between the GDT register base and the for jump segment selector. And the nice thing about this is, we can actually reuse the same fake GDT for both core zero and core one. And the added bonus is, we don't even need the spy bar anymore. The only thing that we really have to take care of is the SMM safe state. Once again, for core one. For core zero, we just do the same thing as before. But core one is going to be running in some unknown state. It could be running in ring three, ring zero, just in an unknown context. We have to bring it to the same controlled state as core zero. And we do so by using a kernel synchronization API. Which on Windows is the deferred procedure call. Or on Linux, symmetric multiprocessing. And basically once that's done, we have both cores in a known state. And we can use the same trick we did for core zero. So, all good things are three. So, let's try again. The exploit this time is greatly simplified. And the only thing we have to do is, we create the fake GDT in the beginning of the address space. We choose the base address within the descriptor accordingly. And that's it. And then when we trigger, when we enable T-Close and run the uh, SMM entry point code again, the old GDT this time around is going to point to the very end of the address space of the first four gigs. But then when the far jump happens, it's going to wrap around. It's going to fetch the GDT descriptor entry from the beginning of the address space from our fake GDT. And then afterwards it's going to redirect execution for both core zero and core one to our own payload. And it finally worked. We managed to control both cores, core zero and core one. Uh, our payload would execute with SMM privileges and uh, it would return gracefully from SMM to the operating system and nothing would crash. And that was great. There were only a couple of things that we wanted to improve uh, in our exploit. And that was um, to reload the GDT because the base actually is um, a bit off. So we just reloaded the GDT so that the base address is equal zero again so that we don't have strange misalignment issues. We set up long modes, so page tables, stack pointer, etc. so we can execute like uh, any SQL that we want. Uh, and then we also install an SMI hander so that we only have to exploit the bug once and then basically we have kind of semi persistence until the system resets. Right? So, for the demo, just to show you I'm not selling just some snake oil. Uh, we have a system over here which is a Huawei Matebook D16 from uh, 2023. And you can see when the system boots, it actually shows the Huawei logo. That logo is embedded in the firmware code. For that, um, so for our exploit we're actually going to modify that uh, that logo. So, um, we're going to run our exploit with uh, kernel privileges. So you'll see over here that we have to elevate privileges and it's going to be triggered via a malicious driver. And then our exploit is going to do uh, three things. At first it's going to use the synclose issue to elevate privileges to SMM. Then it's going to disable the spy flash protections. And then afterwards it's going to write to the spy flash the portion where the um, boot splash logo is actually residing. This takes a little while, about 15 minutes, so we just fast forward that portion. And you can see okay, it shows done patching, all good. And at this point we just reset the system and pray that it works. So let's see. Yeah, this one takes a little while. And... there we go. We're successful. So, I'm actually going to show you how to do this. So I mean this was just one example of what we can do with this kind of access into the system. But let's take a more systematic approach to see whether this works on all systems, just on some. What does this actually depend on? So the next attack paths depend on how the platform is actually configured. Um, so every vendor configures certain features that AMD provides to them. And specifically there are two of them which are key to this. One is room armor, which can be used to restrict access to the portions of the spy flash. And the second one is platform secure boot, which is AMD's equivalent of boot guard, which will verify the initial stages of the firmware code. Um, so if everything is enabled, the very least thing that we can do is we can write to a portion of the spy flash where you have your variables live. So for instance, in these variables you're going to have things like the secure boot keys which are used. So we can break secure boot. That's nice. Um, but if nothing is enabled, actually we have firmware implants. I'm going to explain in a moment what the difference actually is. So in the first configuration where everything is properly configured, we see, okay, we escalate from the operating system to SMM. And from there we can write the, let's say, firmware data portion of the spy flash where the configurations are. So we can manipulate the secure boot keys so that afterwards we can actually load our own malicious boot loader before the OS loader runs. On the second configuration where the PSB is not enabled, we have basically the same scenario. Um, Roam Armor will still restrict write access to, um, to the data portion. And we can, we can still just, um, uh, inject our own boot kits. And the third configuration we can write to even firmware code, but that's going to be still verified by platform secure boot. So, okay, and these three, we have the same scenario. We can just inject a boot kit, which is still nice because it runs before the OS loader. Any protections provided by the operating system would still be, um, rendered null. But, in the last scenario where none of these features are enabled, what we can do is we can inject our, uh, malware into the spy flash, into the firmware code portion of it. And when that happens, uh, is what we're going to get is we can, um, run our own malware at the very earliest stage of the boot process. And there's a key difference here between a firmware implant and, uh, a boot kit, is that this attack actually is resistant to, uh, to OS reinstallations. So even if you wipe your drive, it's still going to be around. Um, and even if you try to push a firmware update from the operating system, it's still going to be around because the, uh, the malware can just say, well, the update was successful. Um, and the only way to really get rid of it at that point is to take apart your system, take a spy programmer to read out the spy flash, inspect it, and if it's infected, um, just, uh, rewrite it. But typically it's not really in the repertoire of a typical IT guy, right? So to illustrate how prevalent actually these misconfigurations are, we did some research last year on that and we saw that the majority of the systems have none of the security features actually enabled. Which means all the systems which have none of the features enabled are vulnerable to firmware implants. Which is pretty bad. And to put a cherry on top, we also found that once you're infected with that kind of, uh, firmware implant, you can even disable platform secure boot forever by burning a specific fuse so that your system remains vulnerable to firmware, uh, implant reinfections forever. Sweet. So, let's wrap up the presentation. Thanks Christophe. So, yeah, in terms of affected systems, um, I think we covered most of them, right? Pretty much all of them. Uh, yeah. Um, our tests were on Ryzen, mostly. Several laptops. Uh, but turns out the Threat Reaper series is also affected. Epic series is also affected. Meaning servers. Um, and yeah, uh, due to the longevity of this, this, this thing, we can estimate the total number of affected chips are in around the hundreds of millions. Um, there's an advisory from AMD published now, um, where more information on the system, the affected systems and cover, uh, there's a microcode update now. Information is there, so you can check. Mitigations. Yeah, AMD, as I just said, provided, um, with microcode updates. However, it might not cover all of the affected systems. Of course, um, in terms of what an OEM can do, they can just modify the SMM entry point code to detect if the T-Close bit is set. And if it is, then just abort the execution and this, this will just render the exploitation unfeasible. Uh, this can even be done at the EDK 2 level for AMD systems, right? And we really haven't covered here core boot, but core boot is affected in the same way. We just, I mean, um, core boot at the very beginning of the entry point performs a low GDT. They have to go to protected mode as well, so it's, it's the same thing. Um, and actually core boot, they are checking for this, uh, for other issues as well at the entry point, so they could, they could very well do this. Um, and users, well, they can, you know, a hypervisor could trap the access on the TSEC mask MSR, so that's another, uh, way to stop this. Timeline wise, well, we reported this back in October of 2023. A CVE of 2023, uh, 31315 was assigned in November. And then we discussed mitigations and impact with AMD over the course of the next months. Um, and yeah, finally yesterday, um, the advisory was published and we are here at DEF CON today. This was the official AMD response. Essentially, we work with them in a process of, uh, responsible disclosure. And yeah, they've been great to work with. Conclusions and takeaways. Well, the vulnerability has been around for nearly two decades. Um, the complexity of the architecture clearly plays in favor of attackers and we see this, uh, with the flexibility of, of, of the GDT. Um, the two types of wraparounds, the, the, the byte level, uh, um, address, um, like granularity that there is with it, no problem. Um, and also with the, how the MSRs can be accessed without any restriction. Uh, that, that's, that's all good for attackers, right? Um, these things combined are what made this exploit approach possible. It might be on other exploit methods too. Um, but yeah, all of this of, of course requires an in depth understanding of the architecture. And in the end we managed to exploit this without requiring physical presence. So that's very good. And yeah, exploit code will be released soon. So stay tuned for that. Questions? Is there a microphone? Hello. Um, it wasn't entirely clear to me, is the spy flash chip you're referring to on the, uh, CPU die or is it external? External. Okay. Yeah. Um, so I'm sorry if I understood your question correctly was about bypassing uh, anti-cheat systems uh, using this method? Nope. Installing something to bypass uh, the anti-cheat systems and uh, uh. Once you achieve arbitrary code execution in SMM, uh, yeah, pretty much uh, like modern anti-cheat systems running uh, either kernel or even maybe a hypervisor level could, could, could run. And this, this runs even below that. Does that make sense? Yeah, but uh, since uh, MAD has disclosed the processors that are vulnerable to this attack, it is the, it is not disclosed in PlayStation 5 which has MAD. So that's what I was asking if maybe it's also, yeah. Ah, okay. But, but yeah, I'm sorry, I, I don't know, uh, I, I don't understand your question correctly. The, the PlayStation 5 hypervisor blocks the MSR. If it's for that, yes. The, the, yes. We, we check that. And it is being trapped by the hypervisor layer on the PlayStation. Yes, sorry. Hey, thank you. Um, quick question. Um, why didn't disabling SMT prevent the system from becoming unstable? Uh, yes. So the SMT, when we try to disable it, um, essentially what happens is the other logical core will just not run, but it'll still be there and it will be, all the entry points will be already configured by the firmware, if that makes sense. So when the SMI happens, it was a level underneath, I mean, it won't, you won't see the processor available at the OS level, but all, all the layout and, and, and, and, at the, at, yeah, at the deeper level, the, the logical core is still there, if that makes sense. Yes, it does. So we have to deal with that regardless. Yes, we tried. Thank you. Hello. Do you know what, uh, changes AMD microcode update made? Um, I'm sorry, could you, could you speak up louder? I'll say. Do you know what changes AMD microcode update made to mitigate this issue? Oh, interesting question. Uh, yes. Uh, no, I mean, officially we don't. Uh, um, what, uh, what, what, what, what, what, what, what, what, what, what, what, what. Uh, we don't. That's a little bit short of it. Uh, yes. I think we're good. Okay. Well, if no more questions, thank you so much for joining us today.