CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-120778

CVE-2026-120778: Local Elevation of Privilege via Insecure Temporary Directory Handling and MSBuild Response File Hijacking in Microsoft .NET Aspire CLI

Alon Barad
Alon Barad
Software Engineer

Nov 11, 2026·10 min read·2 visits

Executive Summary (TL;DR)

Microsoft .NET Aspire CLI (< 13.6.5) creates temporary MSBuild projects in world-writable shared `/tmp` directories without disabling automatic response file discovery. Local attackers on multi-user systems can plant malicious `Directory.Build.rsp` files in `/tmp` to achieve arbitrary code execution and privilege escalation when another user runs `aspire sdk` commands.

A local elevation of privilege vulnerability exists in the Microsoft .NET Aspire CLI (`Aspire.Cli`) versions 13.5.4 prior to 13.6.5. When executing SDK management commands (`aspire sdk generate`, `aspire sdk dump`, and `aspire sdk export`), the CLI creates temporary project directories inside the shared operating system temporary folder (such as `/tmp` on Unix-like systems) without restricting directory permissions or disabling MSBuild automatic response file resolution. A local, low-privileged attacker on a multi-user system can place a crafted `Directory.Build.rsp` file in the shared temporary directory hierarchy. When a victim user executes an affected Aspire CLI command, MSBuild traverses upward, ingests the attacker-controlled response file, and executes arbitrary commands in the security context of the victim user.

Vulnerability Overview

Microsoft .NET Aspire is a cloud-native application development stack designed for building observable, production-ready distributed applications. Its command-line interface (Aspire.Cli) includes a suite of SDK subcommands—specifically aspire sdk generate, aspire sdk dump, and aspire sdk export—that developers and continuous integration pipelines use to inspect, generate, and export metadata and integration bindings for Aspire AppHost projects.

To perform capability scanning and metadata generation, the Aspire CLI dynamically provisions temporary .NET projects on disk and invokes the .NET SDK (dotnet restore and dotnet build) against them. In Aspire.Cli versions from 13.5.4 up to 13.6.5, these temporary project directories were generated directly inside the system-wide temporary directory returned by Path.GetTempPath() or Directory.CreateTempSubdirectory(). On Linux and macOS systems, this resolves to /tmp or /var/tmp, which are world-writable directories shared across all local user accounts.

The vulnerability (tracked as CVE-2026-120778 and classified under CWE-379: Creation of Temporary File in Directory with Insecure Permissions and CWE-427: Uncontrolled Search Path Element) arises from the interaction between shared temporary directory placement and MSBuild's upward directory traversal behavior. When MSBuild runs, it searches the project directory and all ancestor directories up to the filesystem root for automatic configuration and response files, notably Directory.Build.rsp, Directory.Build.props, and Directory.Build.targets.

Because the temporary build projects were situated inside /tmp and invoked without suppressing automatic response file resolution, an unprivileged local user can plant a malicious Directory.Build.rsp file inside /tmp. When another user on the same host runs an aspire sdk command, the underlying MSBuild process parses the attacker's response file, resulting in arbitrary command execution under the victim user's privileges.

Root Cause Analysis

The root cause of CVE-2026-120778 is a combination of three distinct implementation flaws in how Aspire.Cli manages temporary workspaces and invokes child dotnet processes.

First, the CLI relied on standard .NET runtime temporary directory APIs (Directory.CreateTempSubdirectory and Path.Combine(Path.GetTempPath(), ...)) without isolating the workspace root per user. While Directory.CreateTempSubdirectory creates the immediate leaf directory with restricted permissions on modern .NET runtimes, its parent directory (/tmp) remains world-writable (1777). Furthermore, in SdkGenerateCommand.cs, the CLI constructed an intermediate directory (/tmp/aspire-sdk-gen/<guid>) using Directory.CreateDirectory(), which inherits the process umask (typically 0755), allowing other local users to traverse or pre-create directory structures.

Second, MSBuild implements an upward file discovery mechanism by default. Whenever dotnet restore or dotnet build is executed on a project file, the MSBuild engine walks up the directory tree from the target .csproj location toward the root filesystem (/) looking for Directory.Build.rsp. Any command-line switches or target definitions contained within a discovered Directory.Build.rsp file are automatically prepended to the MSBuild invocation arguments.

Third, when DotNetCliRunner constructed the command-line arguments for dotnet restore and dotnet build to compile the temporary AppHost capability scanner, it omitted the -noAutoResponse switch. Without this switch or an isolation boundary stopping upward traversal, any build occurring inside a subdirectory of /tmp implicitly trusts files placed in /tmp.

Additionally, a secondary insecure temporary file issue existed in DeprecatedMcpCommandScanner.cs, where diagnostic scan logs were appended directly to a hardcoded, predictable path (/tmp/aspire-deprecated-scan.log) without exclusive file creation flags or restrictive permissions (0600). Similarly, FileLoggerProvider.cs created diagnostic log streams without enforcing owner-only Unix file modes.

Code Analysis

Reviewing commit 1ecd7cc70b5a5a5b8571fe3af69faa1646b8de47 reveals how the vulnerable code paths were structured and subsequently remediated across Aspire.Cli.

In the unpatched versions of SdkDumpCommand.cs, SdkExportCommand.cs, and SdkGenerateCommand.cs, temporary directories were allocated directly in the system temporary folder:

// Vulnerable code in SdkDumpCommand.cs & SdkExportCommand.cs
var tempDirectory = Directory.CreateTempSubdirectory("aspire-sdk-dump-");
try
{
    outputPath = Path.Combine(tempDirectory.FullName, "capabilities.json");
    // Invokes AppHost server build inside tempDirectory
}
 
// Vulnerable code in SdkGenerateCommand.cs
var tempDir = Path.Combine(Path.GetTempPath(), "aspire-sdk-gen", Guid.NewGuid().ToString("N")[..8]);
Directory.CreateDirectory(tempDir);

To eliminate reliance on the shared OS temp directory, Microsoft introduced CliPathHelper.CreateSdkWorkingDirectory and DirectoryHelper.CreateWithOwnerOnlyPermissions. Temporary SDK workspaces are now created inside the user's private Aspire home directory (<ASPIRE_HOME>/tmp/sdk/<guid>) with strict 0700 Unix permissions (UserRead | UserWrite | UserExecute). An empty aspire.config.json file is also written to the directory to act as a configuration boundary anchor:

// Patched code in src/Aspire.Cli/Utils/CliPathHelper.cs
internal static DirectoryInfo CreateSdkWorkingDirectory(DirectoryInfo aspireHomeDirectory)
{
    ArgumentNullException.ThrowIfNull(aspireHomeDirectory);
 
    // Enforce 0700 permissions on every level of the temporary hierarchy
    var tempRoot = DirectoryHelper.CreateWithOwnerOnlyPermissions(
        Path.Combine(aspireHomeDirectory.FullName, "tmp"));
    var sdkRoot = DirectoryHelper.CreateWithOwnerOnlyPermissions(
        Path.Combine(tempRoot.FullName, "sdk"));
    var directory = DirectoryHelper.CreateWithOwnerOnlyPermissions(
        Path.Combine(sdkRoot.FullName, Guid.NewGuid().ToString("N")));
 
    // Write an empty config anchor so configuration discovery stops here
    File.WriteAllText(
        Path.Combine(directory.FullName, Configuration.AspireConfigFile.FileName), "{}");
 
    return directory;
}

The helper DirectoryHelper.CreateWithOwnerOnlyPermissions enforces 0700 permissions both when creating new directories and when repairing pre-existing directories on Unix platforms:

// Patched code in src/Aspire.Cli/Utils/DirectoryHelper.cs
internal static DirectoryInfo CreateWithOwnerOnlyPermissions(string path)
{
    if (OperatingSystem.IsWindows())
    {
        return Directory.CreateDirectory(path);
    }
 
    const UnixFileMode ownerOnlyPermissions =
        UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute;
 
    var directory = Directory.CreateDirectory(path, ownerOnlyPermissions);
    File.SetUnixFileMode(directory.FullName, ownerOnlyPermissions);
    return directory;
}

To address the MSBuild response file hijacking vector directly, DotNetCliRunner.cs was updated to support a NoAutoResponse option in ProcessInvocationOptions, appending -noAutoResponse to dotnet restore and dotnet build commands:

// Patched code in src/Aspire.Cli/DotNet/DotNetCliRunner.cs
string[] cliArgs = ["restore", projectFilePath.FullName];
if (options.NoAutoResponse)
{
    // Prevents MSBuild from loading Directory.Build.rsp from current or parent directories
    cliArgs = [.. cliArgs, "-noAutoResponse"];
}

In AppHostServerProject.cs, both RestoreAsync and BuildAsync now initialize ProcessInvocationOptions with NoAutoResponse = true. Finally, DeprecatedMcpCommandScanner.cs was stripped of its /tmp/aspire-deprecated-scan.log file writes, and FileLoggerProvider.cs was hardened to open log files using UnixCreateMode = UnixFileMode.UserRead | UnixFileMode.UserWrite (0600).

> [!NOTE] > Fix Completeness Assessment: The remediation applies defense-in-depth by addressing both the filesystem permission weakness and the MSBuild execution behavior. Relocating the working directory under <ASPIRE_HOME>/tmp/sdk with 0700 permissions prevents other local users from traversing or writing into the build hierarchy. Adding -noAutoResponse ensures that even if an ancestor directory above <ASPIRE_HOME> were writable by another party, MSBuild will not auto-load Directory.Build.rsp files. However, note that MSBuild still evaluates Directory.Build.props and Directory.Build.targets in ancestor directories unless /p:ImportDirectoryBuildProps=false and /p:ImportDirectoryBuildTargets=false are specified; relocating the build out of /tmp and into the user's private home directory mitigates that vector provided the user's home directory tree itself is not world-writable.

Exploitation

Exploiting CVE-2026-120778 requires local access to a shared multi-user Unix/Linux or macOS system where a victim user runs an affected version of .NET Aspire CLI (13.5.4 through 13.6.4). No special privileges are required by the attacker beyond standard write permissions to /tmp.

Attack Prerequisites

  1. Local Access: The attacker must have a low-privileged local account or code execution within a shared environment (such as a shared build agent, development server, or multi-tenant host) that shares /tmp with the target user.
  2. User Interaction: A victim user (or automated CI/CD service account) must execute aspire sdk generate, aspire sdk dump, or aspire sdk export.

Exploitation Steps

  1. Stage Malicious Target and Response File: The attacker creates an MSBuild targets file /tmp/payload.targets containing an inline <Exec> task, and a response file /tmp/Directory.Build.rsp that instructs MSBuild to import or execute that target.
<!-- /tmp/payload.targets -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="HijackBuild" BeforeTargets="Restore;Build">
    <Exec Command="/bin/sh -c 'id > /tmp/pwned_by_aspire; chmod +s /tmp/victim_shell'" />
  </Target>
</Project>
  1. Plant the Response File in /tmp: The attacker writes /tmp/Directory.Build.rsp to inject the custom target or property into any MSBuild process running beneath /tmp:
-p:CustomBeforeMicrosoftCommonTargets=/tmp/payload.targets
-target:HijackBuild
  1. Trigger via Victim CLI Execution: When the victim user runs aspire sdk dump or aspire sdk generate in their own workspace, the Aspire CLI creates /tmp/aspire-sdk-dump-<random>/ or /tmp/aspire-sdk-gen/<guid>/ and invokes dotnet restore and dotnet build on the generated capability scanner project.
  2. Payload Execution: MSBuild walks up from /tmp/aspire-sdk-.../ to /tmp, finds /tmp/Directory.Build.rsp, appends the attacker's arguments, and executes HijackBuild under the victim's UID/GID.

In the regression test suite added in commit 1ecd7cc70b5a5a5b8571fe3af69faa1646b8de47 (SdkResponseFileTests.cs), Microsoft verified this exact mechanism by writing -target:ResponseFileMustNotBeLoaded into a parent Directory.Build.rsp file and confirming that unpatched builds trigger the injected target while patched aspire sdk commands ignore it.

Impact Assessment

CVE-2026-120778 is rated High severity with a CVSS v3.1 score of 7.3 (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H). The primary impact is local elevation of privilege across user boundaries on shared workstations, build servers, and development hosts.

When successfully exploited, the attacker achieves arbitrary code execution in the security context of the user invoking the Aspire CLI. This grants the attacker full Confidentiality (High), Integrity (High), and Availability (High) impact over the victim user's environment:

  • Confidentiality: The attacker can read sensitive source code, cloud credentials, NuGet API keys, SSH private keys, and environment variables belonging to the victim developer or CI runner.
  • Integrity: The attacker can modify the victim's source repositories, inject malicious backdoors into compiled application artifacts during the SDK build step, or persist access by modifying the victim's shell profile (~/.bashrc, ~/.zshrc).
  • Availability: The attacker can terminate processes, corrupt build outputs, or delete files owned by the victim account.

As of disclosure, there are no reports of active exploitation in the wild, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Windows environments are generally less exposed to the cross-user /tmp vector because Path.GetTempPath() on Windows resolves to per-user directories (C:\Users\<username>\AppData\Local\Temp), whereas Linux and macOS resolve /tmp or /var/tmp to a shared global directory unless TMPDIR is explicitly isolated per user.

Remediation

Microsoft resolved CVE-2026-120778 in .NET Aspire version 13.6.5, released on November 10, 2026. All users and administrators operating multi-user development environments or shared CI/CD build agents should upgrade to version 13.6.5 or later.

Applying the Update

To update the .NET Aspire workload and CLI tool to the patched release, run the following commands:

# Update .NET workloads
dotnet workload update
 
# Update the Aspire CLI global tool (if installed as a standalone tool)
dotnet tool update -g Aspire.Cli --version 13.6.5
 
# Verify the installed CLI version is 13.6.5 or newer
aspire --version

Temporary Workarounds

If an immediate upgrade to .NET Aspire 13.6.5 is not feasible, administrators and developers on shared Unix/Linux and macOS hosts can mitigate the vulnerability using the following controls:

  1. Isolate TMPDIR Per User: Configure the environment so TMPDIR points to an owner-only directory inside the user's home directory (0700) before invoking aspire commands:
    mkdir -m 0700 -p "$HOME/.tmp"
    export TMPDIR="$HOME/.tmp"
    Because .NET's Path.GetTempPath() respects the TMPDIR environment variable on Unix-like platforms, setting TMPDIR to a private directory inside $HOME prevents traversal through /tmp.
  2. Audit /tmp for MSBuild Files: Monitor and clean /tmp and /var/tmp for unauthorized Directory.Build.rsp, Directory.Build.props, and Directory.Build.targets files.
  3. Use pam_namespace or Private /tmp Mounts: On shared Linux hosts, configure per-user polyinstantiated /tmp directories via pam_namespace or execute CI jobs inside isolated container namespaces with private /tmp tmpfs mounts.

Official Patches

MicrosoftMicrosoft Security Response Center (MSRC) Advisory for CVE-2026-120778
Microsoft.NET Aspire v13.6.5 Release Notes and Patch Tag
MicrosoftGitHub Pull Request 22071 in microsoft/aspire

Fix Analysis (5)

Technical Appendix

CVSS Score
7.3/ 10
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

Affected Systems

Microsoft .NET Aspire CLI (Aspire.Cli)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Aspire.Cli (.NET Aspire CLI)
Microsoft
>= 13.5.4, < 13.6.513.6.5
AttributeDetail
CVE IDCVE-2026-120778
Vulnerability ClassCWE-379 (Creation of Temporary File in Directory with Insecure Permissions)
Attack VectorLocal (Shared /tmp Directory & MSBuild Response File Traversal)
CVSS v3.1 Score7.3 High (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H)
ImpactLocal Elevation of Privilege (Arbitrary Code Execution as Victim User)
Affected VersionsMicrosoft .NET Aspire CLI 13.5.4 to < 13.6.5
Patched VersionMicrosoft .NET Aspire CLI 13.6.5
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1574Hijack Execution Flow
Privilege Escalation
T1574.009Path Interception by Unquoted Path
Privilege Escalation
T1059Command and Scripting Interpreter
Execution
CWE-379
Creation of Temporary File in Directory with Insecure Permissions

The product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.

Vulnerability Timeline

Preliminary PR commits initiated on release/13.6 branch
2026-10-20
Official isolation fix commit merged into microsoft/aspire (1ecd7cc70b5a5a5b8571fe3af69faa1646b8de47)
2026-11-06
Microsoft Security Response Center (MSRC) publishes CVE-2026-120778
2026-11-10
.NET Aspire 13.6.5 released with official security patches
2026-11-10
CVE record published to CVE.org and NVD
2026-11-10

References & Sources

  • [1]MSRC Security Update Guide: CVE-2026-120778
  • [2]CVE.org Record: CVE-2026-120778
  • [3]NVD Vulnerability Detail: CVE-2026-120778
  • [4]GitHub Fix Commit: 1ecd7cc70b5a5a5b8571fe3af69faa1646b8de47
  • [5]GitHub Pull Request #22071
  • [6]GitHub Release Tag: v13.6.5
  • [7]GitHub Commit: c408ec5bf44e43203c278990a43aea93145248f3
  • [8]GitHub Commit: 6cfe6b409805bb21775623d501aa1475cb9ee25c
  • [9]GitHub Commit: c3d649db33907f697f5fa29bdaae5d92b8ba975c
  • [10]GitHub Commit: b33d222049f1ecc3bc7257ec07b622fe550b2580

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•5 minutes ago•CVE-2026-124194
6.5

CVE-2026-124194: Forced Authentication and NetNTLMv2 Credential Leakage in Microsoft Office Outlook

CVE-2026-124194 is a forced authentication and spoofing vulnerability in Microsoft Office Outlook caused by a missing user interface warning before dereferencing remote network paths (CWE-356). By embedding an attacker-controlled Universal Naming Convention (UNC) path within MAPI message properties such as PidLidReminderFileParameter, an unauthenticated remote attacker can force a victim's system to initiate an outbound SMB or WebDAV connection upon opening or previewing a crafted message. This automatic authentication handshake leaks the user's NetNTLMv2 hash, enabling offline password cracking or real-time NTLM relay attacks. The vulnerability was exploited in the wild as a zero-day prior to its remediation in Microsoft's November 2026 Patch Tuesday updates and is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.

Alon Barad
Alon Barad
0 views•10 min read
•17 minutes ago•CVE-2026-114154
7.5

CVE-2026-114154: Denial of Service in ASP.NET Core HttpSys Request Header Processing

CVE-2026-114154 is a high-severity Denial of Service (DoS) and uncontrolled resource consumption vulnerability in the Microsoft.AspNetCore.Server.HttpSys component of ASP.NET Core. When processing an HTTP request that simultaneously contains a chunked Transfer-Encoding header, a Content-Length header, and an explicit X-Content-Length header, the server throws an unhandled ArgumentException during header normalization. In certain versions, subsequent exception handling attempts to dereference a disposed native request context, aborting error response dispatch and leaking unmanaged HTTP.sys request structures.

Amit Schendel
Amit Schendel
1 views•9 min read
•about 2 hours ago•CVE-2026-120792
7.3

CVE-2026-120792: Local Information Disclosure via Temporary File Logging in Microsoft .NET Aspire CLI

CVE-2026-120792 is a high-severity local information disclosure vulnerability in the Microsoft .NET Aspire CLI (Aspire.Cli) affecting versions 13.5.4 prior to 13.6.5. The flaw stems from the insertion of sensitive information into a shared temporary log file (CWE-532) combined with insecure temporary file creation (CWE-377) within the DeprecatedMcpCommandScanner component. During agent configuration scanning, the CLI unconditionally appends internal workspace paths and the first 200 characters of Model Context Protocol (MCP) agent configuration files to a statically named file in the system temporary directory. On multi-user systems, unprivileged local users can read this file to harvest API keys, authentication tokens, and internal service endpoints.

Alon Barad
Alon Barad
3 views•9 min read
•about 3 hours ago•CVE-2026-114159
8.8

CVE-2026-114159: Heap-Based Buffer Overflow in Microsoft Visual Studio and .NET Native Symbol Reader

CVE-2026-114159 is a heap-based buffer overflow vulnerability (CWE-122) in Microsoft.DiaSymReader.Native affecting Microsoft Visual Studio and the .NET Runtime on Windows. An integer truncation error during the parsing of oversized document names in Portable PDB symbol files causes an undersized heap allocation, leading to an out-of-bounds memory write and remote code execution.

Alon Barad
Alon Barad
6 views•10 min read
•about 4 hours ago•CVE-2026-114158
8.8

CVE-2026-114158: Heap-Based Buffer Overflow in Microsoft.DiaSymReader.Native Portable PDB Parser

CVE-2026-114158 is a high-severity remote code execution vulnerability affecting Microsoft Visual Studio 2026 and multiple supported servicing branches of Microsoft .NET (.NET 8.0, 9.0, 10.0, and 11.0) on Windows. The flaw resides in the native symbol reader library, Microsoft.DiaSymReader.Native, and is triggered when parsing Portable Program Database (PDB) metadata containing malformed EmbeddedSource custom debug information records. By supplying a parent Record Identifier (RID) of zero or an out-of-bounds value, an attacker causes an integer underflow during 1-based to 0-based index conversion, leading to a heap-based buffer overflow and arbitrary code execution within the context of the host developer tool or runtime.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 5 hours ago•CVE-2026-114151
8.8

CVE-2026-114151: Remote Code Execution via Stack-Based Buffer Overflow in Microsoft Visual Studio and .NET Symbol Reader

CVE-2026-114151 is a high-severity remote code execution vulnerability affecting Microsoft Visual Studio 2026 and multiple supported versions of the Microsoft .NET runtime on Windows. The flaw resides in the native Debug Information Access (DIA) symbol reader component, Microsoft.DiaSymReader.Native. When parsing Program Database (.pdb) files, the component fails to validate the length of serialized numeric records (specifically LF_DECIMAL structures) before unpacking them into a fixed-size stack buffer. An attacker who convinces a user or automated diagnostic process to load a crafted .pdb file can trigger a stack-based buffer overflow, resulting in arbitrary code execution within the context of the host process.

Alon Barad
Alon Barad
5 views•9 min read