Repository navigation
Add missing package reference to System.Data.Common - #4063
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an explicit System.Data.Common dependency to the SqlClient build and packaging metadata so the net462 target has a direct/declared reference instead of relying on implicit or transitive resolution.
Changes:
- Add
System.Data.Commonas aPackageReferencefor the net462 build ofMicrosoft.Data.SqlClient. - Add
System.Data.Commonto the netfx reference-assembly project’s package references. - Pin
System.Data.Commoncentrally and declare it as a net462 dependency in the.nuspec.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/specs/Microsoft.Data.SqlClient.nuspec | Declares System.Data.Common (4.3.0) as a net462 NuGet dependency. |
| src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj | Adds System.Data.Common package reference for the net462 target. |
| src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj | Adds System.Data.Common package reference for the net462 reference assembly build. |
| Directory.Packages.props | Centrally pins System.Data.Common to 4.3.0. |
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4063 +/- ##
==========================================
- Coverage 75.09% 68.44% -6.66%
==========================================
Files 280 275 -5
Lines 43830 66930 +23100
==========================================
+ Hits 32914 45807 +12893
- Misses 10916 21123 +10207
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot When were these references removed? Can you point to a specific PR? |
|
@copilot backport this change to the release/7.0 branch |
Co-authored-by: mdaigle <4722049+mdaigle@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/SqlClient/sessions/1252dab5-81b0-4f0e-8e0a-3399d448fd96
…age reference (#4074) * Backport PR #4063: Add missing System.Data.Common package reference Co-authored-by: mdaigle <4722049+mdaigle@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/SqlClient/sessions/1252dab5-81b0-4f0e-8e0a-3399d448fd96 * Document why System.Data.Common NuGet package is explicitly required on .NET Framework Co-authored-by: paulmedynski <31868385+paulmedynski@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/SqlClient/sessions/a5fab7d4-0f66-4552-98b9-4635fa63c441 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mdaigle <4722049+mdaigle@users.noreply.github.com> Co-authored-by: paulmedynski <31868385+paulmedynski@users.noreply.github.com>
|
Think this the correct fix is to use Notice |
|
We use the @snakefoot - I'm not sure how the CVE you noted relates to this. Can you provide details from the VeraCode report that clearly explain? |
|
NET Framework already have everything. The Microsoft.Data.SqlClient just need to use the native NET Framework-reference (Notice <Reference Include="System.Data.Common" />As you can already see from initial issue #4062 (Nuget-package also supports "hidden" / "implicit" NET Framework references) - Reference Include="System.Transactions" VeraCode reports that the obsolete/unmaintained System.Data.Common-nuget-package has issues: https://sca.analysiscenter.veracode.com/vulnerability-database/libraries/system-data-common/csharp/nuget/lid-1528727 CVE-2020-1147 Remote Code Execution (RCE)
|
|
@snakefoot - The SqlClient package targets .NET Framework 4.6.2 and .NET 10.0. .NET Framework 4.6.2 does not contain the following types that we require:
Those first appeared in .NET Framework 4.7.1 - see this blog. In order to compile for .NET Framework 4.6.2, we must include the System.Data.Common 4.3.0 NuGet package that provides those 3 types. That package is not marked as deprecated or obsolete, v4.3.0 is the latest version available, and NuGet has no documented vulnerabilities listed for it. The Veracode link you provided claims there are vulnerabilities, but doesn't disclose them. The CVE-2020-1147 doesn't list the NuGet package as far as I could see. SqlClient targeting .NET Framework 4.6.2 requires the NuGet package and its Are you suggesting that we attempt to modify the SqlClient nuspec file to specify something like this? Please open a new issue with complete findings and a suggested fix (ideally with reproducible proof-of-concept) so we can continue this discussion. We will be happy to asses what you come up with, especially if it means we can avoid unnecessary warnings in downstream consumers. |
|
Have created #4939 - Guess the solution is to stay with SqlClient v7.0.0 until you release SqlClient that supports NET 4.7.1 Notice using SqlClient v7.0.0 (without the obsolete/unmaintained System.Data.Common nuget-package) works fine with NET Framework 4.8 (Just requires one to explicit add own reference as also mentioned here #4062) |
Fixes #4062