# GHSA-g4vj-cjjj-v7hg: Defense in Depth update for NuGet Client

> NuGet client lacked package ID and version validation during download, allowing potential supply chain attacks via malicious packages.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Apr 2026

## What is GHSA-g4vj-cjjj-v7hg?

GHSA-g4vj-cjjj-v7hg is a vulnerability in NuGet.CommandLine, published on 14 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
This update adds validation of the package ID and version during package download, in addition to the existing package signature validation.

### Patches

#### NuGet

The following NuGet.exe, NuGet.CommandLine, NuGet.Packaging, and NuGet.Protocol versions have been patched:

|Affected versions|Patched version|
|--|--|
|>= 4.9.0, <= 4.9.6|4.9.7|
|>= 5.11.0, <= 5.11.6|5.11.7|
|>= 6.8.0, <= 6.8.1|6.8.2|
|>= 6.11.0, <= 6.11.1|6.11.2|
|>= 6.12.0, <= 6.12.4|6.12.5|
|>= 6.14.0, <= 6.14.2|6.14.3|
|>= 7.0.0, <= 7.0.2|7.0.3|
|7.3.0|7.3.1|

#### .NET SDK

* .NET 8.0.126 SDK
* .NET 8.0.420 SDK
* .NET 9.0.116 SDK
* .NET 9.0.313 SDK
* .NET 10.0.106 SDK
* .NET 10.0.202 SDK

### Workarounds
N/A

### References
https://github.com/NuGet/NuGetGallery/security/advisories/GHSA-9r3h-v4hx-rhfr

### Credit
[splitline](https://x.com/_splitline_) with [DEVCORE](https://devco.re/)

## Which versions are affected by GHSA-g4vj-cjjj-v7hg?

40 open source packages ship an affected version, including NuGet.CommandLine, NuGet.Packaging and NuGet.Protocol.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `NuGet.CommandLine` | NuGet | From 4.9.0 | 4.9.7 |
| `NuGet.CommandLine` | NuGet | From 4.9.0 | 4.9.7 |
| `NuGet.CommandLine` | NuGet | From 5.11.0 | 5.11.7 |
| `NuGet.CommandLine` | NuGet | From 5.11.0 | 5.11.7 |
| `NuGet.CommandLine` | NuGet | From 6.11.0 | 6.11.2 |
| `NuGet.CommandLine` | NuGet | From 6.11.0 | 6.11.2 |
| `NuGet.CommandLine` | NuGet | From 6.12.0 | 6.12.5 |
| `NuGet.CommandLine` | NuGet | From 6.12.0 | 6.12.5 |
| `NuGet.CommandLine` | NuGet | From 6.14.0 | 6.14.3 |
| `NuGet.CommandLine` | NuGet | From 6.14.0 | 6.14.3 |
| `NuGet.CommandLine` | NuGet | From 6.8.0 | 6.8.2 |
| `NuGet.CommandLine` | NuGet | From 6.8.0 | 6.8.2 |
| `NuGet.CommandLine` | NuGet | From 7.0.0 | 7.0.3 |
| `NuGet.CommandLine` | NuGet | From 7.0.0 | 7.0.3 |
| `NuGet.CommandLine` | NuGet | From 7.3.0 | 7.3.1 |
| `NuGet.CommandLine` | NuGet | From 7.3.0 | 7.3.1 |
| `NuGet.Packaging` | NuGet | From 4.9.0 | 4.9.7 |
| `NuGet.Packaging` | NuGet | From 4.9.0 | 4.9.7 |
| `NuGet.Packaging` | NuGet | From 5.11.0 | 5.11.7 |
| `NuGet.Packaging` | NuGet | From 5.11.0 | 5.11.7 |
| `NuGet.Packaging` | NuGet | From 6.11.0 | 6.11.2 |
| `NuGet.Packaging` | NuGet | From 6.11.0 | 6.11.2 |
| `NuGet.Packaging` | NuGet | From 6.12.0 | 6.12.5 |
| `NuGet.Packaging` | NuGet | From 6.12.0 | 6.12.5 |
| `NuGet.Packaging` | NuGet | From 6.14.0 | 6.14.3 |
| `NuGet.Packaging` | NuGet | From 6.14.0 | 6.14.3 |
| `NuGet.Packaging` | NuGet | From 6.8.0 | 6.8.2 |
| `NuGet.Packaging` | NuGet | From 6.8.0 | 6.8.2 |
| `NuGet.Packaging` | NuGet | From 7.0.0 | 7.0.3 |
| `NuGet.Packaging` | NuGet | From 7.0.0 | 7.0.3 |
| `NuGet.Packaging` | NuGet | From 7.3.0 | 7.3.1 |
| `NuGet.Packaging` | NuGet | From 7.3.0 | 7.3.1 |
| `NuGet.Protocol` | NuGet | From 4.9.0 | 4.9.7 |
| `NuGet.Protocol` | NuGet | From 4.9.0 | 4.9.7 |
| `NuGet.Protocol` | NuGet | From 5.11.0 | 5.11.7 |
| `NuGet.Protocol` | NuGet | From 5.11.0 | 5.11.7 |
| `NuGet.Protocol` | NuGet | From 6.11.0 | 6.11.2 |
| `NuGet.Protocol` | NuGet | From 6.11.0 | 6.11.2 |
| `NuGet.Protocol` | NuGet | From 6.12.0 | 6.12.5 |
| `NuGet.Protocol` | NuGet | From 6.12.0 | 6.12.5 |

## How do I fix GHSA-g4vj-cjjj-v7hg?

Upgrade NuGet.CommandLine to a fixed version for your release line: 4.9.7, 5.11.7, 6.11.2 or 6.12.5.

## Is GHSA-g4vj-cjjj-v7hg being exploited?

There is no known exploitation of GHSA-g4vj-cjjj-v7hg in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g4vj-cjjj-v7hg and fix it if it is affected.

What it is: GHSA-g4vj-cjjj-v7hg is a vulnerability in NuGet.CommandLine, published on 14 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-g4vj-cjjj-v7hg in the wild and no public exploit code.

Affected packages and fixed versions:
- NuGet.CommandLine (NuGet): affected from 4.9.0; fixed in 4.9.7
- NuGet.CommandLine (NuGet): affected from 4.9.0; fixed in 4.9.7
- NuGet.CommandLine (NuGet): affected from 5.11.0; fixed in 5.11.7
- NuGet.CommandLine (NuGet): affected from 5.11.0; fixed in 5.11.7
- NuGet.CommandLine (NuGet): affected from 6.11.0; fixed in 6.11.2
- NuGet.CommandLine (NuGet): affected from 6.11.0; fixed in 6.11.2
- NuGet.CommandLine (NuGet): affected from 6.12.0; fixed in 6.12.5
- NuGet.CommandLine (NuGet): affected from 6.12.0; fixed in 6.12.5
- NuGet.CommandLine (NuGet): affected from 6.14.0; fixed in 6.14.3
- NuGet.CommandLine (NuGet): affected from 6.14.0; fixed in 6.14.3
- NuGet.CommandLine (NuGet): affected from 6.8.0; fixed in 6.8.2
- NuGet.CommandLine (NuGet): affected from 6.8.0; fixed in 6.8.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-g4vj-cjjj-v7hg/ (Markdown: https://insights.sbomify.com/GHSA-g4vj-cjjj-v7hg/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g4vj-cjjj-v7hg

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g4vj-cjjj-v7hg/
Summaries are generated and may contain mistakes; the official description above is the record.
