Repository navigation
Pin vulnerable transitive packages and audit them in CI (#650) - #654
Merged
Merged
Conversation
Pin System.Security.Cryptography.Pkcs 10.0.13 (via PlanViewer.Core) and MessagePack 2.5.307 (via PlanViewer.Ssms) over the transitive versions, audit transitive packages with NU1903 as an error, and submit the resolved dependency graph to GitHub. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MrD9SGvLFx4kJaeGZyXG9
…comment (#650) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MrD9SGvLFx4kJaeGZyXG9
…Pkcs drop condition Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MrD9SGvLFx4kJaeGZyXG9
erikdarlingdata
marked this pull request as ready for review
October 14, 2026 23:54
|
Reviewed the build, props and workflow changes. I found nothing blocking.
|
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.
Claude posting for Erik Darling.
Pins the two vulnerable transitive packages, makes high-severity transitive reports fail the build, and adds a dependency-submission workflow so Dependabot gets a graph with real versions.
Files changed
Directory.Packages.props:System.Security.Cryptography.Pkcs10.0.13 andMessagePack2.5.307, each with a comment naming Pin System.Security.Cryptography.Pkcs and MessagePack over vulnerable transitive versions, and make Dependabot see transitive packages #650 and when to drop it.src/PlanViewer.Core/PlanViewer.Core.csproj: directPackageReferenceto Pkcs.src/PlanViewer.Ssms/PlanViewer.Ssms.csproj: directPackageReferenceto MessagePack withExcludeAssets="runtime", like the SDK reference above it: SSMS supplies MessagePack at run time and the extension must never carry its own copy. Without the exclude, the pin copied MessagePack.dll and MessagePack.Annotations.dll into the output.Directory.Build.props(new, repo root):NuGetAuditMode=allandWarningsAsErrors+=NU1903.src/Directory.Build.props: now imports the root file. MSBuild uses only the nearestDirectory.Build.props, so without this import the root file would never reach anything undersrc/(the root file reaches tests/ and server/ directly). Found while checking the gate; see acceptance..github/workflows/ci.yml: added rootDirectory.Build.propsto thecodepath filter (the filter listed onlysrc/Directory.Build.props, so a change to the audit settings alone would have skipped the build)..github/workflows/dependency-submission.yml(new): see below.Resolved versions
project.assets.json). OnlyPlanViewer.Coreneeded the direct reference; NuGet nearest-wins carried it through the project references. Web and PlanShare were already clean.src/PlanViewer.Ssms/obj/project.assets.json. No newerMicrosoft.VisualStudio.SDKexists (17.14.40265 is the newest 17.x on nuget.org), so I pinned rather than bumped.Acceptance
dotnet list PlanViewer.sln package --vulnerable --include-transitive: every project prints "has no vulnerable packages" (Core, App, Cli, Web, Core.Tests). PlanShare (not in the sln) checked separately, also clean.dotnet build PlanViewer.sln -c Debug: 0 Warning(s), 0 Error(s), no NU1902 or NU1903.PlanViewer.Clifails witherror NU1903: Warning As Error ... System.Security.Cryptography.Pkcs 9.0.18, and NU1902 stays a warning. Restored afterwards.MSBuild.exe src/PlanViewer.Ssms/PlanViewer.Ssms.csproj -restore -t:Build -p:Configuration=Release -p:DeployExtension=falseexit 0, 0 errors, 0 warnings, VSCT errors = 0 (the VSSDK targets come from the BuildTools package).PlanViewer.Ssms.Installer(net472, Release) andPlanViewer.Ssms.Installer.Tests(Release) build with 0 errors, 0 warnings.InstallSsmsExtension.exewas not run.server/PlanShareDebug builds clean.dotnet test --project tests/PlanViewer.Core.Tests -c Debug: total 1499, failed 0.Follow-up corrections
src/PlanViewer.Ssms/binandobjand rebuilding with the same MSBuild recipe (exit 0, 0 errors, 0 warnings): (a) noMessagePack*.dllanywhere underbin; (b)obj/project.assets.jsonstill contains"MessagePack/2.5.307"; (c) the.vsixcontains onlyPlanViewer.Ssms.dllamong its DLLs.Install WASM workload(dotnet workload install wasm-tools, as ci.yml does) beforeRestore solution, andAdd MSBuild to PATH(microsoft/setup-msbuildv3.0.0, same pin as release.yml) beforeRestore SSMS projects. Order: checkout, setup-dotnet, workload, restore solution, setup-msbuild, restore SSMS projects, submit.dotnet build PlanViewer.sln -c Debugafter the edits: nowarning NUorerrorlines.Judgment calls and notes
NU1902(moderate) is deliberately not an error; the brief and issue name only NU1903.windows-latestso the old-format SSMS project can be restored withmsbuild -t:Restore(the component detector readsproject.assets.json). The action isadvanced-security/component-detection-dependency-submission-actionv0.2.0 (latest release), pinned to commita02aeda7a175ad4dd38a13c4d3ff2df9da8f2cf0. I could not run this workflow locally; its first real run is the push of this branch's merge todev, and it is the one piece not verified.devtomainrelease merge; thedevtrigger is for exercising the workflow earlier..github/dependabot.ymlis unchanged.src/Directory.Build.propscomment corrected: PlanViewer.Ssms does import this file (throughMicrosoft.Common.props), which is how it gets the audit settings; it just does not generate assembly attributes from<Version>, so the manual version bump advice stands.Review round 1
WarningsAsErrorsisNU1903;NU1904in the rootDirectory.Build.props, with a comment naming the emergency override-p:NuGetAudit=false.dependency-submission.ymlcheckout usespersist-credentials: false, and the header says to dropdevfrom the push trigger once the first dev run is green (dev snapshots feed no alerts; each run holds acontents: writetoken while running a downloaded binary).dependency-submission.yml(solution, both installers, themsbuild -t:Restore) passes-p:NuGetAudit=false, with a comment: a failed restore would leave the graph stale exactly when an alert is needed.fail-on-empty: 'true', so an empty scan cannot replace the graph.Directory.Packages.propsnow says the drop condition is Pkcs 9.0.21 or later (10.0.13 or later on 10.x), and that the desktop app's self-contained publish takes Pkcs from the ASP.NET Core runtime pack, which the audit never sees.Directory.Build.propsadded to the path filters ofdeploy-planshare.yml,deploy-web.ymlandssms-installer-tests.yml(the last also getssrc/Directory.Build.props).release.ymlSSMS step tees the msbuild output to a log and emits::warning::SSMS restore failed the NuGet audit: <line>if it contains NU1903 or NU1904. Exit code behavior is unchanged. The Select-String snippet was tested against a fake log line.NU1904 proof: a scratch project restoring
System.Text.Encodings.Web4.5.0 (with the repo-wide package version management turned off for it) failed witherror NU1904: Warning As Error: Package 'System.Text.Encodings.Web' 4.5.0 has a known critical severity vulnerability, exit 1. The folder was deleted.dotnet build PlanViewer.sln -c Debug: 0 warnings, 0 errors. The five touched workflow files parse as YAML (PyYAML present).Closes #650
🤖 Generated with Claude Code
https://claude.ai/code/session_018MrD9SGvLFx4kJaeGZyXG9