简体   繁体   English

.NET 6 SDK 与旧的 Nuget 包一起发货

[英].NET 6 SDK is shipped with the old Nuget packages

I'm building a Docker image based on Almalinux 8.6.我正在构建一个基于 Almalinux 8.6 的 Docker 图像。 For running my application I need the .NET SDK 6 which is installed by running dnf install -y do.net-sdk-6.0 .为了运行我的应用程序,我需要 .NET SDK 6 ,它是通过运行dnf install -y do.net-sdk-6.0 After that I'm running the Trivy security scan ( https://github.com/aquasecurity/trivy ) upon the image.之后,我对图像运行 Trivy 安全扫描 ( https://github.com/aquasecurity/trivy )。 The dnf list *do.net* says the following packages are installed then: dnf list *do.net*说安装了以下软件包:

Installed Packages

dotnet-apphost-pack-6.0.x86_64        6.0.10-1.el8_6
dotnet-host.x86_64                    6.0.10-1.el8_6                                                                            
dotnet-hostfxr-6.0.x86_64             6.0.10-1.el8_6                                                                            
dotnet-runtime-6.0.x86_64             6.0.10-1.el8_6                                                                            
dotnet-sdk-6.0.x86_64                 6.0.110-1.el8_6                                                                           
dotnet-targeting-pack-6.0.x86_64      6.0.10-1.el8_6                                                                      
dotnet-templates-6.0.x86_64           6.0.110-1.el8_6

Trivy reports there are really old and vulnerable nuget packages that are shipped with .NET SDK (the JSON files that summarize the deps are placed under the SDK path). Trivy 报告说,nuget 包与 .NET SDK 一起提供(总结 deps 的 JSON 文件位于 SDK 路径下)。

Is there any way to get rid of or update these old packages?有没有办法摆脱或更新这些旧包?

Below is the security scan report (it was shrinked a bit to fit into the textbox here):下面是安全扫描报告(为了适应这里的文本框,它被缩小了一点):


<Docker image tag> (alma 8.6)
=====================================================================================
Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)

usr/lib64/dotnet/sdk/6.0.110/DotnetTools/dotnet-format/dotnet-format.deps.json (dotnet-core)
============================================================================================
Total: 3 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 1)

┌────────────────────────────────┬────────────────┬──────────┬───────────────────┬───────────────┬───────────────────────────────────────────────────────────┐
│            Library             │ Vulnerability  │ Severity │ Installed Version │ Fixed Version │                           Title                           │
├────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────────────┤
│ System.Drawing.Common          │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2  │ dotnet: Remote Code Execution Vulnerability               │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2021-24112                │
├────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────────────┤
│ System.Net.Http                │ CVE-2018-8292  │ HIGH     │ 4.3.0             │ 4.3.4         │ .NET Core: information disclosure due to authentication   │
│                                │                │          │                   │               │ information exposed in a redirect...                      │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2018-8292                 │
├────────────────────────────────┼────────────────┼──────────┤                   ├───────────────┼───────────────────────────────────────────────────────────┤
│ System.Text.RegularExpressions │ CVE-2019-0820  │ MEDIUM   │                   │ 4.3.1         │ dotnet: timeouts for regular expressions are not enforced │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2019-0820                 │
└────────────────────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴───────────────────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/DotnetTools/dotnet-watch/6.0.110-servicing.22476.46/tools/net6.0/any/dotnet-watch.deps.json (dotnet-core)
======================================================================================================================================
Total: 3 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 1)

┌────────────────────────────────┬────────────────┬──────────┬───────────────────┬───────────────┬───────────────────────────────────────────────────────────┐
│            Library             │ Vulnerability  │ Severity │ Installed Version │ Fixed Version │                           Title                           │
├────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────────────┤
│ System.Drawing.Common          │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2  │ dotnet: Remote Code Execution Vulnerability               │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2021-24112                │
├────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────────────┤
│ System.Net.Http                │ CVE-2018-8292  │ HIGH     │ 4.3.0             │ 4.3.4         │ .NET Core: information disclosure due to authentication   │
│                                │                │          │                   │               │ information exposed in a redirect...                      │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2018-8292                 │
├────────────────────────────────┼────────────────┼──────────┤                   ├───────────────┼───────────────────────────────────────────────────────────┤
│ System.Text.RegularExpressions │ CVE-2019-0820  │ MEDIUM   │                   │ 4.3.1         │ dotnet: timeouts for regular expressions are not enforced │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2019-0820                 │
└────────────────────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴───────────────────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/FSharp/fsc.deps.json (dotnet-core)
===============================================================
Total: 3 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 1)

┌──────────────────────────────────┬────────────────┬──────────┬───────────────────┬───────────────┬─────────────────────────────────────────────────────────┐
│             Library              │ Vulnerability  │ Severity │ Installed Version │ Fixed Version │                          Title                          │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────┤
│ System.Drawing.Common            │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2  │ dotnet: Remote Code Execution Vulnerability             │
│                                  │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2021-24112              │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────┤
│ System.Net.Http                  │ CVE-2018-8292  │ HIGH     │ 4.3.0             │ 4.3.4         │ .NET Core: information disclosure due to authentication │
│                                  │                │          │                   │               │ information exposed in a redirect...                    │
│                                  │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2018-8292               │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────┤
│ System.Security.Cryptography.Xml │ CVE-2022-34716 │ MEDIUM   │ 4.7.0             │ 6.0.1, 4.7.1  │ dotnet: External Entity Injection during XML signature  │
│                                  │                │          │                   │               │ verification                                            │
│                                  │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2022-34716              │
└──────────────────────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴─────────────────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/FSharp/fsi.deps.json (dotnet-core)
===============================================================
Total: 3 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 1)

┌──────────────────────────────────┬────────────────┬──────────┬───────────────────┬───────────────┬─────────────────────────────────────────────────────────┐
│             Library              │ Vulnerability  │ Severity │ Installed Version │ Fixed Version │                          Title                          │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────┤
│ System.Drawing.Common            │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2  │ dotnet: Remote Code Execution Vulnerability             │
│                                  │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2021-24112              │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────┤
│ System.Net.Http                  │ CVE-2018-8292  │ HIGH     │ 4.3.0             │ 4.3.4         │ .NET Core: information disclosure due to authentication │
│                                  │                │          │                   │               │ information exposed in a redirect...                    │
│                                  │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2018-8292               │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────────┤
│ System.Security.Cryptography.Xml │ CVE-2022-34716 │ MEDIUM   │ 4.7.0             │ 6.0.1, 4.7.1  │ dotnet: External Entity Injection during XML signature  │
│                                  │                │          │                   │               │ verification                                            │
│                                  │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2022-34716              │
└──────────────────────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴─────────────────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/MSBuild.deps.json (dotnet-core)
============================================================
Total: 5 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 2, CRITICAL: 1)

┌──────────────────────────────────┬────────────────┬──────────┬───────────────────┬──────────────────────────────────────────────────┬───────────────────────────────────────────────────────────┐
│             Library              │ Vulnerability  │ Severity │ Installed Version │                  Fixed Version                   │                           Title                           │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ NuGet.Commands                   │ CVE-2022-41032 │ HIGH     │ 6.0.3-rc.32767    │ 6.3.1, 6.2.2, 6.0.3, 5.11.3, 5.9.3, 5.7.3, 4.9.6 │ dotnet: Nuget cache poisoning on Linux via world-writable │
│                                  │                │          │                   │                                                  │ cache directory                                           │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2022-41032                │
├──────────────────────────────────┤                │          │                   │                                                  │                                                           │
│ NuGet.Protocol                   │                │          │                   │                                                  │                                                           │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Drawing.Common            │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2                                     │ dotnet: Remote Code Execution Vulnerability               │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2021-24112                │
├──────────────────────────────────┼────────────────┼──────────┤                   ├──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Security.Cryptography.Xml │ CVE-2022-34716 │ MEDIUM   │                   │ 6.0.1, 4.7.1                                     │ dotnet: External Entity Injection during XML signature    │
│                                  │                │          │                   │                                                  │ verification                                              │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2022-34716                │
├──────────────────────────────────┼────────────────┤          ├───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Text.RegularExpressions   │ CVE-2019-0820  │          │ 4.3.0             │ 4.3.1                                            │ dotnet: timeouts for regular expressions are not enforced │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2019-0820                 │
└──────────────────────────────────┴────────────────┴──────────┴───────────────────┴──────────────────────────────────────────────────┴───────────────────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/NuGet.CommandLine.XPlat.deps.json (dotnet-core)
============================================================================
Total: 5 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 2, CRITICAL: 1)

┌──────────────────────────────────┬────────────────┬──────────┬───────────────────┬──────────────────────────────────────────────────┬───────────────────────────────────────────────────────────┐
│             Library              │ Vulnerability  │ Severity │ Installed Version │                  Fixed Version                   │                           Title                           │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ NuGet.Commands                   │ CVE-2022-41032 │ HIGH     │ 6.0.3-rc.32767    │ 6.3.1, 6.2.2, 6.0.3, 5.11.3, 5.9.3, 5.7.3, 4.9.6 │ dotnet: Nuget cache poisoning on Linux via world-writable │
│                                  │                │          │                   │                                                  │ cache directory                                           │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2022-41032                │
├──────────────────────────────────┤                │          │                   │                                                  │                                                           │
│ NuGet.Protocol                   │                │          │                   │                                                  │                                                           │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Drawing.Common            │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2                                     │ dotnet: Remote Code Execution Vulnerability               │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2021-24112                │
├──────────────────────────────────┼────────────────┼──────────┤                   ├──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Security.Cryptography.Xml │ CVE-2022-34716 │ MEDIUM   │                   │ 6.0.1, 4.7.1                                     │ dotnet: External Entity Injection during XML signature    │
│                                  │                │          │                   │                                                  │ verification                                              │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2022-34716                │
├──────────────────────────────────┼────────────────┤          ├───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Text.RegularExpressions   │ CVE-2019-0820  │          │ 4.3.0             │ 4.3.1                                            │ dotnet: timeouts for regular expressions are not enforced │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2019-0820                 │
└──────────────────────────────────┴────────────────┴──────────┴───────────────────┴──────────────────────────────────────────────────┴───────────────────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/Sdks/Microsoft.NET.ILLink.Tasks/tools/net6.0/ILLink.Tasks.deps.json (dotnet-core)
==============================================================================================================
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 1)

┌───────────────────────┬────────────────┬──────────┬───────────────────┬───────────────┬─────────────────────────────────────────────┐
│        Library        │ Vulnerability  │ Severity │ Installed Version │ Fixed Version │                    Title                    │
├───────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼─────────────────────────────────────────────┤
│ System.Drawing.Common │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2  │ dotnet: Remote Code Execution Vulnerability │
│                       │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2021-24112  │
└───────────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴─────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/dotnet-watch.deps.json (dotnet-core)
=================================================================
Total: 3 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 1)

┌────────────────────────────────┬────────────────┬──────────┬───────────────────┬───────────────┬───────────────────────────────────────────────────────────┐
│            Library             │ Vulnerability  │ Severity │ Installed Version │ Fixed Version │                           Title                           │
├────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────────────┤
│ System.Drawing.Common          │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2  │ dotnet: Remote Code Execution Vulnerability               │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2021-24112                │
├────────────────────────────────┼────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────────────┤
│ System.Net.Http                │ CVE-2018-8292  │ HIGH     │ 4.3.0             │ 4.3.4         │ .NET Core: information disclosure due to authentication   │
│                                │                │          │                   │               │ information exposed in a redirect...                      │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2018-8292                 │
├────────────────────────────────┼────────────────┼──────────┤                   ├───────────────┼───────────────────────────────────────────────────────────┤
│ System.Text.RegularExpressions │ CVE-2019-0820  │ MEDIUM   │                   │ 4.3.1         │ dotnet: timeouts for regular expressions are not enforced │
│                                │                │          │                   │               │ https://avd.aquasec.com/nvd/cve-2019-0820                 │
└────────────────────────────────┴────────────────┴──────────┴───────────────────┴───────────────┴───────────────────────────────────────────────────────────┘

usr/lib64/dotnet/sdk/6.0.110/dotnet.deps.json (dotnet-core)
===========================================================
Total: 5 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 2, CRITICAL: 1)

┌──────────────────────────────────┬────────────────┬──────────┬───────────────────┬──────────────────────────────────────────────────┬───────────────────────────────────────────────────────────┐
│             Library              │ Vulnerability  │ Severity │ Installed Version │                  Fixed Version                   │                           Title                           │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ NuGet.Commands                   │ CVE-2022-41032 │ HIGH     │ 6.0.3-rc.32767    │ 6.3.1, 6.2.2, 6.0.3, 5.11.3, 5.9.3, 5.7.3, 4.9.6 │ dotnet: Nuget cache poisoning on Linux via world-writable │
│                                  │                │          │                   │                                                  │ cache directory                                           │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2022-41032                │
├──────────────────────────────────┤                │          │                   │                                                  │                                                           │
│ NuGet.Protocol                   │                │          │                   │                                                  │                                                           │
├──────────────────────────────────┼────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Drawing.Common            │ CVE-2021-24112 │ CRITICAL │ 4.7.0             │ 5.0.3, 4.7.2                                     │ dotnet: Remote Code Execution Vulnerability               │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2021-24112                │
├──────────────────────────────────┼────────────────┼──────────┤                   ├──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Security.Cryptography.Xml │ CVE-2022-34716 │ MEDIUM   │                   │ 6.0.1, 4.7.1                                     │ dotnet: External Entity Injection during XML signature    │
│                                  │                │          │                   │                                                  │ verification                                              │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2022-34716                │
├──────────────────────────────────┼────────────────┤          ├───────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────────────────────────┤
│ System.Text.RegularExpressions   │ CVE-2019-0820  │          │ 4.3.0             │ 4.3.1                                            │ dotnet: timeouts for regular expressions are not enforced │
│                                  │                │          │                   │                                                  │ https://avd.aquasec.com/nvd/cve-2019-0820                 │
└──────────────────────────────────┴────────────────┴──────────┴───────────────────┴──────────────────────────────────────────────────┴───────────────────────────────────────────────────────────┘
usr/lib64/dotnet/sdk/6.0.110/package.deps.json (dotnet-core)
usr/lib64/dotnet/sdk/6.0.110/vstest.console.deps.json (dotnet-core)
usr/lib64/dotnet/sdk/6.0.110/testhost.deps.json (dotnet-core)
usr/lib64/dotnet/sdk/6.0.110/testhost.x86.deps.json (dotnet-core)
usr/lib64/dotnet/sdk/6.0.110/datacollector.deps.json (dotnet-core)
usr/lib64/dotnet/sdk/6.0.110/TestHost/testhost.deps.json (dotnet-core)
usr/lib64/dotnet/sdk/6.0.110/TestHost/testhost.x86.deps.json (dotnet-core)
======================================================================
Total: 1 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)

┌─────────────────┬─────────────────────┬──────────┬───────────────────┬───────────────┬───────────────────────────────────────────────────┐
│     Library     │    Vulnerability    │ Severity │ Installed Version │ Fixed Version │                       Title                       │
├─────────────────┼─────────────────────┼──────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────┤
│ Newtonsoft.Json │ GHSA-5crp-9r3c-p9vr │ HIGH     │ 9.0.1             │ 13.0.1        │ Improper Handling of Exceptional Conditions in    │
│                 │                     │          │                   │               │ Newtonsoft.Json                                   │
│                 │                     │          │                   │               │ https://github.com/advisories/GHSA-5crp-9r3c-p9vr │
└─────────────────┴─────────────────────┴──────────┴───────────────────┴───────────────┴───────────────────────────────────────────────────┘

I tried installing the up-to-date version of these packages manually but the package installation is .NET project/solution-specific and is not reflected on the SDK path, so the report is obviously the same then.我尝试手动安装这些软件包的最新版本,但 package 安装是 .NET 项目/解决方案特定的,并没有反映在 SDK 路径上,因此报告显然是相同的。

Switching to .NET runtime solved the issue切换到 .NET 运行时解决了这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM