Repository navigation
fix(security): stopped the test restore from fetching SqlClient 4.7.0 - #167
Merged
Merged
Conversation
The direct System.Data.SqlClient 4.9.1 reference in Desktop.Reporting (9b620a0) fixed the resolved graph, but Dependabot alerts #3-#6 stayed open. nuget.config puts the global packages folder at ./Packages, and automatic dependency submission scans every nupkg/nuspec in it. Restoring the test project still downloaded 4.7.0 into ./Packages (CI restore log: GET .../system.data.sqlclient/4.7.0/...nupkg). The NuGet resolver only skips a transitive dependency before fetching it when the restored project itself references it directly; a direct reference inside a ProjectReference does not count. 4.9.1 still won resolution, so no build ever used 4.7.0 (no NU1903 warning). * BAUERGROUP.Shared.Test references System.Data.SqlClient directly (central version 4.9.1), so Stimulsoft's request for 4.7.0 is skipped and never downloaded * Test project only (IsPackable=false): no published package changes Advisories (System.Data.SqlClient 4.7.0 -> 4.9.1 in ./Packages): * GHSA-98g6-xh36-x2p7 (CVE-2024-0056, high) - alerts #4, #6 * GHSA-8g2p-5pqh-5jmc (CVE-2022-41064, moderate) - alerts #3, #5
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.
Summary
Closes the open Dependabot alerts on
System.Data.SqlClient4.7.0 (2 high, 2 moderate). The library packages do not change. The fix is in the test project only.Packages/system.data.sqlclient/4.7.0/system.data.sqlclient.4.7.0.nupkgPackages/system.data.sqlclient/4.7.0/system.data.sqlclient.nuspec...4.7.0.nupkg...nuspecWhy the alerts were still open after 9b620a0
nuget.configsetsglobalPackagesFolderto./Packages. The automatic dependency submission (submit-nuget, component-detection with the NuGet detector) scans every.nupkgand.nuspecin that folder. It reports every package that was downloaded, including ones the build never resolves.System.Data.SqlClient4.9.1 inDesktop.Reporting. That fixed the resolved graph: 4.9.1 wins and NuGetAudit raises no NU1903.BAUERGROUP.Shared.Testreaches Stimulsoft through its ProjectReference toDesktop.Reporting. NuGet's resolver (DependencyGraphResolver) skips a transitive dependency before fetching it only when the project being restored references that package directly. A direct reference inside a ProjectReference does not count. So the test restore still downloaded 4.7.0, whichStimulsoft.Reports.Engine2022.1.2 requests. NuGet then rejected 4.7.0, but the file stayed in./Packages.GET https://api.nuget.org/v3-flatcontainer/system.data.sqlclient/4.7.0/system.data.sqlclient.4.7.0.nupkg.Desktop.Reportingonly started restoring at 06:51:58.Change
tests/BAUERGROUP.Shared.Test: added a directPackageReferencetoSystem.Data.SqlClient, using the central version 4.9.1, with a comment explaining why. The test project isIsPackable=false, so no published nupkg changes.Directory.Packages.props: updated the comment on the existing central version. The version did not change.Verification (CI)
system.data.sqlclient/4.7.0(on deps(dotnet): Bump Sentry and Sentry.NLog #166 it had 2) and still 2 for 4.9.1. There are no NU19xx audit warnings.dependency-graph/comparefrom main to this branch, aftersubmit-nugetrun 38010424596) shows two removals:System.Data.SqlClient 4.7.0inPackages/system.data.sqlclient/4.7.0/system.data.sqlclient.4.7.0.nupkgand in.../system.data.sqlclient.nuspec. The only addition is the static csproj entry, which has no vulnerabilities. The NuGet detector component count went from 175 to 174.After merge, the next
submit-nugetrun onmainsubmits a snapshot without the 4.7.0 manifests. Dependabot should then close #3 to #6 as fixed.