# CVE-2023-29337: NuGet Client Remote Code Execution Vulnerability

> A race condition in the NuGet client allows attackers to execute arbitrary code during package installation.

- **Severity:** High 7.1 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Jun 2023
- **Updated:** 1 Jan 2025
- **Also known as:** CLEANSTART-2025-EH90452, DEBIAN-CVE-2023-29337, GHSA-6qmf-mmc7-6c2p, UBUNTU-CVE-2023-29337

## What is CVE-2023-29337?

CVE-2023-29337 is a high-severity vulnerability in Microsoft NuGet 5.11.4, published on 14 Jun 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

NuGet Client Remote Code Execution Vulnerability

Weakness: CWE-367 (Time-of-check Time-of-use (TOCTOU) Race Condition)

## Which versions are affected by CVE-2023-29337?

40 open source packages ship an affected version, including NuGet.CommandLine, Microsoft.Build.NuGetSdkResolver and NuGet.Commands. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `NuGet.CommandLine` | NuGet | From 4.6.0 | 5.11.5 |
| `NuGet.CommandLine` | NuGet | From 4.6.0 | 5.11.5 |
| `NuGet.CommandLine` | NuGet | From 6.0.0 | 6.0.5 |
| `NuGet.CommandLine` | NuGet | From 6.0.0 | 6.0.5 |
| `NuGet.CommandLine` | NuGet | From 6.2.0 | 6.2.4 |
| `NuGet.CommandLine` | NuGet | From 6.2.0 | 6.2.4 |
| `NuGet.CommandLine` | NuGet | From 6.3.0 | 6.3.3 |
| `NuGet.CommandLine` | NuGet | From 6.3.0 | 6.3.3 |
| `NuGet.CommandLine` | NuGet | From 6.4.0 | 6.4.2 |
| `NuGet.CommandLine` | NuGet | From 6.4.0 | 6.4.2 |
| `NuGet.CommandLine` | NuGet | From 6.5.0 | 6.5.1 |
| `NuGet.CommandLine` | NuGet | From 6.5.0 | 6.5.1 |
| `NuGet.CommandLine` | NuGet | From 6.6.0 | 6.6.1 |
| `NuGet.CommandLine` | NuGet | From 6.6.0 | 6.6.1 |
| `Microsoft.Build.NuGetSdkResolver` | NuGet | All versions | None |
| `Microsoft.Build.NuGetSdkResolver` | NuGet | All versions | None |
| `NuGet.Commands` | NuGet | From 4.6.0 | 5.11.5 |
| `NuGet.Commands` | NuGet | From 4.6.0 | 5.11.5 |
| `NuGet.Commands` | NuGet | From 6.0.0 | 6.0.5 |
| `NuGet.Commands` | NuGet | From 6.0.0 | 6.0.5 |
| `NuGet.Commands` | NuGet | From 6.2.0 | 6.2.4 |
| `NuGet.Commands` | NuGet | From 6.2.0 | 6.2.4 |
| `NuGet.Commands` | NuGet | From 6.3.0 | 6.3.3 |
| `NuGet.Commands` | NuGet | From 6.3.0 | 6.3.3 |
| `NuGet.Commands` | NuGet | From 6.4.0 | 6.4.2 |
| `NuGet.Commands` | NuGet | From 6.4.0 | 6.4.2 |
| `NuGet.Commands` | NuGet | From 6.5.0 | 6.5.1 |
| `NuGet.Commands` | NuGet | From 6.5.0 | 6.5.1 |
| `NuGet.Commands` | NuGet | From 6.6.0 | 6.6.1 |
| `NuGet.Commands` | NuGet | From 6.6.0 | 6.6.1 |
| `NuGet.Common` | NuGet | From 4.6.0 | 5.11.5 |
| `NuGet.Common` | NuGet | From 4.6.0 | 5.11.5 |
| `NuGet.Common` | NuGet | From 6.0.0 | 6.0.5 |
| `NuGet.Common` | NuGet | From 6.0.0 | 6.0.5 |
| `NuGet.Common` | NuGet | From 6.2.0 | 6.2.4 |
| `NuGet.Common` | NuGet | From 6.2.0 | 6.2.4 |
| `NuGet.Common` | NuGet | From 6.3.0 | 6.3.3 |
| `NuGet.Common` | NuGet | From 6.3.0 | 6.3.3 |
| `NuGet.Common` | NuGet | From 6.4.0 | 6.4.2 |
| `NuGet.Common` | NuGet | From 6.4.0 | 6.4.2 |

Products: Microsoft Nuget.

## How do I fix CVE-2023-29337?

Upgrade NuGet.CommandLine to a fixed version for your release line: 5.11.5, 6.0.5, 6.2.4 or 6.3.3.

## Is CVE-2023-29337 being exploited?

There is no known exploitation of CVE-2023-29337 in the wild and no public exploit code.

## Other vulnerabilities in Microsoft NuGet 5.11.4

- [CVE-2019-0976](https://insights.sbomify.com/CVE-2019-0976/): NuGet Package Manager Tampering Vulnerability (medium 5.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-29337 and fix it if it is affected.

What it is: CVE-2023-29337 is a high-severity vulnerability in Microsoft NuGet 5.11.4, published on 14 Jun 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-29337 in the wild and no public exploit code.

Affected packages and fixed versions:
- NuGet.CommandLine (NuGet): affected from 4.6.0; fixed in 5.11.5
- NuGet.CommandLine (NuGet): affected from 4.6.0; fixed in 5.11.5
- NuGet.CommandLine (NuGet): affected from 6.0.0; fixed in 6.0.5
- NuGet.CommandLine (NuGet): affected from 6.0.0; fixed in 6.0.5
- NuGet.CommandLine (NuGet): affected from 6.2.0; fixed in 6.2.4
- NuGet.CommandLine (NuGet): affected from 6.2.0; fixed in 6.2.4
- NuGet.CommandLine (NuGet): affected from 6.3.0; fixed in 6.3.3
- NuGet.CommandLine (NuGet): affected from 6.3.0; fixed in 6.3.3
- NuGet.CommandLine (NuGet): affected from 6.4.0; fixed in 6.4.2
- NuGet.CommandLine (NuGet): affected from 6.4.0; fixed in 6.4.2
- NuGet.CommandLine (NuGet): affected from 6.5.0; fixed in 6.5.1
- NuGet.CommandLine (NuGet): affected from 6.5.0; fixed in 6.5.1

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/CVE-2023-29337/ (Markdown: https://insights.sbomify.com/CVE-2023-29337/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-29337
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-29337
- OSV: https://osv.dev/vulnerability/CVE-2023-29337

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-29337/
Summaries are generated and may contain mistakes; the official description above is the record.
