Details
Examine the line on which they are found, the version number is after the /.
Compare to the vulnerable versions
For example, a search result that shows "Microsoft.Data.SqlClient": "2.1.0" is a reference to version 2.1.0 of Microsoft.Data.SqlClient If your project.assets.json file includes vulnerable versions of the nuget packages then you need to fix the transitive dependencies.
If you have not found any reference to any vulnerable packages, this means either
None of your direct dependencies depend on any vulnerable packages, or
You have already fixed the problem by updating the direct dependencies.
If your transitive dependency review found references to the vulnerable package, you must add a direct dependency to the updated package to your csproj file to override the transitive dependency.
Editing projects to fix transitive dependencies
Open projectname.csproj in your editor. Look for PackageReference nodes, for example:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IndirectDependency" Version="1.0.0" />
</ItemGroup>
</Project>
You must add a direct dependency to the updated, matching major/minor version of the vulnerable by adding it to the csproj file. This is done by adding a new line to the dependencies section, referencing the fixed version. For example,
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IndirectDependency" Version="1.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.2" />
</ItemGroup>
</Project>
After you've added the direct dependency reference, save your csproj file.
If you're using Visual Studio, save your updated csproj file and Visual Studio will restore the new package versions. You can see the restore results by opening the Output window (Ctrl+Alt+O) and changing the Show output from drop-down list to Package Manager.
If you're not using Visual Studio, open a command line and change to your project directory. Execute the dotnet restore command to restore the new dependencies.
Using the nuget command line to fix transitive dependencies
Open a command window and change directory to your project directory.
Run the following command if you have an indirect dependency on Microsoft.Data.SqlClient between versions 2.0.0 and 2.1.1
> dotnet add package Microsoft.Data.SqlClient --version 2.1.2
Run the following command if you have an indirect dependency on Microsoft.Data.SqlClient below 1.1.4
> dotnet add package Microsoft.Data.SqlClient --version 1.1.4
Run the following command if you have an indirect dependency on System.Data.SqlClient below 4.8.4
> dotnet add package System.Data.SqlClient --version 4.8.5
Execute the dotnet restore command to restore the new dependencies.
Rebuilding your application
Finally, you must rebuild your application, test, and redeploy.
Disclaimer
The information provided in this advisory is provided "as is" without warranty of any kind. Microsoft disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Microsoft Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Microsoft Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.
Revisions
V1.0 (November 8, 2022): Advisory published.
_Version 1.0_
_Last Updated 2022-11-08_