Skip to content

Fix BA2022 verification for long paths - #1215

Merged
Pratik Lade (plade) merged 2 commits into
mainfrom
fix/ba2022-long-paths
Aug 26, 2026
Merged

Fix BA2022 verification for long paths#1215
Pratik Lade (plade) merged 2 commits into
mainfrom
fix/ba2022-long-paths

Conversation

@martin-reznik

Copy link
Copy Markdown
Contributor

Promotes the long-path fix for BA2022 into main. The change was staged on fix/ba2022-long-paths via #1214 and is now being promoted.

What this does

  • BinSkim.Driver/app.manifest — opts the process into longPathAware so native Authenticode verification (WinVerifyTrust) can open targets whose path exceeds MAX_PATH (260).
  • Test.FunctionalTests.BinSkim.Rules/RuleTests.cs — adds the BA2022_SignSecurely_LongPath_Pass regression test and disposes the analysis context per iteration in the shared test harness.
  • Directory.Packages.props — bumps Microsoft.NET.Test.Sdk 17.12.0 → 17.14.1 (supports the dynamic test skip used by the new test).

Scope / known limitations

  • The manifest opt-in only takes effect where the OS also has 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.
  • It does not change the diagnostic emitted when a target still can't be read: a file-access failure (CRYPT_E_FILE_ERROR) is still reported as a BA2022 "insecure signing" error rather than an analysis failure. That soundness gap is tracked separately.
  • The new regression test self-skips unless LongPathsEnabled=1, so it provides no coverage on agents without that setting.

Refs

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
@plade
Pratik Lade (plade) merged commit d92babb into main Aug 26, 2026
12 checks passed
@plade
Pratik Lade (plade) deleted the fix/ba2022-long-paths branch August 26, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants