[英]Solution targeting .NET Core 2.1 builds with old System.ServiceModel.Primitives and System.Private.ServiceModel
我有一个由面向 .NET Standard 2.0 和 .NET Core 2.1.304 的项目组成的解决方案。 构建时,此解决方案利用System.ServiceModel.Primitives
和System.Private.ServiceModel
( CVE-2018-0786 ) 的旧易受攻击版本。
我可能遗漏了一些明显的关于整体解决方案的配置或导致使用旧版本的项目之一,但我知道要检查的一切看起来都是正确的:
{
"sdk": {
"version": "2.1.302"
}
}
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Configurations>Debug;Dev;Qual;Release</Configurations>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Configurations>Debug;Dev;Qual;Release</Configurations>
</PropertyGroup>
我确保所有 NuGet 包都是最新的。 也就是说,我的 NuGet 包引用之一是否可能导致回退到旧版本? 我应该检查哪些其他配置?
有趣的是,当我构建一个不同但配置相似的解决方案(据我所知)时,该解决方案使用较新的非易受攻击版本生成构建。
您可以使用诸如dotnet-outdated 之类的工具来确定项目中依赖项和传递依赖项的版本。
通过dotnet tool install --global dotnet-outdated
在 powershell 命令行上dotnet tool install --global dotnet-outdated
并在您的解决方案文件夹中运行dotnet outdated -t -td 100
以查看 100 个级别的传递依赖项。
您的输出将类似于以下内容
» MyProject
[.NETCoreApp,Version=v2.1]
System.Private.ServiceModel [T] 4.4.0 -> 4.5.3
System.ServiceModel.Primitives [T] 4.4.0 -> 4.5.3
然后,您可以使用上述过时的依赖项来跟踪解决方案中需要进一步调查的项目。
从那里消除已知安全的依赖项,因为它们出现在不依赖于坏库(无论版本如何)的其他项目中。 在这一点上,可能需要使用nuget.org并调查每个可疑的依赖项以查看它使用的子依赖项的版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.