fix(deps): bump Microsoft.SourceLink.GitHub to 10.0.401 to resolve NU1902 CI failure - #174
Merged
Merged
Conversation
…1902 Microsoft.SourceLink.GitHub 8.0.0 transitively pulls Microsoft.Build.Tasks.Git 8.0.0, which carries GHSA-23fw-v26w-5fgq (moderate, CVE-2026-62900). With TreatWarningsAsErrors=true across /src, the resulting NU1902 audit warning fails CI for every packable project (20 failures in run 34856779084 on main @ 239adb6). This is an environmental break, not a code regression: nothing in the affected files changed between the last green run and this one — the advisory was published in the interim (2026-09-08). Per the advisory, Microsoft.Build.Tasks.Git 8.0.0 has no patched version in its own line, and the 10.0.2xx band is unpatched/ unserviced, so bumping within 8.x isn't an option. Version 10.0.401 sits outside every vulnerable range and its nuspec confirms it pulls Microsoft.Build.Tasks.Git 10.0.401, an exact match. Chose a version bump over dropping the explicit SourceLink reference: Alberto.Commands.Analyzers.csproj documents IsPackable=false as deliberately excluding it from the SourceLink item group, i.e. the reference is load-bearing for packable projects, and switching to implicit SDK-provided SourceLink wasn't verified as equivalent. Also chose it over suppressing the audit (NoWarn/NuGetAuditLevel), which would silence future advisories too. No API-surface risk: Microsoft.SourceLink.GitHub is a build-time-only MSBuild tasks package. Verified locally: - dotnet restore --force-evaluate: no NU1902 for this package anywhere - dotnet list package --include-transitive across all 10 packable /src projects: Microsoft.Build.Tasks.Git now resolves to 10.0.401 everywhere, no 8.0.0 remaining - dotnet build (solution-wide): 0 errors, 103 warnings, none of them related to SourceLink or Build.Tasks.Git Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Problem
CI on
mainfails withNU1902: Warning As Error: Package 'Microsoft.Build.Tasks.Git' 8.0.0 has a known moderate severity vulnerability(advisory GHSA-23fw-v26w-5fgq / CVE-2026-62900), 20 times in run 34856779084 (main@ 239adb6).TreatWarningsAsErrors=truein every/src/*.csprojescalates the audit warning to a hard build error.This is an environmental break, not a code regression — nothing in the affected files changed between the last green run and this one; the advisory was published on 2026-09-08, after the last green run. It blocks #171 and #173, since the
mainbranch ruleset requires PR branches to be up to date withmainbefore merging, which re-runs CI against the now-failing baseline.Causal chain:
Directory.Build.propsadds<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />to every packable project.Directory.Packages.propspinnedMicrosoft.SourceLink.GitHubat8.0.0.8.0.0transitively pullsMicrosoft.Build.Tasks.Git8.0.0, which carries the advisory.TreatWarningsAsErrors=trueturns the resulting NU1902 warning into a build failure.Impact is limited to the build pipeline:
PrivateAssets="All"keeps SourceLink dev-time-only, so the vulnerable transitive package never flows to consumers of the published Alberto NuGet packages.Fix
Bump the central
Microsoft.SourceLink.GitHubpin from8.0.0to10.0.401.Per the advisory:
Microsoft.Build.Tasks.Git8.0.0has no patched version in its own line, and the10.0.2xxband is unpatched/unserviced, so a bump within 8.x isn't possible.10.0.401sits outside every vulnerable range listed in the advisory, and its nuspec confirms it pullsMicrosoft.Build.Tasks.Git10.0.401— an exact match.Alternatives considered and rejected:
Alberto.Commands.Analyzers.csproj's ownIsPackable=falsecomment documents the reference as deliberately load-bearing for packable projects, and switching to implicit SDK-provided SourceLink wasn't verified as producing equivalent metadata.NoWarn/NuGetAuditLevel) — silences future advisories too; not needed since a real patched version exists.No API-surface risk:
Microsoft.SourceLink.GitHubis a build-time-only MSBuild tasks package with no C# API surface.Verification
dotnet restore --force-evaluate: no NU1902 forMicrosoft.Build.Tasks.Git/Microsoft.SourceLink.GitHubanywhere.dotnet list package --include-transitiveacross all 10 packable/srcprojects:Microsoft.Build.Tasks.Gitnow resolves to10.0.401everywhere, zero8.0.0remaining. The 3 non-packable projects correctly show no SourceLink reference at all.dotnet build: 0 errors, 103 warnings (all pre-existing and unrelated — xUnit analyzer suggestions andMessagePack/SSH.NETNU1902/NU1903 in projects that don't setTreatWarningsAsErrors).build-test(the check that was failing) now passes on this PR.Once this is green on
main, #171 and #173 can be updated and merged.Closes #175
🤖 Generated with Claude Code