Good? Alright. Hello everyone and welcome to my talk. Today I'm going to share with you my journey of researching downgrade attacks on Windows and their severe implications on Windows' platform security. My name is Alon and I'm a security researcher at SafeBridge. I'm 22 years old and mainly self-taught. My focus reside in operating system internals, reverse engineering and vulnerability research and before joining the security field I was a professional Brazilian G2 athlete where I won several world and European titles. This is what I will be talking about today. We have a lot of interesting topics to cover so let's jump right in. Starting with the research background. So first things first, what are downgrade attacks? Downgrade, downgrade attack is the act of downgrading immune and fully up to date software to uh, to uh, an old and vulnerable software. And this act allows to expose past vulnerabilities in updated software and then exploit such vulnerabilities. My research started from, from studying the Black Lotus UEFI bootkit and what caught mine and everyone else's attention with Black Lotus was the fact that it was able to bypass secure boot on a fully updated Windows 11. But in fact, Black Lotus did not exploit a new zero level vulnerability. Instead it exploited an already known and patch vulnerability. And that was of course done by employing a downgrade attack. To give you a better understanding of how Black Lotus' downgrade was formed to bypass secure boot, you first need to know what is secure boot. So simply put, secure boot is a security feature which is responsible to verify that each component in the boot chain is digitally signed. It is very simple. If you are not signed, you are not loaded. And so the days of floating a custom bootkit by replacing the boot manager are gone. Instead, what Black Lotus did was to downgrade the Windows boot manager to signed but vulnerable version of it. And this allowed to then exploit an old vulnerability sourced in the vulnerable boot manager to then bypass secure boot. Microsoft's mitigation against secure boot downgrades included multiple actions with the main one being revoking vulnerable boot managers and boot applications. And revoked images are of course not allowed to be loaded. But here comes the critical question. Are there any other components other than secure boot that may be vulnerable to downgrade attacks? My goal in this research was to evaluate the state of downgrade, downgrade attacks on Windows and to find if components other than secure boot may have been overlooked. Now I'm sure you're all familiar with bring your own vulnerable driver attacks targeting third party drivers. My vision was to target first party entities, not only drivers but even entities residing in a lower level than the kernel. My vision was to create a new category of bring your own vulnerable Windows. To kick off my research I've had to first form a reliable downgrade ability which led me to define what would be considered a perfect downgrade attack. So first the downgrade must be fully undetectable so that EDRs will not block the downgrade. Thus I aimed to perform the downgrade in the most legitimate way possible. Second, the downgrade must be invisible so that future updates, so that the downgraded components will not appear up to date even if they're technically downgraded. Third, the downgrade must be persistent so that future software updates are not overriding the downgrade. And then fourth, the downgrade must be irreversible so that scanning and repairing tools will not be able to detect or repair corruptions. Having the downgrade requirements defined I then looked for a suitable component. But before I expose the target component I want to ask you, what would be the least expected component to perform downgrades? That would be of course Windows updates. So let's talk about Windows updates and see if they can be abused to perform downgrades. The Windows update architecture is as follows. We have an update client and an update server and they communicate over com. For those of you who are unfamiliar with com, this is just an enterprise communication method in Windows and this is how the client and the server communicate. Administrator is usually forced on the client side and trusted installer is always enforced on the server side. And the last piece and the most important one is that system files once owned and updated by Windows updates are only accessible to trusted installer. So even administrators or anti-system cannot directly modify these system files. And this is where I found the first design problem in Windows updates. Administrator to trusted installer is not considered a security boundary and there are multiple working public proof of concepts of such elevation. So the Windows update team attempted to secure the update process by enforcing trusted installer. However, since updates are only accessible to administrators, trusted installer is rendered completely ineffective. The only issue though is that administrator to trusted installer elevations are considered malicious and are blocked by EDRs which of course contradicts my first downward principle which is being fully undetectable. Now I could of course try to bypass the elevation detection which may have been possible but then I would have to implement the update process myself which could still be seen as malicious. And so the best option for me was to find the flaw in the update process which solves all of those problems. So let's take a look on a simplified flaw of the Windows update process. First, the client asks the server to perform an update given an update folder. The update folder is supplied by the client. Second, the server validates the integrity of the update folder. Third, following the verification, the server operates on the update folder to finalize the update files and these are saved to a server control folder, one that is not accessible to the client. And so at that point the client cannot modify the finalized update files. Fourth, the server saves an action list to a server control folder as well, not accessible to the client. This action list is named pending.xml and it contains the update actions to perform. So for example it specifies the files to update, the source and destination files, et cetera. Lastly, when the operating system is rebooted, the action list is operated on and the actions uh and the update actions are performed during the update, during the reboot. Now the client only controls the initial update folder and so I decided to look at this folder first and see maybe I can modify it resulting in custom downgrading update files. And as we already know, integrity checks are performed on the update folder so let's see how well the integrity checks are performed. The update folder contains update components and each update component contain a manifest, mom, differential and catalog files. The mom files are Microsoft update metadata, they contain metadata information, so component dependencies, installation order, et cetera. The manifest files contain installation specific information such as file path, uh registry keys, which is sourced to execute as part of the installation and more. The differential files are delta files from the base files and so a base plus delta would result in the full final update file. And lastly we have the catalog files which are the digital signatures of the mom and manifest files. Catalogs allow signing multiple files at once instead of having the file that we want to sign embed its digital signature inside of it. In addition, the catalog files are digitally signed themselves which makes it impossible to modify them or any of the files that they protect. So we can't modify the catalogs and we can't modify the files that they protect, that they sign. To recap, only cat- only the catalog files are digitally signed. The manifest and mom files are not explicitly signed but they are signed in the catalog files. And the differential files are not signed at all and the differential files also control the final update file content which is very, very interesting. Is there any chance the differential files were left behind in terms of verification? No luck because the expected update file hash is hardcoded in the manifest and the manifest cannot be changed since it will break its signature in the, in the catalog. Now at that point I decided to look at the action list. I knew that it's con- it's, it's, it cannot be changed because it is trusted in folder enforced so I cannot change the action list directly but I also knew that the update up, that, that update process is performed over multiple reboots and so I assumed that the state of this list is saved somewhere. And if I could modify the state, maybe I was, I would be able to uh, create a custom downgrading action list. So I searched the action list path in the registry and then I found this very interesting key named POQXX CMD line. It holds the executable that parses the list and the list path. I then looked at the security attributes of this key and I was extremely surprised to find that this key is not trusted in solar enforced. And this allowed me to control all of the update actions. This is how the action list looks like in practice. It is an XML file that gives the functionality of creating files, deleting files, moving files, hard linking files, creating registry keys and values, deleting keys and values and much much more. In order to downgrade we can use the hard link file action and the source will replace the destination. To initiate an update all that is needed is to set the trusted in solar service as auto start and add the action list and its identifier in the registry. The identifier is a dynamic number which is compared with the action list identifier. So the identifier is needed for integrity purposes but since we control both the registry identifier and the identifier in the action list because we control the action list path then this is not a problem because we can adjust them accordingly. Now the most important thing is that none of these 3 actions is trusted in solar enforced. And this allowed me to update the system with a custom downgrading action list. All of the integrity verifications are bypassed since the action list is assumed verified as it is created post verification. There is no need to perform the malicious trusted in solar elevation. Instead Windows updates does all of the work for me and this is a complete Windows update takeover. Now revisiting the downgrade principles of course the downgrade is fully undetectable. There is no better way to downgrade Windows. In terms of invisibility the system will appear up to date as we basically updated the system and we didn't uninstall anything. In terms of persistency of the downgraded components I found that the action list sparser is not digitally signed and so I patched it to install empty updates. And as a result even after the downgrade when new updates are available they will be falsely installed. And in terms of recovery the integrity and repair utility is not digitally signed as well and so I patched it as well as part of the downgrade. And the patched version will no longer detect any corruptions. With that let's see the first demo of the day. This demo will demonstrate downgrading a kernel driver named afd.sys to an old and vulnerable version of it by using the Windows update cover. And then we'll see how the same kernel driver is exploited to achieve kernel code execution. So first we check the Windows version and then we will make sure that we are fully up to date and that we have no missing updates as you can see. We'll then uh use CMD and we'll use the seek check utility to see what is the current version of afd.sys, the driver that we are targeting. Is it fully up to date? You can see that the current version is 3672 which is patched to the vulnerability that I want to exploit. If we use task list to find the current process ID and then we try to actually exploit a vulnerability which the exploit gets a process ID and tries to elevate the system you can see the LP failed because the driver is patched. So we'll then use Windows downdate which gets a config file that says downgrade the afd.sys driver to an old and vulnerable version of it. You can see that that patch succeeded. We now need to restore the machine in order for the update to take place. You can see um we we fast forward a bit, we'll log back into the machine. After the update we'll launch CMD and let's see what is the current version of the driver that we are targeting. Was it updated? And you can see that the current version is the base version. Although the system was updated, what actually happened is that it downgraded. We can see that we are not currently system. If we try to exploit a vulnerability again, we get a process ID and then we execute the exploit again. You can see that it succeeded and we are now anti-authority system. Thank you. Thank you. We're just getting started guys. If we check for updates you can see that we are fully up to date. So what did we achieve so far? We gained a perfect downgrade ability and we gained kernel code execution. Our starting point was administrator so that was an administrator to kernel elevation. Now administrator to kernel is not considered a security boundary in Windows, but gaining kernel code execution is still a threat and of course it gives much more functionality than administrator functionality. Although it is not a boundary, admin to kernel is still a threat and a serious one. Because nowadays lots of users are still running as administrators and running as administrator is also the default on Windows. And as a result, many users could easily compromise the kernel and this is an issue that Microsoft aimed to solve. Microsoft's solution was to deprivilege the kernel to make kernel access less valuable than it previously was. And the way that this privileging, deprivileging was done is by introducing a feature called virtualization based security or VBS for short. VBS is a secure and isolated virtual environment powered by the IPV hypervisor for isolation. And again the reason that VBS was introduced is because the kernel is assumed compromised and can no longer be trusted. There was a need for a secure place to implement critical security features and store secret keys. VBS features include the famous credential guard, HVCI, system guard secure launch, um, shielded VMs and much more security features that really improved the security of Windows. And now that I've praised VBS so much, you may wonder how all of this works in practice. So before VBS, this is how Windows architecture looked like. We've had user mode in ring three, we've had kernel mode in ring zero and then we've had the hypervisor running in ring minus one. With VBS, the hypervisor introduces virtual trust levels or VTS and the way it works is that the higher the VTL, the more privileged it is. So simply put, VTLs are like virtual machines. Lower VTLs should not be able to access memory or compromise higher VTLs. Currently in Windows, only two VTLs exist. VTL zero known as normal mode and VTL one known as secure mode. Normal mode contains the original operating system and secure mode contains only the critical security features and mitigations as well as key isolation technologies. And everything that is implemented in the secure mode should not be compromised from normal mode. Even if we talk about normal mode's kernel. Now, when looking at security features and mitigations, the first thing to do is of course to check if the security features that we are targeting can be easily turned off. I wondered if VBS features could be easily turned off. Since they protect from administrators, configuration modifiable by administrators would be ineffective because an attacker would just turn off VBS instead of dealing with it. The way that VBS protects such disablements is by implementing a feature called a UEFI lock. The UEFI lock is a UEFI boot service variable that holds the VBS configuration. So if VBS is configured with a lock, the lock is a source of configuration instead of the Windows registry. Then changing the registry configuration will have no effect. The UEFI variable is a source of truth. And of course, the boot service variable that holds the configuration cannot be accessed in run time from the operating system but only during boot. So this is a very simple and reliable protection. If the user really wants to disable VBS, if it's configured with a UEFI lock, he must load a custom UEFI application signed by Microsoft. And this UEFI would then ask the user during boot to physically approve the disablement. And only if the user approves, VBS is disabled. Now the key element here is that all of this is performed during boot and the assumption is that only signed code is allowed to run because of secure boot. And the only signed code that touches the configuration, the variable, requires physical access. So without physical access to the target machine, it should not be possible to disable VBS. With the ability to control any file on the operating system, I wondered what would happen if I tried to replace the secure kernel or the hypervisor, hypervisor powering VBS with invalid files. For example, files that are not digitally signed, attacker controlled files. I believed that the result would be the machine booting into the recovery environment and that is because invalid files are a sign of compromise. Instead, I was extremely surprised to find out that if the operating system loader fails to validate one of VBS's files, it would just boot normally, abandoning VBS. I repeat, if the OS loader fails to validate one of VBS's files, it just boots normally. And this can be used to disable VBS by passing the UE file lock. And as far as I know, this is the first bypass of VBS's UE file locks and this is a very simple bypass. All we need to do is to replace the secure kernel, the hypervisor of any VBS's files with invalid files. Very simple. So now it's time for another demo of chaining all the capabilities gained so far together. In this demo I will show credential extraction against the most restrictive settings. Those settings will be PPL enabled for LSS with UE file lock protecting LSS dumps. Credential guard will be enabled with UE file lock protecting secrets in VTL1 and Windows Defender will be up and running. The way that all of these will be bypassed is by first reverting the PPL full patch to allow PPL bypass. Second, disabling credential guard by passing the UE file locks. And third, turning Windows Defender on functional by invalidating the main Defender executable MSMP engine. Now just before I show you the demo, it is important to understand that credential guard and PPL for LSS are complementary. So if only credential guard is bypassed, LSS cannot be dumped. And if only PPL is bypassed, credentials are encrypted and not usable. So this is what you will see if you try to dump credentials on a system with credential guard on. So let's see the demo of bypassing credential guard, PPL for LSS and Windows Defender all in once by utilizing downgrades and the UE file lock bypass. So first we check the Windows version and then we'll make sure that we are fully up to date. Which you can see we have no missing updates. We'll then use SKTool to see um, which is still supp- supplied by Microsoft to see what VBS features are running. You can see that the uh, the VBS is protected with UE file lock. It's locked in UE file and credential guard and key guard are currently running. We then use system informer to see what is the current state of LSS. You can see that it's run, it runs as PPL and then let's check the Windows Defender is up and running as well. We try to copy malicious files outside of the excluded directory. You can see that we can't use them and that Windows Defender detects them as malicious because it's up and running. Now it's time to execute the attack. We will use Windows downdate. We'll change directory to the Windows downdate directory and we will supply Windows downdate with a config file that will say, downgraded PPL fault patch, bypass the UE file to disable VBS and invalidate the main Defender executable to turn it on functional. You can see that the attack was successful. We finished the attack. These are the files that were updated and all we need to do is restore the machine. So you can see, you will see now that updates are underway but in practice what happens is that downgrades are underway. We fast forward, we log back into the machine. Now let's launch SK tool again to see what is the current state of VBS. Now you will see that the secure kernel is not currently running, credential guard is not currently running as well. So the UE file has been bypassed and credential guard is no longer protecting credentials. We'll then launch uh system informer and we will see what is the current state of others. You can see it runs as PPL. So we'll need to bypass it. And now let's check what is the state of Windows Defender. We'll copy malicious files outside of the excluded directory. And you can see that it worked successfully. So we defeated Windows Defender as well. We'll launch CMD again and now it's time to bypass PPL. We'll change directory, we'll get the process ID of others and then we'll try to execute PPL fault. And remember PPL fault should have been patched in the system and it is seemingly patched in the system. We'll execute the attack and let's see what happens. So PPL fault was successful. The dump file was created on the desktop as you can see. We'll now use Mimikatz to parse the dump file and extract credentials that should have been protected by credential guard. We'll load the dump file and extract credentials. You can see credentials are extracted and this credential should have been protected by credential guard. Now just to make sure that we are fully up to date and that everything looks correct, we'll check for updates. And you can see that we are fully up to date. Thank you. Thank you. Okay so we bypassed the UE file locks and defeated VBS. But now it's time to talk about real security boundaries. The security boundaries that VBS introduces are any VTL 0 to VTL 1 transition is considered a security boundary, an elevation of privilege. No VTL 0 code should be able to compromise VTL 1 code. And another boundary is ring 3 to ring 0, sorry any ring 3 to ring 0, sorry any ring 3 or ring 0 to ring minus 1. So user mode or kernel 2 hypervisor is considered an elevation of privilege. And due to the way that VBS is implemented, compromising the hypervisor gives complete control over all of the VTLs. Now when looking at VBS downgrades my main goal was to understand if there was a downgrade detection mitigation such as versioning checks or evocation mechanism. And if no downgrade mitigation was found regardless of how far I could go with the downgrade I considered this as a vulnerability. And that is because when new vulnerabilities will get patched in the target component it will make the exploitation much easier. So even if not immediately exploitable it is truly something that needs to get fixed. Firstly I targeted secure modes isolated user mode processes. And the most known isolated user mode process is credential guard. So I decided to target it first. Credential guard is implemented as an isolated user mode process named LSAISO which stands for LSA isolated. With credential guard running, secrets are stored in LSAISO in VTL1 instead of in the original LSAISO process. And this is why dumping LSAISO with credential guard is no longer valuable. Because LSAISO only contains the encrypted blobs and the real secrets ones that are, ones that the attacker is interested in are only accessible um to in VTL1 and not in VTL0. I decided to target a downgrade with CV202234709 which is a fixed elevation of privilege in credential guard. I found both the vulnerable module which is Kerpli insured and the vulnerable version. Downgrading the vulnerable module using the Windows update decoverer worked well on a fully patched machine. And this allowed escalating privileges from ring 3 VTL0 to ring 3 VTL1 compromising credential guard and all of the secrets that it protects. There was no downgrade detection on VTL1 isolated user mode. Now isolated user mode privileges are great but I wanted to gain even higher privileges. So I then moved on to target secure mode's kernel which is more privileged than isolated user mode. The kernel of secure mode is called secure kernel and it is a minimal kernel that only implements security features such as HVCI, hyper guard and more. I decided to target this downgrade with CV202127090 which is a fixed elevation of privilege in secure kernel. The only vulnerable module here could be secure kernel itself but in this case downgrading only the secure kernel did not work. It wasn't enough for me. I've had to downgrade dependency modules as well and only then it worked on a fully patched machine. And this allowed escalating privileges from ring 3 VTL0 to ring 0 VTL1 compromising the entire VTL1 and any of the mitigations including HVCI, hyper guard and more. There was no downgrade detection on the secure kernel and the secure mode either. Now secure kernel privileges are great but I wanted to gain even higher privileges. So I then moved on to target the most privileged entity of VBS which is the Hyper-V hypervisor. The hypervisor is HVIX on Intel systems and HVAX on AMD systems. The hypervisor is a standalone microkernel which makes it a valuable target for downgrades. With the hypervisor though it was more challenging to target a specific vulnerability. And that is because many vulnerabilities titled Hyper-V Elevation of Privileges were fixed over the last 2 years. But Hyper-V is a very large component. And in CV descriptions Microsoft do not share which component in the Hyper-V stack is the vulnerable one. So it could be an elevated user mode process, it could be a kernel driver or it could be the hypervisor itself which is the only component that I am targeting in the Hyper-V stack. And so I decided to go 2 years backward to prove the vulnerability. Because 2 years is old enough to be confident that there was at least one hypervisor elevation of privilege vulnerability unfixed in the old hypervisor. Downgrading the hypervisor and the hypervisor loader worked well on a fully patched machine and the cross security boundary here was ring 3 VTL 0 to ring minus 1 potentially compromising the entire visualization stack. And this rendered the entire visualization stack vulnerable to downgrade attacks. So let's see a demo of the hypervisor downgrade. First as usual we check the Windows version and then we make sure that it is fully updated and that we have no missing updates as you can see. We'll then launch SK tool again but this time we're interested to see what is the current state of the hypervisor. You can see the Microsoft hypervisor was detected and the current version is 22621 which is the base version. You can also see the VBS runs as usual. We'll then use Windows downdate with a config file that will say downgrade the hypervisor to a 2 years old hypervisor. The attack was succeeded, you can see the update files. We now restore the machine in order for the update to take place. We fast forward, Windows is updating. What happens under the hood is that the hypervisor is being downgraded. We log back into the machine and let's see what is the current state of the hypervisor. Run SK tool again and we can see that the hypervisor is still detected but its version is 22000 which is a 2 year old version. You can also see what's interesting here is that VBS is running as usual. So credential guard everything is running with an old hypervisor. And if we check that we are fully up to date, you can see that we are. Okay so overall I found no downgrade mitigation. In any component of the virtualization stack. The entire stack was found to be vulnerable to downgrade attacks. Now let's talk about one last vulnerability that exposed all of the attack vectors to unprivileged attackers in certain scenarios. So it all started with this Windows dot all folder which I came across in some of my machines and looking at it and Googling it, I found that this is the old Windows operating system and it is saved for restoration purposes after a quality update is installed. So when you install a quality update, Windows dot all is saved uh Windows is saved to Windows dot all. Of course the first thing I did was to try to modify files inside Windows all but I noticed that access lists are copied from the old operating system and so it was impossible to temper files that could not be previously tempered with. The next thing I did was to try to check access to Windows dot all folder itself. And I found that as an unprivileged user I have full access to this folder. The exploitation strategy is straight forward. First renaming the original Windows dot all folder to any name and then creating an attacker controlled Windows all folder and the attacker controlled operating system will be used in case of update restoration. So then in a restoration scenario triggered by administrator, the attacker controlled operating system will be used instead of the backup operating system. So this is another way to perform the same downgrades from an unprivileged user in a restoration scenario. Closing remarks. Let's talk about the disclosure process, next steps and takeaways. Starting from the disclosure process, we notified Microsoft of our research findings in February 2024. Microsoft issued CV 2024-21302 and CV 2024-38202. This is Microsoft's official response to the research and I would like to thank Microsoft here for the great cooperation and effort on these cases. For those of you who want to further research the topic that we explored today, here are some of the topics that I would recommend looking at. First and foremost, the critical question still arises. Are there additional Windows features vulnerable to downgrade attacks? So far, both secure boot and the virtualization stack was found vulnerable. Do you have in mind additional critical features that you think are vulnerable to downgrades? Another interesting feature introduced not too long ago is Linux virtualization based security. And this is a game changer for Linux security. Would the same design issues exist in the Linux implementation? Lastly, are there any other operating systems such as Mac OS or Linux that may be vulnerable to downgrade attacks? May the implications on those operating systems be similar to the Windows implications? What are the takeaways for this talk? First, the cyber security industry should raise its awareness of OS downgrade attacks and the danger that they pose. I found no mitigation preventing the downgrade of critical operating system components suggesting the downgrade attacks were not the focal point barrier to my research. The significant implications made um made by downgrade attacks emphasize the danger that they pose. And while Windows is currently affected, could Mac OS or Linux be next? We need to address these questions before real attackers do. Second, design should always be reviewed and regarded as a relevant attack surface. The downgrade attack on the virtualization stack was possible due to a design flow that permits less privileged VTLs or rings to update components residing in more privileged VTLs or rings. Even though virtualization based security has become more popular and makes security researchers in recent years with some great research papers papers on the subject, this attack surface, the downgrade attack surface has existed since the very beginning of VBS when Microsoft first announced it in 2015. And this indicates that the design was probably not thoroughly examined. Third, in the wild attacks should be thoroughly examined and expanded upon whenever possible. With the Black Labus UEFI boot kit employing downgrade attacks, we realize that the concept of downgrade attacks was right under our noses. Although a year has passed, it seems that this time we were able to study and expand upon downgrade attacks before attackers did. So we exp- we expanded uh secure boots downgrade to virtualization stack downgrades. This is not always guaranteed. And this emphasizes the importance of studying in the wild attacks and always considering what other components or areas may also be affected by an in- an in the wild attack. Now before we wrap everything up, I would like to credit these talented people for their work. It was a pleasure for me to share with you my journey of researching downgrade attacks on Windows and their severe implications on Windows as platform security. Using the findings that I revealed today, you can bring back to life thousands of old and fixed vulnerabilities. Windows downdate essentially makes the term fully patched meaningless across any Windows machine worldwide. If you have any question- questions, please catch me in the wrap up room or here and also feel free to reach out on social media and with that, I would like to thank you all for joining me today and have a great rest of your day. Thank you. We'll- we'll- we'll go back to our questions.