high · 7CVE-2026-50526Jul 21, 2026

CVE-2026-50526: Microsoft.NET.Build.Containers Symlink Following Allows Container Image Tampering

Pranav Khune
Penetration Testing Team Lead, SecureLayer7

A local attacker on a shared machine can replace the .NET SDK container build staging directory with a symlink, causing files they control to be silently bundled into container images built by other…

PackageMicrosoft.NET.Build.Containers
Ecosystemnuget
Affected>= 10.0.0, <= 10.0.9
Fixed in10.0.10

The problem

The Microsoft.NET.Build.Containers package (used by dotnet publish /t:PublishContainer) writes layer content to a temporary staging directory before packaging it into an OCI image. On affected versions, the SDK does not verify that this staging path is a real directory and not a symlink controlled by another local user.

A low-privileged attacker who shares the build machine can race the build process: they delete the staging directory, plant a symlink pointing to attacker-controlled content, and the SDK then reads from that location instead. Any files the attacker placed under the symlink target get incorporated into the container image assembled by the victim's (potentially elevated) build process.

Impact is full confidentiality, integrity, and availability loss on the resulting image (CVSS 7.0, AV:L/AC:H/PR:L/UI:N).

The fix

Update Microsoft.NET.Build.Containers to 10.0.10 (for .NET 10), 9.0.18 (for .NET 9), or 8.0.29 (for .NET 8). Install the July 2026 .NET SDK update via dotnet --info to confirm your version, or let Visual Studio apply it automatically. After updating, rebuild and republish any self-contained apps or container images that were produced with an affected SDK version, since previously built images may already contain attacker-influenced content.

Reported by Anonymous, Siwei Li (Microsoft).

References: [1][2][3][4][5][6]

Related research