CVE-2026-39399
Published: 14 April 2026
Description
NuGet Gallery is a package repository that powers nuget.org. A security vulnerability exists in the NuGetGallery backend job’s handling of .nuspec files within NuGet packages. An attacker can supply a crafted nuspec file with malicious metadata, leading to cross package…
more
metadata injection that may result in remote code execution (RCE) and/or arbitrary blob writes due to insufficient input validation. The issue is exploitable via URI fragment injection using unsanitized package identifiers, allowing an attacker to control the resolved blob path. This enables writes to arbitrary blobs within the storage container, not limited to .nupkg files, resulting in potential tampering of existing content. This issue has been patched in commit 0e80f87628349207cdcaf55358491f8a6f1ca276.
Mitigating Controls (NIST 800-53 r5)AI
Directly addresses insufficient input validation of .nuspec metadata and unsanitized package identifiers to prevent crafted inputs enabling URI fragment injection, path traversal, and arbitrary blob writes.
Restricts types, amounts, and characteristics of inputs like package identifiers to block path traversal payloads and malicious metadata in uploaded NuGet packages.
Requires timely flaw remediation through patching vulnerabilities like this input validation issue, as implemented in the referenced commit to prevent exploitation.
Security SummaryAI
CVE-2026-39399 affects the NuGetGallery backend job's handling of .nuspec files within NuGet packages hosted on nuget.org, the package repository powered by NuGet Gallery. The vulnerability stems from insufficient input validation (CWE-20) and path traversal (CWE-22), allowing an attacker to supply a crafted .nuspec file containing malicious metadata. This leads to cross-package metadata injection, where unsanitized package identifiers enable URI fragment injection to manipulate blob path resolution.
Attackers with low privileges (PR:L), such as authenticated users able to upload packages, can exploit this over the network (AV:N) with low complexity (AC:L) and no user interaction (UI:N). Successful exploitation grants control over resolved blob paths, enabling arbitrary writes to blobs in the storage container—not limited to .nupkg files—potentially resulting in remote code execution (RCE), tampering of existing content, high integrity impact (I:H), and high availability impact (A:H) with changed scope (S:C). The CVSS v3.1 base score is 9.6.
The issue has been patched in NuGetGallery commit 0e80f87628349207cdcaf55358491f8a6f1ca276. Additional mitigation details are provided in the GitHub security advisory at GHSA-9r3h-v4hx-rhfr and the patch commit.
Details
- CWE(s)
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
The vulnerability enables exploitation of a public-facing application (nuget.org NuGet Gallery) via crafted .nuspec files in package uploads (T1190), allowing path traversal for arbitrary blob writes and tampering of package content, facilitating software supply chain compromise (T1195.002).