CVE-2024-0057: NuGet.CommandLine NuGet Client Security Feature Bypass Vulnerability

CRITICAL
Advisory Identifier: GHSA-68w7-72jg-6qpp
CVSS 9.1
Published
Advisory Summary

CVE-2024-0057 is a CRITICAL (CVSS 9.1) nuget client security feature bypass vulnerability (General Security Weakness) affecting NuGet.CommandLine libraries in the NuGet ecosystem. The issue involves nuget client security feature bypass vulnerability. Remediation is available by upgrading affected packages to version 5.11.6, 6.0.6, 6.3.4, 6.4.3, 6.6.2, 6.7.1, 6.8.1.

CVE-2024-0057 at a Glance

CVE Identifier CVE-2024-0057
GHSA Identifier GHSA-68w7-72jg-6qpp
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification General Security Weakness
Affected Product NuGet.CommandLine
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-0057

To remediate this vulnerability, upgrade all affected NuGet.CommandLine dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

NuGet.CommandLine fixed: 5.11.6
Upgrade NuGet.CommandLine to 5.11.6
NuGet.Packaging fixed: 5.11.6
Upgrade NuGet.Packaging to 5.11.6
NuGet.CommandLine fixed: 6.0.6
Upgrade NuGet.CommandLine to 6.0.6
NuGet.Packaging fixed: 6.0.6
Upgrade NuGet.Packaging to 6.0.6
NuGet.CommandLine fixed: 6.3.4
Upgrade NuGet.CommandLine to 6.3.4
NuGet.Packaging fixed: 6.3.4
Upgrade NuGet.Packaging to 6.3.4
NuGet.CommandLine fixed: 6.4.3
Upgrade NuGet.CommandLine to 6.4.3
NuGet.Packaging fixed: 6.4.3
Upgrade NuGet.Packaging to 6.4.3
NuGet.CommandLine fixed: 6.6.2
Upgrade NuGet.CommandLine to 6.6.2
NuGet.Packaging fixed: 6.6.2
Upgrade NuGet.Packaging to 6.6.2
NuGet.CommandLine fixed: 6.7.1
Upgrade NuGet.CommandLine to 6.7.1
NuGet.Packaging fixed: 6.7.1
Upgrade NuGet.Packaging to 6.7.1
NuGet.CommandLine fixed: 6.8.1
Upgrade NuGet.CommandLine to 6.8.1
NuGet.Packaging fixed: 6.8.1
Upgrade NuGet.Packaging to 6.8.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for NuGet.CommandLine

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-0057, inspect your project dependencies for NuGet.CommandLine:

inspect dependencies for NuGet.CommandLine

Analyze the terminal output to locate any version of NuGet.CommandLine in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.11.6), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In NuGet.CommandLine, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Description Microsoft is releasing this security advisory to provide information about a vulnerability in .NET 6.0, .NET 7.0 and .NET 8.0. This advisory also provides guidance on what developers can do to update their applications to address this vulnerability. A security feature bypass vulnerability exists when Microsoft .NET Framework-based applications use X.509 chain building APIs but do not completely validate the X.509 certificate due to a logic flaw. An attacker could present an arbitrary untrusted certificate with malformed signatures, triggering a bug in the framework. The framework will correctly report that X.509 chain building failed, but it will return an incorrect reason code for the failure. Applications which utilize this reason code to make their own chain building trust decisions may inadvertently treat this scenario as a successful chain build. This could allow an adversary to subvert the app's typical authentication logic. ### Affected software #### NuGet & NuGet Packages - Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.8.0 version or earlier. - Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.7.0 version or earlier. - Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.6.1 version or earlier. - Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.4.2 version or earlier. - Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.3.3 version or earlier. - Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.0.5 version or earlier. - Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 5.11.5 version or earlier. #### .NET SDK(s) - Any .NET SDK 6.0.126 or earlier, or 6.0.418 or earlier. - Any .NET SDK 7.0.115 or earlier, or 7.0.312 or earlier, or 7.0.405 or earlier. - Any .NET SDK 8.0.101 or earlier. ### Patches To fix the issue, please install the latest version of .NET 6.0, .NET 7.0 or .NET 8.0 and NuGet (NuGet.exe, NuGet.CommandLine, NuGet. Packaging versions). If you have installed one or more .NET SDKs through Visual Studio, Visual Studio will prompt you to update Visual Studio, which will also update your .NET SDKs. - If you're using NuGet.exe 6.8.0 or lower, you should download and install 6.8.1 from https://dist.nuget.org/win-x86-commandline/v6.8.1/nuget.exe. - If you're using NuGet.exe 6.7.0 or lower, you should download and install 6.7.1 from https://dist.nuget.org/win-x86-commandline/v6.7.1/nuget.exe. - If you're using NuGet.exe 6.6.1 or lower, you should download and install 6.6.2 from https://dist.nuget.org/win-x86-commandline/v6.6.2/nuget.exe. - If you're using NuGet.exe 6.4.2 or lower, you should download and install 6.4.3 from https://dist.nuget.org/win-x86-commandline/v6.4.3/nuget.exe. - If you're using NuGet.exe 6.3.3 or lower, you should download and install 6.3.4 from https://dist.nuget.org/win-x86-commandline/v6.3.4/nuget.exe. - If you're using NuGet.exe 6.0.5 or lower, you should download and install 6.0.6 from https://dist.nuget.org/win-x86-commandline/v6.0.6/nuget.exe. - If you're using NuGet.exe 5.11.5 or lower, you should download and install 5.11.6 from https://dist.nuget.org/win-x86-commandline/v5.11.6/nuget.exe. - If you're using .NET 8.0, you should download and install .NET 8.0.102 SDK (for Visual Studio 2022 v17.8) from https://dotnet.microsoft.com/download/dotnet-core/8.0 . - If you're using .NET 7.0, you should download and install SDK 7.0.116 (for Visual Studio 2022 v17.4), or SDK 7.0.313 (for Visual Studio 2022 v17.6), or 7.0.406 (for Visual Studio 2022 v17.7) from https://dotnet.microsoft.com/download/dotnet-core/7.0 . - If you're using .NET 6.0, you should download and install SDK 6.0.127 or SDK 6.0.419 (for Visual Studio 2022 v17.3) from https://dotnet.microsoft.com/download/dotnet-core/6.0 . ### Other details Announcement for this issue can be found at https://github.com/NuGet/Announcements/issues/71 MSRC details for this can be found at [CVE-2024-0057 - Security Update Guide - Microsoft - NET, .NET Framework, and Visual Studio Security Feature Bypass Vulnerability](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-0057)

CVE-2024-0057 Affected NuGet.CommandLine Versions

14 component(s)
Fixed Versions:
5.11.66.0.66.3.46.4.36.6.26.7.16.8.1
Product / Package Ecosystem Affected Versions Fixed Version
NuGet.CommandLine
NuGet
≥ 4.6.0
< 5.11.6
5.11.6
NuGet.Packaging
NuGet
≥ 4.6.0
< 5.11.6
5.11.6
NuGet.CommandLine
NuGet
≥ 6.0.0
< 6.0.6
6.0.6
NuGet.Packaging
NuGet
≥ 6.0.0
< 6.0.6
6.0.6
NuGet.CommandLine
NuGet
≥ 6.3.0
< 6.3.4
6.3.4
NuGet.Packaging
NuGet
≥ 6.3.0
< 6.3.4
6.3.4
NuGet.CommandLine
NuGet
≥ 6.4.0
< 6.4.3
6.4.3
NuGet.Packaging
NuGet
≥ 6.4.0
< 6.4.3
6.4.3
NuGet.CommandLine
NuGet
≥ 6.6.0
< 6.6.2
6.6.2
NuGet.Packaging
NuGet
≥ 6.6.0
< 6.6.2
6.6.2
NuGet.CommandLine
NuGet
≥ 6.7.0
< 6.7.1
All 1 versions
6.7.0
6.7.1
NuGet.Packaging
NuGet
≥ 6.7.0
< 6.7.1
All 1 versions
6.7.0
6.7.1
NuGet.CommandLine
NuGet
≥ 6.8.0
< 6.8.1
All 1 versions
6.8.0
6.8.1
NuGet.Packaging
NuGet
≥ 6.8.0
< 6.8.1
All 1 versions
6.8.0
6.8.1

References

Frequently Asked Questions

What is CVE-2024-0057?
CVE-2024-0057 is a security vulnerability in NuGet.CommandLine involving NuGet Client Security Feature Bypass Vulnerability under General Security Weakness.
Which NuGet.CommandLine versions are affected?
Affected versions include releases prior to 5.11.6, 6.0.6, 6.3.4, 6.4.3, 6.6.2, 6.7.1, 6.8.1 across affected packages: NuGet.CommandLine, NuGet.Packaging.
What version fixes CVE-2024-0057?
Upgrading to 5.11.6, 6.0.6, 6.3.4, 6.4.3, 6.6.2, 6.7.1, 6.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is NuGet.CommandLine affected?
Yes, NuGet.CommandLine is affected in releases prior to 5.11.6, 6.0.6, 6.3.4, 6.4.3, 6.6.2, 6.7.1, 6.8.1. Upgrade your dependency to 5.11.6, 6.0.6, 6.3.4, 6.4.3, 6.6.2, 6.7.1, 6.8.1 or later.
Is NuGet.Packaging affected?
Yes, NuGet.Packaging is affected in releases prior to 5.11.6, 6.0.6, 6.3.4, 6.4.3, 6.6.2, 6.7.1, 6.8.1. Upgrade your dependency to 5.11.6, 6.0.6, 6.3.4, 6.4.3, 6.6.2, 6.7.1, 6.8.1 or later.
What is the CVSS score of CVE-2024-0057?
CVE-2024-0057 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-0057?
CVE-2024-0057 is classified under General Security Weakness.
How can I check NuGet dependencies for CVE-2024-0057?
Run the dependency tree command: 'inspect dependencies for NuGet.CommandLine'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-68w7-72jg-6qpp",
  "modified" : "2024-04-16T15:37:56Z",
  "published" : "2024-02-13T21:18:10Z",
  "aliases" : [ "CVE-2024-0057" ],
  "summary" : "NuGet Client Security Feature Bypass Vulnerability ",
  "details" : "### Description\nMicrosoft is releasing this security advisory to provide information about a vulnerability in .NET 6.0, .NET 7.0 and .NET 8.0. This advisory also provides guidance on what developers can do to update their applications to address this vulnerability. \n\nA security feature bypass vulnerability exists when Microsoft .NET Framework-based applications use X.509 chain building APIs but do not completely validate the X.509 certificate due to a logic flaw. An attacker could present an arbitrary untrusted certificate with malformed signatures, triggering a bug in the framework. The framework will correctly report that X.509 chain building failed, but it will return an incorrect reason code for the failure. Applications which utilize this reason code to make their own chain building trust decisions may inadvertently treat this scenario as a successful chain build. This could allow an adversary to subvert the app's typical authentication logic. \n\n### Affected software\n#### NuGet & NuGet Packages\n- Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.8.0 version or earlier. \n- Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.7.0 version or earlier. \n- Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.6.1 version or earlier. \n- Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.4.2 version or earlier. \n- Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.3.3 version or earlier. \n- Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 6.0.5 version or earlier. \n- Any NuGet.exe, NuGet.CommandLine, NuGet.Packaging 5.11.5 version or earlier. \n\n#### .NET SDK(s)\n- Any .NET SDK 6.0.126 or earlier, or 6.0.418 or earlier.\n- Any .NET SDK 7.0.115 or earlier, or 7.0.312 or earlier, or 7.0.405 or earlier.\n- Any .NET SDK 8.0.101 or earlier.\n \n### Patches\nTo fix the issue, please install the latest version of .NET 6.0, .NET 7.0 or .NET 8.0 and NuGet (NuGet.exe, NuGet.CommandLine, NuGet. Packaging versions). If you have installed one or more .NET SDKs through Visual Studio, Visual Studio will prompt you to update Visual Studio, which will also update your .NET SDKs. \n- If you're using NuGet.exe 6.8.0 or lower, you should download and install 6.8.1 from https://dist.nuget.org/win-x86-commandline/v6.8.1/nuget.exe. \n- If you're using NuGet.exe 6.7.0 or lower, you should download and install 6.7.1 from https://dist.nuget.org/win-x86-commandline/v6.7.1/nuget.exe. \n- If you're using NuGet.exe 6.6.1 or lower, you should download and install 6.6.2 from https://dist.nuget.org/win-x86-commandline/v6.6.2/nuget.exe. \n- If you're using NuGet.exe 6.4.2 or lower, you should download and install 6.4.3 from https://dist.nuget.org/win-x86-commandline/v6.4.3/nuget.exe. \n- If you're using NuGet.exe 6.3.3 or lower, you should download and install 6.3.4 from https://dist.nuget.org/win-x86-commandline/v6.3.4/nuget.exe. \n- If you're using NuGet.exe 6.0.5 or lower, you should download and install 6.0.6 from https://dist.nuget.org/win-x86-commandline/v6.0.6/nuget.exe. \n- If you're using NuGet.exe 5.11.5 or lower, you should download and install 5.11.6 from https://dist.nuget.org/win-x86-commandline/v5.11.6/nuget.exe. \n- If you're using .NET 8.0, you should download and install .NET 8.0.102 SDK (for Visual Studio 2022 v17.8) from https://dotnet.microsoft.com/download/dotnet-core/8.0 . \n- If you're using .NET 7.0, you should download and install SDK 7.0.116 (for Visual Studio 2022 v17.4), or SDK 7.0.313 (for Visual Studio 2022 v17.6), or 7.0.406 (for Visual Studio 2022 v17.7) from https://dotnet.microsoft.com/download/dotnet-core/7.0 . \n- If you're using .NET 6.0, you should download and install SDK 6.0.127 or SDK 6.0.419 (for Visual Studio 2022 v17.3) from https://dotnet.microsoft.com/download/dotnet-core/6.0 . \n\n### Other details\nAnnouncement for this issue can be found at https://github.com/NuGet/Announcements/issues/71 \n\nMSRC details for this can be found at [CVE-2024-0057 - Security Update Guide - Microsoft - NET, .NET Framework, and Visual Studio Security Feature Bypass Vulnerability](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-0057)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.CommandLine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.6.0"
      }, {
        "fixed" : "5.11.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.Packaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.6.0"
      }, {
        "fixed" : "5.11.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.CommandLine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.Packaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.CommandLine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.3.0"
      }, {
        "fixed" : "6.3.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.Packaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.3.0"
      }, {
        "fixed" : "6.3.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.CommandLine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.4.0"
      }, {
        "fixed" : "6.4.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.Packaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.4.0"
      }, {
        "fixed" : "6.4.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.CommandLine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.6.0"
      }, {
        "fixed" : "6.6.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.Packaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.6.0"
      }, {
        "fixed" : "6.6.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.CommandLine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.7.0"
      }, {
        "fixed" : "6.7.1"
      } ]
    } ],
    "versions" : [ "6.7.0" ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.Packaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.7.0"
      }, {
        "fixed" : "6.7.1"
      } ]
    } ],
    "versions" : [ "6.7.0" ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.CommandLine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.8.0"
      }, {
        "fixed" : "6.8.1"
      } ]
    } ],
    "versions" : [ "6.8.0" ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NuGet.Packaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.8.0"
      }, {
        "fixed" : "6.8.1"
      } ]
    } ],
    "versions" : [ "6.8.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/NuGet/NuGet.Client/security/advisories/GHSA-68w7-72jg-6qpp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-0057"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NuGet/NuGet.Client/commit/3333f352ec47f0ebb489f20353dea7017f6cb00c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NuGet/NuGet.Client/commit/5e1ba955cca14328d2cb5723f211d5fbc9bcacb3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/NuGet/NuGet.Client"
  }, {
    "type" : "WEB",
    "url" : "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-0057"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240208-0007"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-13T21:18:10Z",
    "nvd_published_at" : null
  }
}