Summary
A command injection issue in mise allows arbitrary command execution when .tool-versions files are parsed through the Tera template engine with exec() enabled.
If an attacker can introduce a malicious .tool-versions file into a project or repository, commands may run automatically as soon as a developer with mise active changes into that directory, without any trust prompt.
Affected context
This vulnerability affects environments where mise is used to manage developer tools and automatically parses .tool-versions files on directory change.
Risk is elevated when developers routinely clone or pull code from shared or untrusted repositories, since .tool-versions files are not subject to the same trust verification as .mise.toml in non-paranoid mode.
The issue surfaces during normal workflow actions such as git clone followed by cd, where template evaluation can trigger embedded exec() calls.
Exploit preconditions
- Attack surface: Developer workstations or CI agents running mise with automatic activation.
- Required access: Ability to create or modify a .tool-versions file in a repository or directory the victim will enter (e.g., push to shared git repo).
- Trigger point: User runs
cd(or equivalent tooling) into a directory containing the malicious .tool-versions file, causing mise to parse it via Tera. - Why exploitation is possible: The Tera template engine is configured with the exec() function registered, and .tool-versions files are processed without trust verification, allowing untrusted template code to execute commands.
Why this happens
The underlying bug is an unsafe template evaluation pattern where configuration files are treated as executable templates with access to an exec() primitive.
By parsing .tool-versions through Tera with exec() registered and without applying a trust model, mise effectively allows untrusted configuration data to drive command execution.
This maps to CWE-94: Improper Control of Generation of Code, since attacker-controlled template content is executed as code/commands during configuration processing rather than being strictly interpreted as data.
Potential impact
- Attacker-supplied commands can execute on developer machines when they enter affected directories.
- Compromise of local development environments, including credential theft or environment variable exfiltration.
- Installation of malware, backdoors, or persistence mechanisms on developer or CI systems.
- Manipulation of build outputs or introduction of supply-chain attacks via tampered tooling.
- Lateral movement from compromised developer workstations into other infrastructure.
General mitigation guidance
Mitigation centers on eliminating command-capable primitives from untrusted configuration parsing and enforcing strict trust boundaries for templates.
Recommended patterns include:
- Treating configuration files (.tool-versions) as data only, avoiding templating engines that support command execution.
- Disabling or strictly scoping any exec-like function in template rendering paths, especially for files sourced from repositories.
- Applying explicit trust verification for all configuration sources, not just select file types, and defaulting to paranoid/deny-by-default modes.
- Running mise-related processes with least privilege to limit blast radius if a configuration is abused.
- Documenting configuration trust rules so developers understand which files can trigger execution and under what conditions.
How teams detect issues like this
Detection efforts can focus on both code and workflow:
- Use static analysis or code search to identify template usage that registers exec() or similar command execution functions on configuration paths.
- Add code review checks to flag any configuration parsing that treats repository files as executable templates rather than passive data.
- Implement policy-based controls that prohibit command-capable templating in configuration loaders or require explicit trust gating.
- Employ host-based monitoring on developer and CI machines to alert on unexpected command execution originating from mise or related processes when directories are entered.
- Integrate automated security review tools into CI to scan mise-related code and configuration handling for command injection patterns.

