fix: analyze standalone UEFI variable stores that have no FV header - #31
Merged
Merged
Conversation
The boot pass only ran the UEFI Secure Boot analyzer when the input carried a
firmware-volume header signature ("_FVH"). A UEFI variable store extracted on
its own -- the usual chipsec/UEFITool artifact -- has no FV wrapper, so it was
silently skipped and reported nothing, even though it contains the PK/KEK/db/dbx
variables. A full BIOS image (which does carry "_FVH") was unaffected.
Trigger the analyzer on a standalone store too: an EDK2 authenticated/variable
store begins with its store GUID, and an AMI store begins with an "NVAR" entry,
so route the input to the analyzer when either sits at offset 0, in addition to
the existing "_FVH" path. The analyzer already self-filters (it emits nothing
unless it recovers a real variable), so the looser trigger adds no false
positives.
Add a synthetic regression test: a raw AMI NVAR store with no FV wrapper (and a
leading defaults-container entry, as real BIOSes have) must still recover the
Platform Key / Secure Boot posture and enumerate dbx.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The boot pass only ran the UEFI Secure Boot analyzer when the input carried a firmware-volume header signature (
_FVH). A UEFI variable store extracted on its own — the usual chipsec/UEFITool artifact — has no FV wrapper, so it was silently skipped and reported nothing, even though it contains thePK/KEK/db/dbxvariables. A full BIOS image (which does carry_FVH) was unaffected, which is why the gap wasn't obvious.Fix
Trigger the analyzer on a standalone store too: an EDK2 authenticated/variable store begins with its store GUID, and an AMI store begins with an
NVARentry, so route the input to the analyzer when either sits at offset 0, in addition to the existing_FVHpath.analyze_uefialready self-filters (it emits nothing unless it recovers a real variable), so the looser trigger adds no false positives.Tests
Added a synthetic regression test: a raw AMI NVAR store with no FV wrapper (and a leading defaults-container entry, as real BIOSes have) must still recover the Platform Key / Secure Boot posture and enumerate
dbx. Full unit suite (1406 checks) and integration suite pass; clean under ASan+UBSan.