Metalama code execution via temporary assembly and tool files
Metalama
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Metalama.Framework NuGet |
|
|
| Metalama.Tool NuGet |
Metalama
| Product | Affected | Fixed in |
|---|---|---|
| Metalama.Framework NuGet |
|
|
| Metalama.Tool NuGet |
≥ 2026.1.0-preview · < 2026.1.19< 2025.1.18≥ 2026.0.0-preview · < 2026.0.25
|
Metalama is a Roslyn-based open-source patterns and architecture toolkit for C#. Prior to 2025.1.18, 2026.0.25 and 2026.1.19, Metalama.Framework and Metalama.Tool load and execute compile-time assemblies, auxiliary executable tools and embedded helper assemblies from predictable temporary directories. On `Linux` and `macOS`, the default `Path.GetTempPath()` location is world-writable, and existing artifacts are trusted based on sentinel or `.completed` marker files rather than integrity verification. A local unprivileged user on a shared machine or CI/build agent can pre-create the deterministic directory structure and plant a malicious DLL with the matching sentinel. When a higher-privileged developer or build account subsequently builds, Metalama skips regeneration and executes the planted artifact in the compiler, IDE or MSBuild process as the building user. This permits cross-user privilege escalation, reading source and secrets, supply-chain tampering with build output, or disrupting builds. Default Windows per-user temporary directories are protected by ACLs and are not affected. Deployer-selected insecure cache locations are outside the vulnerability's scope. This issue is fixed in versions 2025.1.18, 2026.0.25 and 2026.1.19.
From the CVE record · GitHub_M
On Linux and macOS, Metalama.Framework and Metalama.Tool can execute planted assemblies from predictable, world-writable temporary directories without verifying their integrity. A local unprivileged user on a shared machine or build agent can plant an artifact that runs as a higher-privileged user when that user later builds; default Windows per-user temporary directories are not affected.
Teams using the NuGet packages Metalama.Framework or Metalama.Tool should check installations older than 2025.1.18, or in the 2026.0 preview series before 2026.0.25 or the 2026.1 preview series before 2026.1.19.