Fix BA2022 verification for long paths - #1215
Merged
Merged
Conversation
Enable long-path awareness for BinSkim and its test host, and add a regression test for signed binaries beyond MAX_PATH. Fixes #977 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix BA2022 verification for long paths
Alexander Köplinger (akoeplinger)
approved these changes
Aug 25, 2026
Pratik Lade (plade)
approved these changes
Aug 26, 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.
Promotes the long-path fix for BA2022 into
main. The change was staged onfix/ba2022-long-pathsvia #1214 and is now being promoted.What this does
BinSkim.Driver/app.manifest— opts the process intolongPathAwareso native Authenticode verification (WinVerifyTrust) can open targets whose path exceedsMAX_PATH(260).Test.FunctionalTests.BinSkim.Rules/RuleTests.cs— adds theBA2022_SignSecurely_LongPath_Passregression test and disposes the analysis context per iteration in the shared test harness.Directory.Packages.props— bumpsMicrosoft.NET.Test.Sdk17.12.0 → 17.14.1 (supports the dynamic test skip used by the new test).Scope / known limitations
LongPathsEnabled=1(Windows 10 1607+). It is inert otherwise — notably on Microsoft-hosted / default agents, which don't set it and can't change it at runtime.CRYPT_E_FILE_ERROR) is still reported as a BA2022 "insecure signing" error rather than an analysis failure. That soundness gap is tracked separately.LongPathsEnabled=1, so it provides no coverage on agents without that setting.Refs