Skip to content

Feature Request: Report and validate the Microsoft SVN #11

@pbatard

Description

@pbatard

This project and its scripts are great.

But one thing that is missing at the moment, that's equally important as validating the DBX hashes, is SVN validation, as Microsoft does push regular SVN updates into the DBX, and SVN acts as a Secure Boot gatekeeper for Windows Bootloaders, in that, the first thing the Windows UEFI bootloaders do, in a Secure Boot environment, is check the SVN number from the system/DBX against their own SVN, and if they find that their SVN is lower than the system, they produce the following error:

svn_error

In other words, if the latest SVN is 7.0 (as it currently is) but the current platform's DBX SVN is 5.0 (which was the case earlier this year), then it means that a platform that reports check marks everywhere with the validation script is actually vulnerable, since it will allow Windows bootloaders, including CA2023 signed ones (so being CA2023 compliant will not save you here) in which vulnerabilities have been found.

Which is why we would encourage a a script that cares about revocation to also report the SVN status.

Basically, the validation script should report 3 elements:

  1. The most up to date SVN value from Microsoft, which currently should be 7.0, and which was updated at least twice this year. This should be reported independently of what is read from the system (i.e. most likely hardcoded, unless you want to extract it dynamically from https://github.com/microsoft/secureboot_objects/blob/main/PostSignedObjects/Optional/DBX/amd64/DBXUpdateSVN.bin where it resides... provided Microsoft actually bothers updating that file — see below).
  2. The current SVN value of the platform's DBX, which, should also be 7.0 on fully up to date systems.
  3. The current SVN value of the platform's Windows UEFI bootloader, to make sure that if someone finds that the DBX reports an SVN of 7.0 but their Windows bootloader are still on 5.0 or less, they get a hint that they should first update their bootloader before going around updating the DBX.

Now, getting the SVN value from the DBX is something that can easily be accomplished with this PowerShell snippet (taken from this relevant elevendorum thread):

$DBXSVN=([Regex]::Matches((((Get-SecureBootUEFI dbx).Bytes |% {'{0:x2}' -f $_}) -join ''),'01612b139dd5598843ab1c185c3cb2eb92...........')).Value | sort | select -last 1; if ($DBXSVN.Count) { 'SVN {0}.{1}' -f [int]::Parse($DBXSVN.Substring(36,4),[System.Globalization.NumberStyles]::HexNumber), [int]::Parse($DBXSVN.Substring(40,4),[System.Globalization.NumberStyles]::HexNumber) } else { 'No SVN.' }

Getting the SVN from the bootloader is a bit more involved, but is probably similar to what's being accomplished to check the Secure Boot certifcate.
If needed, you can reference the C code that I'm using in Rufus to perform SVN validation check in https://github.com/pbatard/rufus/blob/a8c745d2a95c590e7607836b3ee5365186840dcf/src/hash.c#L2274-L2324.

As to getting the most up to date value from Microsoft, this might require even more involvement, because, theoretically, Microsoft should push a public DBX update at https://github.com/microsoft/secureboot_objects whenever they push an SVN update through Windows Update, but their current track record on doing that hasn't been that great, which forced me to open an issue with them in microsoft/secureboot_objects#255, so I hope their future SVN updates will be more coordinated between their Windows Updates team and their Secure Boot teams...

All in all, once SVN validation is added to the script, I believe it will be the ultimate means for Windows users to validate that their platform is really up to date in terms of Secure Boot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions