rufus
rufus copied to clipboard
Feature Request: Warn if media will no longer be bootable after Q1 2024.
Checklist
- [x] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered.
- [x] I performed a search in the issue tracker for similar issues using keywords relevant to my problem, such as the error message I got from the log.
- [x] I clicked the 'Log' button or pressed Ctrl-L in Rufus, or used DebugView, and copy/pasted the log into the section that says
<FULL LOG>
below. - [x] The log I am copying is the FULL log, starting with the line
Rufus version: x.y.z
- I have NOT removed any part of it.
Additionally (if applicable):
- [ ] I ran a bad blocks check, by clicking Show advanced format options then Check device for bad blocks, and confirmed that my USB is not defective.
- [ ] I also tried one or more of the following:
- [ ] Using a different USB drive.
- [ ] Plugging the USB into a different port.
- [ ] Running Rufus on a different computer.
- [ ] If using an image, I clicked on the
(✓)
button to compute the MD5, SHA1 and SHA256 checksums, which are therefore present in the log I copied. I confirmed, by performing an internet search, that these values match the ones from the official image.
Issue description
Due to changes to the Windows Boot Manager from CVE-2023-24932. Previously created boot media will no longer be able to boot once enforcement begins Q1 of 2024. If possible, detect this issue and provide a warning.
https://support.microsoft.com/en-us/topic/kb5025885-how-to-manage-the-windows-boot-manager-revocations-for-secure-boot-changes-associated-with-cve-2023-24932-41a975df-beb2-40c1-99a3-b3ff139f832d#avoidissues5025885
Log
N/A
Yikes...
Do I get that right, any official ISOs past a given date will be good, then? But they have not released anything yet, right?
Aha, I was wondering how long Microsoft would try to swipe that CVE under the carpet until they had no choice but to take action.
If possible, detect this issue
Yeah, that's the major issue here. Microsoft have some kind of revocation list, but of course, they didn't make it downloadable as a standalone (because, why would they? Security through obscurity has always worked WONDERS for everybody....), so it's going to be a PITA.
and provide a warning.
I'll try to do that. But I'm not going to rush into it, and spend time that I don't have being a trailblazer. So I'm going to tag this as deferred for now.
Aha, I was wondering how long Microsoft would try to swipe that CVE under the carpet until they had no choice but to take action.
If possible, detect this issue
Yeah, that's the major issue here. Microsoft have some kind of revocation list, but of course, they didn't make it downloadable as a standalone (because, why would they? Security through obscurity has always worked WONDERS for everybody....), so it's going to be a PITA.
and provide a warning.
I'll try to do that. But I'm not going to rush into it, and spend time that I don't have being a trailblazer. So I'm going to tag this as deferred for now.
Sounds good! I mean there's essentially an entire year to work on this
Looks like checking for
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Secureboot\AvailableUpdates
dword >= 0x10 may work. I'll need to apply the revocation steps myself later to verify that the registry value doesn't change after applying the list.
I saw the registry key, but I don't think it's enough, because it only tells if the current machine might have been upgraded to reject old MS bootloaders, but not if the ISO contains one.
In other words, if we only check for the registry key, we will warn the user regardless of whether the ISO they selected uses an old or new bootloader, whereas we obviously don't want to warn about ISOs that use the new bootloaders.
So, again, to properly display the warning, we need to check the bootloader's hash against the revoked hashes.
From my understanding, the registry key is just a switch to tell the system to update the UEFI revocation list with the hashes of the old bootloaders since, understandably, Microsoft does not yet want to apply revocation wholesale and leave users booting older Windows ISOs facing a Secure Boot validation error. They only want to do that for users who opt-in.
Now, another potential workaround I am considering, provided we can actually download the new bootloaders from Microsoft's servers without having to extract a whole ISO (the issue being that I can't just store a copy of these bootloaders on a server somewhere for Rufus to download, without committing copyright infringement, so we have to hope that they're in a small enough .cab
/.msi
downloadable directly from Microsoft) would be for Rufus to replace the old soon-to-be-revoked bootloaders with the new non-revoked version, since these should be fully interchangeable.
The problem with this workaround however is that this would potentially only work for the initial USB boot (pre-installation phase) and not for the post file-copy (re)boot, as my current assumption is that during initial file copy, Microsoft picks the bootloaders from install.wim
/install.esd
rather than the ones from the USB (if you look at the wim
/esd
you'll find bootmgr.efi
in Windows\Boot\EFI\
), and therefore we'd have to replace them there for things to work, which will be very costly as manipulating the full >4 GB .wim
is a very time consuming operation. If we are lucky however, the bootmgr.efi
Microsoft installs in the file copy phase is the one found in boot.wim
, which, on the other hand, we should be able to replace, as we are already performing boot.wim
image manipulation to add the registry keys for the TPM/Secure Boot bypass, and thus, changing a file there would be a no brainer (well, except for people who get Rufus from the Windows Store, because the Windows Store version cannot mount .wim
files, so users there will be screwed).
I am obviously planning to test this when I have a chance (which may not be before a couple of month or worse) and when I have upgraded a system to the new revoked hashes (which I will need to do carefully and make sure to keep a copy of the revocation list before and after, since I need to isolates these bloody hashes that Microsoft SHOULD provide publicly but, no matter where I looked so far, doesn't!)...
and when I have upgraded a system to the new revoked hashes (which I will need to do carefully and make sure to keep a copy of the revocation list before and after, since I need to isolates these bloody hashes that Microsoft SHOULD provide publicly but, no matter where I looked so far, doesn't!)...
https://uefi.org/revocationlistfile https://uefi.org/sites/default/files/resources/dbx_info.csv
Aha! Since we're talking about an upcoming revocation, and Microsoft is the sole entity that controls the revocation list, I didn't think they would have started to add DBX entries prior to Q1 2024, since it means that we're definitely going to see Secure Boot validation errors with Windows media long before that date (because motherboard manufacturers are not going to cherry pick what goes in the DBX they apply but pick the most recent).
Their process to decide whether a bootloader should be flagged as vulnerable or not is less than straightforward though, per https://uefi.org/sites/default/files/resources/dbx_release_info.pdf:
The following is a summary of Microsoft’s revocation techniques used for the Black Lotus vulnerability: • Boot Managers from Windows 8 to Windows 10, version 1507: revoked by DBX entries • Boot Managers from Windows 10, version 1507 to Windows 10, version 1607: revoked by hash by SKU SiPolicy • Boot Managers from Windows 10, version 1703 to today: revoked by version number by SKU SiPolicy
So, we do not have a complete list of hashes of vulnerable bootloaders, and we're going to have deal with this mess to decide whether a bootloader has been revoked or not, which, and I very much hope I can be proved wrong here, Microsoft is providing no explicit details about. Especially, it does not say what version numbers are being revoked, and it is also my impression that the hashes revoked by SKU SiPolicy are not in the UEFI CSV...
Indeed, Microsoft explicitly state here:
We have released the DbxUpdate.bin file for this issue on UEFI.org. These hashes include all revoked Windows boot managers released between Windows 8 and the initial release of Windows 10 that do not respect the Code Integrity Policy.
So, everything that is meant to be rejected after Windows 10 1507 has not been made public by Microsoft, and, as much as I'd very much like it to be otherwise, my initial comment about Microsoft not publishing information that they should provide still stands (and is made worse by the fact that we can't just rely on getting our hands on a list of hashes).
I guess the other option we have, since we're going to have to deal with a version whatershed anyway, is to not bother with hashes and just check the version number from the EFI bootloader to display a warning if it's anything below the 22H2 v2's version (which appears to be 10.0.2261.1702
vs 10.0.2261.1
for 22H2 v1). Of course it would be nice to have the actual version that acts as the separator from Microsoft themselves...
Note that there is an additional SECURITYVERSION
variable in the resource file of the EFI bootloaders, which is probably tied to the new SiPolicy feature, but for those who might be wondering if the 2.0.0.2
VersionEx
referenced here has anything to do with the actual version filtering, and could be used against SECURITYVERSION
, that latter variable is set to 1.0.0.0
in all the bootloaders I see, and considering that the UEFI variable is described as Set’s the code integrity boot policy version, it seems to be more about defining the minimum version of the SiPolicy environment than defining the actual minimum version of the bootloaders that should be rejected (else, I'd expect Microsoft to describe it as Sets the minimal version of bootloaders accepted by the boot policy). In short, this seems to be a version number that applies when you want to replace a an existing SkuSiPolicy.p7b
and not something that give us a precise idea of the bootloader version below which a EFI bootloader should be considered vulnerable.
Interestingly, if we need to download a bootmgfw.efi
replacement, we may end up using the same method as the actual Black Lotus malware (See "1. An installer deploys files to the ES") to download the file from Microsoft by fetching the executables straight from https://msdl.microsoft.com/download/symbols/.
It does seem however that Microsoft might have taken steps to try to prevent these kind of downloads as I can't seem to manage to get this to work.
For instance, the following to retrieve a PDB will work just fine (symbols for the latest bootmgfw.efi
from 22H2 v2 ISOs):
wget -c -U="Microsoft-Symbol-Server/10.0.0.0" https://msdl.microsoft.com/download/symbols/bootmgfw.pdb/F2B888C9A171A1FC2F9587649411BFD12/bootmgfw.pdb
But trying to do the same for the associated binary, which should resolve to https://msdl.microsoft.com/download/symbols/bootmgfw.efi/B647817D2ba000/bootmgfw.efi
and should be served in the same manner as the PDB by Microsoft's symbol servers, just doesn't seem to work (and the same is true for a similar-but-not-the-exact-same URL that Black Lotus uses to download its own bootmgfw.efi
, though of course, we want to be careful relying on this one to tell us anything as Microsoft may have deliberately chosen to remove it to stop the spread of the malware).
Using the same method I used to generate the bootmgfw.efi
URL for notepad.exe
(method is basically described here) yields https://msdl.microsoft.com/download/symbols/notepad.exe/E798EFB45a000/notepad.exe which downloads just fine through wget -c -U="Microsoft-Symbol-Server/10.0.0.0"
Goddammit, this is so annoying! What the hell does one have to do (besides becoming a full blown malware author) to be able to download a simple executable from Microsoft??
Even more interestingly, since it appears that we can easily download Windows 8.1's diskcopy.dll
from https://msdl.microsoft.com/download/symbols/diskcopy.dll/54505118173000/diskcopy.dll
, that Black Lotus trick may help us restore the MS-DOS installation functionality, that we had to remove from Windows 10 or later on account that Microsoft had removed this DLL (which contains a full blown MS-DOS floppy disk image) from recent Windows version. 😉
Gotta also leave https://support.microsoft.com/en-us/topic/kb5025885-how-to-manage-the-windows-boot-manager-revocations-for-secure-boot-changes-associated-with-cve-2023-24932-41a975df-beb2-40c1-99a3-b3ff139f832d#updatebootable5025885 here. Of course, it would be A LOT better if Microsoft did bother to check the "content" they provide an have an actual working hyperlink for:
If you use a bootable disk image (ISO), a CD-ROM, or DVD media, update the media by following the instructions here.
In short, Microsoft needs to provide a direct download for the non-vulnerable bootmgfw.efi
for all archs, if they want their efforts against Black Lotus to be taken seriously, because they have to consider the case of customers updating boot media for a different arch than the current system (e.g. ARM64 from x86_64) that doesn't force folks to go through a full blown multi GB ISO/ESD download just to extract a 2 MB file...
What a load of crap this whole thing is!
So I updated a system following the 3. APPLY the revocations steps from Microsoft, doing everything as described (double reboot, wait 5 minutes, confirm in Event Viewer that there's an entry that says that DBX has been updated) and then created a Windows 8.1 bootable media (from en-gb_windows_8.1_with_update_x64_dvd_4048142.iso
, SHA-1 1F18420D65956DFE56E2359DA71AB6C363146570
), fully expecting Secure Boot to produce a validation error, as indicated by Microsoft... but the media boots just fine in a Secure Boot environment...
So much for:
• Boot Managers from Windows 8 to Windows 10, version 1507: revoked by DBX entries
Unless both Microsoft and Linux are lying, my system should have the latest DBX applied:
root@debian:~# fwupdmgr get-devices
(...)
├─System Firmware:
│ │ Device ID: a45df35ac0e948ee180fe216a5f703f32dda163f
│ │ Summary: UEFI ESRT device
│ │ Current version: 53
│ │ Minimum Version: 53
│ │ Vendor: Intel(R) Client Systems (DMI:Intel Corp.)
│ │ Update State: Success
│ │ GUIDs: f4cd40f8-4947-4069-bd4d-d5987adefc79
│ │ 230c8b18-8d9b-53ec-838b-6cfc0383493a ← main-system-firmware
│ │ Device Flags: • Internal device
│ │ • Updatable
│ │ • System requires external power source
│ │ • Needs a reboot after installation
│ │ • Cryptographic hash verification is available
│ │ • Device is usable for the duration of the update
│ │
│ └─UEFI dbx:
│ Device ID: 362301da643102b9f38477387e2193e57abaa590
│ Summary: UEFI revocation database
│ Current version: 423
│ Minimum Version: 423
│ Vendor: UEFI:Linux Foundation
│ Install Duration: 1 second
│ GUIDs: c6682ade-b5ec-57c4-b687-676351208742 ← UEFI\CRT_A1117F516A32CEFCBA3F2D1ACE10A87972FD6BBE8FE0D0B996E09E65D802A503
│ f8ba2887-9411-5c36-9cee-88995bb39731 ← UEFI\CRT_A1117F516A32CEFCBA3F2D1ACE10A87972FD6BBE8FE0D0B996E09E65D802A503&ARCH_X64
│ Device Flags: • Internal device
│ • Updatable
│ • Needs a reboot after installation
│ • Device is usable for the duration of the update
│ • Only version upgrades are allowed
│ • Signed Payload
(...)
And I can tell that Secure Boot is really enabled and enforcing validation, since I do get a big fat Secure Boot validation error when I try to boot the unsigned UEFI Shell...
Someone, somewhere, is not telling the truth...
Maybe the efi files from that iso are not revoked?
i checked SHA-256 of bootx64.efi & bootmgfw.efi from en_windows_8.1_with_update_x64_dvd_6051480.iso
, they are not listed in dbx_info.csv
i checked SHA-256 of bootx64.efi & bootmgfw.efi from en_windows_8.1_with_update_x64_dvd_6051480.iso, they are not listed in dbx_info.csv
The thing is, if you try to lookup plain SHA-256's in the CSV, from a revoked executable, you will not find it either.
That's because the "flat" SHA-256's provided by Microsoft are not the SHA-256 you get by computing the hash for the whole file (because, of course, that would be too straightforward, and who wants to be straightforward and non-obtuse when dealing with matters of security...), but the hash you get by Frankenstein's Monstering only a selection of sections from it (and, yeah, technically, that might make sense as the Secure Boot signature does not apply to all the PE data in the first place, so one could defeat the DBX by altering one of these sections, as they wouldn't invalidate the signature, but would change the hash from the DBX, though I would counter with WHO IN THEIR RIGHT MIND DECIDED THAT HASHING A FILE FOR FRIGGING DIGITAL SIGNATURE VALIDATION SHOULD NOT BE ON THE WHOLE ORIGINAL SOURCE BINARY BUT INSTEAD ON SECTIONS CHERRY PICKED AT RANDOM?!? HOW HARD WOULD IT HAVE BEEN TO DESIGN A NEW PE CONTAINER EXTENSION THAT COULD EMBED THE ORIGINAL BINARY WHOLESALE + DIGITAL SIGNATURE INTO A SIGNED PE FILE INSTEAD OF THIS COMPLETE SECURITY ABOMINATION THAT ULTIMATELY FORCES EVERYONE TO HAVE DEAL WITH THIS MICROSOFT INDUCED BULLSHIT?). So, if all you have is a EFI binary, and you want to find out if it's in the Microsoft published DBX, well, better be ready to code your own SHA-256 hashing application, because good luck finding a standalone SHA-256 computation application that can deal with the intricacies of PE hashing for Secure Boot...
Thankfully, after much searching and sieving through bullshit, I found that the obscure PE256 value that Microsoft also does provide in the CSV is actually the SHA-256 "hash" that Get-AppLockerFileInformation
reports when you feed it a Secure Boot signed UEFI executable.
For instance, if you issue Get-AppLockerFileInformation bootx64.efi
from PowerShell for the bootx64.efi
of en-gb_windows_8_x64_dvd_915412.iso
, you get Hash: SHA256 0xCF7F9E7D091023A1A1C3F5CBF7DDACF7B18F03A4D07961F71506FE9DF4388EEE
, and you will find that this last value is in the CSV under PE256, whereas the standard SHA-256 for that file is BEA5931767DCA4C46EF7D6AD73E6913A592860138D3FC82056289B8DFF337940
and does not match the 196243A87389B47FC9033AF3884F3FF0A5C891D80E22C82D2ECD5B9A3434186E
SHA-256 that Microsoft expects for that file in the CSV.
All this to say that, whereas Microsoft were supposed, and have indicated, that all their Windows 8, 8.1 and 10 UEFI bootloaders prior to 1507 should have been entered in the DBX, the bootx64.efi
from en-gb_windows_8.1_with_update_x64_dvd_4048142.iso
certainly has not been, because its PE256, as computed by Get-AppLockerFileInformation
is CD2CFDA64B9D6DB3CA88D27B3F90453ABCD842844A3B45696B90BE54E58AAE04
, and that value is NOT in the bloody DBX.
And I guess that, now that you know how to validate whether a Windows UEFI bootloader executable is in the DBX, you too can play the game of "What other bootx64.efi
/bootmgfw.efi
did Microsoft forgot to register for DBX exclusion when they said it should be excluded?
Oh and incidentally, trying to boot a USB media created from en-gb_windows_8_x64_dvd_915412.iso
on my updated test machine does produce a Secure Boot security violation as expected...
I see the standard SHA-256 of bootmgfw.efi (both x86/x64) from Windows 8.1 update KB3084905 are listed though, and Get-AppLockerFileInformation result match the listed PE256 Authenticode
neither values are listed for 6051480.iso files
the list might have glitches, or they forgot to revoke some files
Yeah, my worry here is that those missed EFI bootloaders, which the DBX does let through (it's not a list issue, it's a DBX issue, as I did validate that these bootloaders are being let through on a fully updated system), might be compatible with newer Windows (whilst ignoring the SKUSiPolicy.p7b
which is how Windows 10 1507+ bootloaders are being filtered out), meaning that the Black Lotus team may just have to install one of these, and folks who went through all the steps to prevent Black Lotus might still get infected with Black Lotus regardless...
Note: I have just e-mailed the UEFI Forum administrators as well as the Microsoft Secure Boot signing team with my concerns about these missing Windows 8.1 bootloaders from the DBX.
Oh, and for the record, these bootloaders were built in 2014.03, and look a bit too early to have benefited from the post 2015.07 revocation features...
UPDATE: On advice from Microsoft, I have also created a new vulnerability report (VULN-102832) at https://msrc.microsoft.com/report/vulnerability.
A few more random notes, for those who might be interested in this whole thing:
- If you copy
%systemroot%\System32\SecureBootUpdates\SKUSiPolicy.p7b
to theefi\microsoft\boot\
directory of boot media created from a post 1507, pre 2305 Windows ISO (tested with a Windows 10 1703 bootable USB created with Rufus), you get the expected Microsoft equivalent of a Secure Boot Security Violation with the Recovery screen below, with aThe digital signature for this file could not be verified
/Error code: 0xc0000428
message:
- In an unexpected Microsoft did the right thing for once, it appears that the
SKUSiPolicy.p7b
file is universal, which means that the version you get from an x86_64 Windows installation contains the revocations for ARM64, and vice versa. This is of interest to us if we plan to automatically addSKUSiPolicy.p7b
to Windows media created by Rufus (see below). - Windows 7 has never been Secure Boot compatible (the bootloaders are signed by Microsoft... but not with the UEFI Secure Boot credentials), so there's no need to revoke anything there as you'll get a Security Violation regardless.
- It appears that Microsoft Hyper-V looks at the host system's
SKUSiPolicy.p7b
to check if the UEFI bootloader should be trusted, meaning that, even if the virtual disk you boot from does not have anSKUSiPolicy.p7b
present, you will get a standard Secure Boot Security Violation (rather than the0xc000042
Recovery screen) if that bootloader happens to have been revoked in the host'sSKUSiPolicy.p7b
. - Adding
SKUSiPolicy.p7b
to USB media created from theen_windows_8.1_with_update_x64_dvd_6051480.iso
oren-gb_windows_8.1_with_update_x64_dvd_4048142.iso
ISOs (the two Windows 8.1 ISOs whose bootloaders appear to have been "forgotten" by Microsoft for exclusion) still results in media that boots in an updated system, meaning that Microsoft did not voluntarily exclude these bootloaders from the DBX on account that they were modern enough forSKUSiPolicy.p7b
to apply...
At this stage, considering that trying to secure systems of unaware users is something that applications should strive for (rather than let unaware users potentially get infected through known easily patchable security holes), I am planning to have Rufus automatically copy the system's SKUSiPolicy.p7b
to the boot media when a efi\microsoft\boot\
is detected there and either SKUSiPolicy.p7b
does not exist, or one exists but it is older than the system's.
My reasoning is that, in an ideal world, all the bootloaders for which SKUSiPolicy.p7b
applies would have been added to the DBX, but they haven't been because the DBX is actually running out of space and Microsoft (as well as the Shim folks) devised alternate methods that mirror what the DBX does without actually using the DBX. So, in an ideal world, these Microsoft bootloaders should generate a Security Violation on up to date Secure Boot enabled systems regardless of whether a SKUSiPolicy.p7b
exists or not, and we really don't want users to get the idea that everything is fine and dandy when they are booting a media that is known to be potentially problematic and/or used as vector of infection. Especially, it needs to be hammered to users that, if they get a Security Violation and still want to boot that media, they can always disable Secure Boot. But then that decision to boot known insecure bootloaders becomes their explicit choice and is not something they'll be able to dismiss with a "Well, I didn't know I was potentially putting my system at risk..."
And this is where we might for once be helped by SKUSiPolicy.p7b
appearing to be universal, as my one worry was that trying to use the SKUSiPolicy.p7b
from an x86_64 system to create an ARM64 boot media would leave that ARM64 media open, on account that Microsoft may have chosen to produce arch-specific SKUSiPolicy.p7b
's...
Doesn't KB5025885 article state that SKUSiPolicy.p7b
should not be copied to the boot media (ISO, USB, DVD..)?
Doesn't KB025885 also not provide any instructions on how one should update ISO/USB/DVD media ("update the media by following the instructions here." with no hyperlink)?
Again, there are no two ways of going on about bootloaders that should be revoked because they can potentially be used to infect one's system: They must be filtered out with an obvious security violation on a Secure Boot enabled system, so that users are clear about what they are about to do.
Now, of course, in a context where you either created your own media (which is the context of the KB) or you are using media that came from Microsoft themselves, it does make little sense to try to filter the bootloaders because that media should be considered safe, and SKUSiPolicy.p7b
should be applied to the installed system either directly (post 2305 images) or through Windows update pre (2305). Plus, because that statement is extraordinarily "blanket" and does not provide even a hint of why, I'm half convinced that this note is really about not copying SKUSiPolicy.p7b
to media that use non Microsoft bootloaders (such as GRUB, etc).
However, in the context of Rufus, I have no way of telling if the source media is safe (and I am not going to add a very costly SHA-1 validation to check for retail ISOs, especially as a lot of folks are going to use MCT ISOs anyway which should be considered safe but cannot be validated for safety). Furthermore, the creation of boot media using Rufus from a Black Lotus infected ISO (or a Black Lotus derivative) is a real scenario that I expect to happen, so, again, I do want users to make their own explicit decision (especially if they are using dodgy-sourced ISOs) when it comes to potentially lowering the security of their system as well as nudge them towards using a more up to date ISO. And, yeah, I am well aware this will annoy a lot of people, but that's how security works, and the minute you attempt to compromise security for convenience (which, IMO, is what Microsoft are doing by not advising people to copy SKUSiPolicy.p7b
to post 1507 bootable media), you lose security.
So, I am just going to re-state what I just said above, regardless of what Microsoft states (who, as we have seen, are not impervious to botching security): In an ideal world, all the Microsoft EFI bootloaders prior to 2305 should have been added to the UEFI DBX and should generate a Security Violation in a Secure Boot enabled environment. As such, so that the majority of users remain safe, especially if they are using ill-sourced ISOs, I want Rufus to create media that behaves as close as possible to that ideal situation, and this entails going against Microsoft's "recommendations" and copying the system's SKUSiPolicy.p7b
to the media.
4. It appears that Microsoft Hyper-V looks at the host system's `SKUSiPolicy.p7b` to check if the UEFI bootloader should be trusted, meaning that, even if the virtual disk you boot from does not have an `SKUSiPolicy.p7b` present, you will get a standard Secure Boot Security Violation (rather than the `0xc000042` Recovery screen) if that bootloader happens to have been revoked in the host's `SKUSiPolicy.p7b`.
Seems as though Microsoft Surface devices also look at that file to decide what should trigger a secure boot violation Just now i was doing some experementing with a Surface Go 3 (which i have applied the revocations to, its the same device that i made the discovery with microsofts annoying "more secure than normal secure boot" thing), i downloaded the latest recovery image for it, only to find that microsoft hadn't released an updated (post 9th of May) recovery image, the files in the image were showing as last modified in April (so out of curiosity i tried booting the image (which i copied to a USB, as the recovery images are supplied as a ZIP file), and with secure boot enabled (both "Microsoft only" and standard secure boot settings), it was doing exactly what it does for a secure boot violation, it only booted when i temporarally disabled secure boot (and yes, i did re-enable secure boot afterwards))
@pineapple63, thanks for the report.
That's actually part of the reason why I think Microsoft's "advice" about not copying SKUSiPolicy.p7b
to Windows bootable media is something that can/should safely be ignored, because if you don't copy that file then any non-Microsoft machine you boot from will pretend that everything is fine and dandy, whereas, on Microsoft controlled hardware, be it virtual or real, if you boot the same media, even without SKUSiPolicy.p7b
, you get an explicit UEFI Security Violation.
So, clearly, Microsoft, in its actions (rather than in its words) is telling us that any of their pre 2305 EFI bootloaders should generate a Security Violation. And the only way to get that on non-Microsoft controlled hardware, for post 1507 media, is to manually copy the system's SKUSiPolicy.p7b
, which is why, if there's no other possibility (such as replacing pre 2305 bootloaders with more recent ones, which, even if we were to have direct download access to such bootloaders from Microsoft, is not guaranteed to be viable if we also have to replace these bootloaders in install.wim
), I am planning to do just that in Rufus...
Update from Microsoft with regards to the missing DBX entries MSRC case:
Thank you again for reporting this behavior. Microsoft is working on a comprehensive fix that will update the DBX to include additional boot loaders. However, due to the complexity of the fixes involved, we are targeting January 2024 for the next update.
So, yeah, they acknowledged that their DBX update is currently incomplete, which I'm going to assume means that you might still be able to get infected by Black Lotus, on a fully up to date system, until January 2024...
Tonight, on the ongoing saga of whatever the heck Microsoft is doing to try to mitigate Black Lotus we attempt to take a closer look at:
• Boot Managers from Windows 10, version 1507 to Windows 10, version 1607: revoked by hash by SKU SiPolicy
The idea is that, since I am planning to detect EFI bootloaders that have been revoked by the DBX in Rufus and warn the user about them (hence why I just added PE256 hash support), I also wouldn't mind being able to do that for bootloaders that have been revoked in the .p7b
.
That's because, as one would expect, SKUSiPolicy.p7b
does contain a bunch of hashes, which you can plainly see by looking at the binary and also can (more or less) nicely convert to the kind of Security Policy XML file they fed to WDAC Wizard to create the .p7b
.
You can download the converted XML below: SKUSiPolicy.zip
Allegedly, all of the ID_DENY_D_####
hashes you can see in the file are the PE256's of the Windows 10 'bootloaders' that Microsoft wants to flag (that sure is a lot for just 1 year of Windows 10 releases, even if you factor in that it's for x86_32, x86_64, ARM64 and(?) ARM. Oh, and don't ask me why some of these hashes are duplicated: it's the .p7b
that's duplicating them)... except none of these hashes appear to match the PE256 of Windows 1511's bootx64.efi
or bootmgr.efi
and I did find some information that, yes, it is really a PE256 that is being used in the .p7b
, so it's not a matter of using the wrong hash algorithm (by the way, if you want to compute the PE256 without using PowerShell, I found that you can also use sigcheck with option -h
).
Soooo, the question now becomes: What the hell is Microsoft hashing then???
I guess it makes a modicum of sense that Microsoft would not use the EFI hashes, since SKUSiPolicy.p7b
is actually referenced from these bootloaders and ideally anything EFI that should be revoked should be handled by the DBX, though of course, if the point is to spare space of the DBX, then by all means WDAC revocation policies should start at the EFI level, including the EFI bootloader that performs WDAC denial.
I have tried to see if winload.exe
from boot.wim
was the file being hashed, since it's allegedly the first exe that gets executed after exiting EFI, but this appears not to be the case either. And I haven't found any .exe
/.dll
/.efi
on en_windows_10_multiple_editions_version_1511_x64_dvd_7223712.iso
itself with a PE256 that appears in SKUSiPolicy.p7b
.
So, if anyone wants to pick a post 1507 pre 1607 Windows 10 ISO to play the "What the hell is Microsoft actually hashing in SKUSiPolicy.p7b
?" game, feel free to join the "fun"...
1607 ISO is the oldest i still keep :grinning:
and i did find PE256 hash for bootx64.efi / bootmgfw.efi / bootmgr.efi
in SKUSiPolicy.xml
Been using a 1511 ISO, and haven’t had any luck so far
(And i did verify my Surface Go 3 rejects that ISO when extracted to a USB drive (i copied the files across manually, rather than using Rufus), and in the process of verifying that i screwed up, i wanted to make sure it booted with secure boot turned off, and the device froze when i did that, after force powering it off, and re-enabling secure boot, i was met with a bitlocker recovery screen)
Goddammit! Why do I always pick the ISOs that Microsoft forgot to add to their deny list?
Can confirm that en_windows_10_multiple_editions_version_1607_updated_jan_2017_x64_dvd_9714399.iso
contains bootx64.efi
/ bootmgr.efi
that are in the SkuSiPolicy list. But en_windows_10_multiple_editions_version_1511_x64_dvd_7223712.iso
or en_windows_10_multiple_editions_version_1511_updated_feb_2016_x64_dvd_8379634.iso
don't.
The thing is, since I wasn't sure whether Microsoft's list was inclusive or not, I deliberately picked 1511 as the "safer" bet, since it's right between 1507 and 1607. And I tested multiple 1511 ISOs I had.
So, once again, it looks like Microsoft screwed up their Black Lotus filtering, even though, in the case of SkuSiPolicy, they don't have to worry about limiting the bootloaders they pick so as not to run out of space.
I sure am starting to grow tired of having to tell Microsoft how to do their job. But at any rate, many thanks to @stdin82 for finding at least one ISO that Microsoft did properly filter out...
EDIT: The following is not accurate per the comments further down
‐ Well, Since it's been my lucky category so far, I'll take "Things that Microsoft said they would do but certainly did not do" for 500, Alex...
‐ Copying SKUSiPolicy.p7b
to a bootable media created from Windows 10 20H2 does NOT produce any error when trying to boot on a fully updated UEFI system, in accordance with Microsoft's guidance, when Secure Boot is enabled.
‐ What is "• Boot Managers from Windows 10, version 1703 to today: revoked by version number by SKU SiPolicy"?
Gotta hand it to Microsoft they managed to turn every single line from:
• Boot Managers from Windows 8 to Windows 10, version 1507: revoked by DBX entries • Boot Managers from Windows 10, version 1507 to Windows 10, version 1607: revoked by hash by SKU SiPolicy • Boot Managers from Windows 10, version 1703 to today: revoked by version number by SKU SiPolicy
into a straight out lie.
And yeah, after spending some time trying to look for something that even remotely looks like a version number validation rule in the .p7b
, I can safely conclude that, no, Microsoft did not revoke any Boot Managers from Windows 10, version 1703 to today by version number by SKU SiPolicy...
You'd think that, as the sole judge, jury and executioner of Secure Boot signing, Microsoft would know how not to completely botch the handling of a Secure Boot vulnerability...
In the absence of any hints of how Microsoft plans to perform version number revocation, I have now added the closest thing I can provide to the feature being requested in this issue, which is a warning to the user if the source media they use happens to use either a DBX revoked bootloader or an SkuSiPolicy one.
In the first case, you will see the following alter:
And in the second case, this slightly different one (and yeah, I do realise Hyper-V or Surface will not actually show the Recovery BSOD, but I am targeting the most common usage here).
Both these warnings intervene after the user presses START (since we don't want to pester the user as soon as they select the ISO).
This adds an awful loads of hashes to check (which isn't really an issue in terms of performance, it's just that it does increase the size of the executable by about 100 KB) but I think the end result justifies the means.
Note that this feature may evolve on account of the complete shit show that Microsoft has left us with when it comes to Black Lotus detection and remediation, and that since Rufus is not yet copying the system's SkuSiPolicy.p7b
onto the target media, you will not actually get the Recovery screen when trying to boot it. I am planning to add copying of SkuSiPolicy.p7b
in a subsequent patch.
Still, if you want to test, and find if your pre 1607 media is currently going to get flagged for Black Lotus, feel free to test the binaries aritfacts from https://github.com/pbatard/rufus/actions/runs/5293179952.