{"id":"CVE-2026-62847","aliases":["CVE-2026-62847","GHSA-m6wq-39m7-9xpp"],"related":[],"kind":"vulnerability","state":"published","title":"Metalama: Local code execution via DLL planting in world-writable temporary directories (Linux/macOS)","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nMetalama loaded and executed compile-time assemblies, auxiliary executable tools, and embedded helper assemblies from predictable temporary directories. On Linux and macOS the default cache location was the world-writable system temporary directory (`Path.GetTempPath()`, i.e. `/tmp`), and previously-generated artifacts were trusted based on the presence of a sentinel/`.completed` marker file rather than on any integrity verification.\n\nA local, unprivileged user on a shared machine or CI/build agent can pre-create the deterministic cache directory structure and plant a malicious DLL together with the matching sentinel file. When a higher-privileged user (or build/service account) subsequently runs a build, Metalama finds the sentinel, skips regeneration, and loads and executes the attacker-supplied assembly inside the compiler / IDE / MSBuild process.\n\nAffected load-and-execute paths:\n- the cache of compile-time assemblies that Metalama generates from your aspects;\n- auxiliary executable tools that Metalama extracts to a local directory and then launches;\n- embedded .NET helper assemblies that Metalama extracts to a local directory and loads into the build / IDE process.\n\n## Impact\n\nArbitrary code execution in the security context of the building user — i.e. a local privilege escalation across user accounts on shared POSIX systems (multi-user developer machines, CI/build agents). The attacker obtains code execution as the victim without holding the victim's privileges, and can read source/secrets, tamper with build output (supply-chain injection), or disrupt builds.\n\n## Affected configurations\n\n- **Linux and macOS, default configuration — affected.** The shipped default uses the world-writable system temp directory.\n- **Windows, default configuration — not affected.** The default per-user temporary directory is protected by OS ACLs, so cross-user planting is not possible.\n- The `METALAMA_TEMP` environment variable is a deployer-controlled override and is **out of scope**: pointing it at an insecure (e.g. world-writable or attacker-owned) location is a deployment misconfiguration, not a defect in the product.\n\n## Severity\n\nCVSS v3.1: `AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H` = **8.2 (High)** for the affected POSIX default configuration (Scope:Changed reflects the cross-user privilege escalation).\n\nCVSS v4.0 cross-check: `CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:L/SI:H/SA:H` = 6.0 (Medium), which more granularly attributes low impact to the cache itself and high impact to the subsequent build process. The honest range is therefore Medium-High depending on the scoring model and platform.\n\n## Fix\n\nCaches and extraction directories were relocated from the world-writable system temp directory to per-user application-data locations (`$XDG_CACHE_HOME` / `~/.cache/Metalama` on POSIX), relying on OS-enforced per-user ownership as the trust boundary. Fixed in **2026.1.19**.\n\n## Weaknesses\n\n- CWE-377: Insecure Temporary File\n- CWE-427: Uncontrolled Search Path Element\n\n## Affected packages\n\n- Metalama.Framework < 2026.1.19, \n- Metalama.Tool < 2026.1.19\n\nInternal tracking: metalama/Metalama#1650.","format":"markdown","source":"ghsa"}],"published":"2026-10-14T19:24:53.000Z","modified":"2026-11-02T19:35:33.347Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:L/SI:H/SA:H","rating":"MEDIUM"}],"cwes":["CWE-377","CWE-427"],"affected":[{"ranges":[{"version":"< 2025.1.18","status":"affected"},{"version":">= 2025.2.0-preview, <= 2025.2.5-rc","status":"affected"},{"version":">= 2026.0.0-preview, < 2026.0.25","status":"affected"},{"version":">= 2026.1.0-preview, < 2026.1.19","status":"affected"}],"vendor":"metalama","product":"Metalama","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2026.1.0-preview","status":"affected","fixed":"2026.1.19"}],"ecosystem":"NuGet","package":"Metalama.Framework","purl":"pkg:nuget/Metalama.Framework","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2026.1.0-preview","status":"affected","fixed":"2026.1.19"}],"ecosystem":"NuGet","package":"Metalama.Tool","purl":"pkg:nuget/Metalama.Tool","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2025.1.18"}],"ecosystem":"NuGet","package":"Metalama.Framework","purl":"pkg:nuget/Metalama.Framework","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2025.1.18"}],"ecosystem":"NuGet","package":"Metalama.Tool","purl":"pkg:nuget/Metalama.Tool","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2026.0.0-preview","status":"affected","fixed":"2026.0.25"}],"ecosystem":"NuGet","package":"Metalama.Tool","purl":"pkg:nuget/Metalama.Tool","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2026.0.0-preview","status":"affected","fixed":"2026.0.25"}],"ecosystem":"NuGet","package":"Metalama.Framework","purl":"pkg:nuget/Metalama.Framework","source":"ghsa"}],"references":[{"url":"https://github.com/metalama/Metalama/security/advisories/GHSA-m6wq-39m7-9xpp","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/metalama/Metalama/pull/1650","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/metalama/Metalama/commit/09911349a916e82194b1cfaa6d0a38acad928fc9","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/metalama/Metalama/commit/92c4feecfce86d18fcb007ab6d3a1b4383326a2e","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/metalama/Metalama/releases/tag/release/2025.1.18","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/metalama/Metalama/releases/tag/release/2026.0.25","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/metalama/Metalama/releases/tag/release/2026.1.19","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/metalama/Metalama/pull/1719","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/metalama/Metalama/commit/ab9407263203c66d7c5680a34c28dba31f9951c9","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/metalama/Metalama","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-30T21:21:14.933Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-62847","url":"https://www.cve.org/CVERecord?id=CVE-2026-62847","licence":"CVE Terms of Use","modified":"2026-10-30T22:13:12.107Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m6wq-39m7-9xpp","url":"https://github.com/advisories/GHSA-m6wq-39m7-9xpp","licence":"CC-BY-4.0","modified":"2026-10-14T19:30:07.066Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-62847","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62847","licence":"Public domain","modified":"2026-11-02T19:35:33.347Z"}],"updatedAt":"2026-11-25T22:59:48.027Z","epss":{"score":0.00151,"percentile":0.04489,"date":"2026-12-02T12:00:21.000Z"}}