Repository navigation
Conversation
Remove the GVFlt compatibility shim project (legacy ProjFS predecessor) and all DiskLayout upgrade paths that depend on ManagedEsent (layouts 7→8, 8→9, 9→10, 13→14). These upgrades are 6+ years old and no longer needed. Raise minimum supported disk layout version from 7 to 15. Users on ancient layouts must upgrade through an intermediate GVFS version first. Removes ManagedEsent, Microsoft.Database.Collections.Generic, and Microsoft.Database.Isam NuGet packages entirely. Assisted-by: Claude Opus 4.6 Signed-off-by: Tyrie Vella <[email protected]>
tyrielv
added a commit
that referenced
this pull request
Jun 4, 2026
The previous Authenticode check had two security bugs that combined
to make it ineffective:
1. X509Certificate.CreateFromSignedFile only extracts the signer
certificate from a PE file — it does NOT verify that the signed
digest matches the file's contents. X509Chain.Build then validates
the certificate chain but not the file. An attacker could take any
Microsoft-signed binary, modify arbitrary bytes in the PE, keep the
signature blob attached, and this verifier would return success.
2. The signer check was a substring match on the certificate Subject:
subject.Contains("CN=Microsoft Corporation"). This passes for
surprising DNs such as CN="Microsoft Corporation Ltd" or DNs where
the attacker's CN appears alongside "Microsoft Corporation" in
another field (e.g. O="Microsoft Corporation, CN=Attacker").
Fix #1: Add a WinVerifyTrust P/Invoke and call it with
WINTRUST_ACTION_GENERIC_VERIFY_V2 before inspecting the cert. This is
the same code path Windows uses for SmartScreen / SRP / WDAC and is
the only supported way to verify Authenticode on Windows. Map the
common HRESULTs (TRUST_E_NOSIGNATURE, TRUST_E_BAD_DIGEST, etc.) to
specific error messages so users get actionable feedback. Fail closed
on non-Windows.
Fix #2: Replace the Subject.Contains match with an exact-string
comparison against certificate.GetNameInfo(X509NameType.SimpleName,
forIssuer: false). GetNameInfo parses the DN and returns just the CN
value, eliminating substring-collision attacks. Use the ordinal
comparer for the equality check.
Verified end-to-end on Windows:
- Tampering one byte of a signed installer → rejected with
"Installer Authenticode hash does not match — file has been
tampered with" (was previously accepted)
- Unsigned dev installer → rejected with "Installer is not signed"
- notepad.exe (Microsoft-signed, ProductName mismatch) → still
rejected by the ProductName check first
- Real signed SetupGVFS.2.0.26147.6.exe → accepted, runs upgrade
Assisted-by: Claude Opus 4.7
Signed-off-by: Tyrie Vella <[email protected]>
This was referenced Sep 18, 2026
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.
Remove GVFS.GVFlt and ESENT legacy disk layout upgrades
tyrielv/net10-central-packages. GitHub will retarget tomasteronce microsoft#1937 merges.Summary
Remove the GVFlt compatibility shim project (legacy ProjFS predecessor) and all DiskLayout upgrade paths that depend on ManagedEsent (layouts 7→8, 8→9, 9→10, 13→14). These upgrades are 6+ years old and no longer needed.
Raises minimum supported disk layout version from 7 to 15. Users on ancient layouts must upgrade through an intermediate GVFS version first.
Removes ManagedEsent, Microsoft.Database.Collections.Generic, and Microsoft.Database.Isam NuGet packages entirely — eliminates a .NET Framework-only dependency that has no .NET 5+ target and would block updating.
What was removed
Review guide
WindowsDiskLayoutUpgradeData.cs— key file: verify minimum version raised to 15, ESENT code path removed, 4 upgrade registrations removedGVFSHelpers.cs— functional test minimum version matches (15)GVFS.Platform.Windows.csproj— GVFlt project ref + 3 ESENT packages removedPayload.csproj/FastFetch.csproj— GVFS.GVFlt.dll removed from signing listsVerification
Context
Phase 2C+2E of .NET 10 NativeAOT migration. Stacked on microsoft#1937 (central packages).