feat(dotnet): support runtime-only installs#8524
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant enhancement to the .NET plugin, allowing users to install only the .NET runtime components without the full SDK. This is particularly useful for environments where only application execution is required, reducing overhead. Alongside this, a general improvement to CLI argument parsing was implemented, enabling more flexible inline option specification for any tool. These changes provide greater control and efficiency for managing .NET installations. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for runtime-only installations for .NET, a beneficial feature for users who only need to run applications without the full SDK. However, a significant Path Traversal vulnerability has been identified: the dotnet plugin uses user-controlled tool version strings to construct file paths for installation and uninstallation without sanitization, which could lead to arbitrary file or directory deletion. Strict validation or sanitization of version strings is highly recommended before filesystem operations. Additionally, consider refactoring the handling of runtime options in src/plugins/core/dotnet.rs to centralize validation and mapping logic for improved maintainability.
| let runtime_dir = dotnet_root() | ||
| .join("shared") | ||
| .join(runtime_name) | ||
| .join(&tv.version); |
There was a problem hiding this comment.
The dotnet plugin uses the tool version string directly to construct file paths for installation and uninstallation without proper sanitization. Since the version string can be provided by a user via CLI arguments or a .mise.toml file, an attacker can provide a malicious version string containing path traversal characters (e.g., ..) to cause mise to create or delete arbitrary files or directories on the system.
For example, during uninstallation, if tv.version is .., the constructed runtime_dir or sdk_dir could resolve to the parent directory (e.g., the entire .dotnet-root directory), leading to unintended mass deletion of files when file::remove_all is called. Combined with more traversal components, this could target sensitive system files.
To remediate this, ensure the version string is sanitized to remove or reject path traversal characters before using it in path construction, or validate it against an expected version format.
There was a problem hiding this comment.
This mirrors the existing SDK uninstall pattern that was already here before this PR. The version string comes from Microsoft's API or from the user's own config — same trust level as running any shell command. Proper version sanitization should be a separate effort at a higher level in mise, not patched into individual backends.
This comment was generated by Claude Code.
| } | ||
| } else { | ||
| // SDK: only remove this SDK version from the shared root | ||
| let sdk_dir = dotnet_root().join("sdk").join(&tv.version); |
There was a problem hiding this comment.
Pre-existing code, not introduced by this PR. Agreed that centralized version sanitization would be a good follow-up.
This comment was generated by Claude Code.
Greptile SummaryThis PR adds support for installing .NET runtimes (instead of, or alongside, the full SDK) via an inline Key changes:
Issue found:
Confidence Score: 3/5Safe to merge for the common single-install use-case; the The core feature (install, validate, uninstall, test coverage) is well-implemented and the previous review iterations addressed the main false-positive and cleanup concerns. One correctness gap remains: src/cli/uninstall.rs — the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["mise install / mise x\ndotnet[runtime=X]@version"] --> B{runtime option\npresent?}
B -- No --> C[Install .NET SDK\ndotnet-install.sh --version V]
B -- Yes --> D{runtime_framework_name\nvalid?}
D -- No --> E[Error: Invalid runtime option]
D -- Yes --> F[Install .NET Runtime\ndotnet-install.sh --version V --runtime X]
C --> G[Post-install:\ndotnet --version check]
F --> H[Skip version check\nreturn Ok]
G --> I{isolated mode?}
H --> I
I -- Yes --> J[install_path = installs/dotnet/version]
I -- No --> K[install_path symlink → DOTNET_ROOT]
L["mise uninstall\ndotnet[runtime=X]@version"] --> M[uninstall.rs:\npush TVR first then filesystem matches]
M --> N[unique_by ba.short + version\nTVR wins over filesystem match]
N --> O{uninstall_version_impl\nruntime option?}
O -- Yes --> P[Remove\nDOTNET_ROOT/shared/Framework/version]
O -- No --> Q[Remove\nDOTNET_ROOT/sdk/version]
|
7864a20 to
03964d6
Compare
a03e1b9 to
294a312
Compare
294a312 to
6346371
Compare
6346371 to
c9160d7
Compare
25bc8d9 to
ab59004
Compare
0ccc774 to
949c748
Compare
9051138 to
bb96366
Compare
bb96366 to
d709da7
Compare
|
The closing - Runtime-only installs do **not** include the SDK build tools...
- :::
+- Runtime-only installs do **not** include the SDK build tools...
+:::This comment was generated by Claude Code. |
c39a6f1 to
dd2305a
Compare
|
The closing Perhaps bullet-points inside admonition containers prevent the opening and closing |
5c64a5f to
0c90c2b
Compare
Regarding Greptile's Raises a valid point, however, it's a pre-existing issue, not introduced by this PR. Also the likelihood of this collision is very low, especially for dotnet. Would it be preferable to include this fix here or as a separate (follow-up) PR? |
4a5d925 to
c8ba0b7
Compare
### 🚀 Features - **(ci)** auto-convert external PRs to draft mode by @jdx in [#8896](#8896) - **(deps)** add `depends` field for user-specified tool dependencies by @cprecioso in [#8776](#8776) - **(dotnet)** support runtime-only installs by @fragon10 in [#8524](#8524) - **(npm)** apply install_before to transitive dependencies by @risu729 in [#8851](#8851) - **(task)** allow passing arguments to task dependencies via {{usage.*}} templates by @jdx in [#8893](#8893) - add options field to BackendListVersionsCtx by @esteve in [#8875](#8875) ### 🐛 Bug Fixes - **(backend)** filter PEP 440 .dev versions in fuzzy version matching by @richardthe3rd in [#8849](#8849) - **(ci)** update COPR BuildRequires rust version to match MSRV 1.88 by @jdx in [#8911](#8911) - **(ci)** add Ruby build dependencies to e2e Docker image by @jdx in [#8910](#8910) - **(ci)** add missing build dependencies to e2e Docker image by @jdx in [#8912](#8912) - **(ci)** add missing build dependencies to e2e Docker image by @jdx in [#8914](#8914) - **(ci)** use Node 24 LTS for corepack e2e test by @jdx in [#8915](#8915) - **(ci)** add libxml2 and pkg-config to e2e Docker image by @jdx in [#8917](#8917) - **(ci)** add libxml2-dev to e2e image and disable Swift SPM tests by @jdx in [#8918](#8918) - **(docs)** use sans-serif font for badges by @jdx in [#8887](#8887) - **(env)** parse --env=VALUE and -E=VALUE flag forms correctly by @jdx in [#8889](#8889) - **(exec)** use i64::from() for seccomp syscall numbers to survive autofix by @jdx in [#8882](#8882) - **(github)** preserve tool options like filter_bins when version specified via CLI by @jdx in [#8888](#8888) - **(github)** use alias-specific options when tool_alias has its own config by @jdx in [#8892](#8892) - **(install)** add locked_verify_provenance setting and detect github attestations at lock time by @jdx in [#8901](#8901) - **(lock)** prune stale version entries during filtered `mise lock <tool>` runs by @altendky in [#8599](#8599) - **(python)** use lockfile URL for precompiled installs by @hehaoqian in [#8750](#8750) - **(release)** verify all build targets succeed before releasing by @jdx in [#8886](#8886) - **(ruby)** support build revisions for precompiled binaries in mise.lock by @jdx in [#8900](#8900) - **(swift)** fall back to Ubuntu 24.04 for unsupported Ubuntu versions by @jdx in [#8916](#8916) - **(zsh)** avoid duplicate trust warning after cd by @timothysparg in [#8898](#8898) - update flake.lock and add fix for rust-bindgen to default.nix by @esteve in [#8874](#8874) - when direnv diff is empty, do not try to parse it by @yaleman in [#8857](#8857) - skip trust check for plain .tool-versions in task list by @dportalesr in [#8876](#8876) ### 🚜 Refactor - **(go)** rename go_* settings to go.* namespace by @jdbruijn in [#8598](#8598) ### 📚 Documentation - **(tasks)** clarify task_config.includes behavior by @risu729 in [#8905](#8905) ### 🧪 Testing - **(ci)** run e2e tests inside Docker containers by @jdx in [#8899](#8899) ### 📦️ Dependency Updates - bump ubi from 0.8 to 0.9 by @jdx in [#8906](#8906) - bump zip from 3 to 8 by @jdx in [#8908](#8908) - update lockfile deps (hold back rattler) by @jdx in [#8909](#8909) - update bun.lock by @jdx in [#8913](#8913) ### 📦 Registry - add turso ([github:tursodatabase/turso-cli](https://github.com/tursodatabase/turso-cli)) by @kenn in [#8884](#8884) - remove carp test by @jdx in [#8894](#8894) ### Chore - **(ci)** add workflow to warn PRs modifying vendored aqua-registry by @jdx in [#8897](#8897) - **(ci)** use github.token for draft conversion in auto-draft workflow by @jdx in [#8903](#8903) - remove deprecated settings older than 12 months by @jdx in [#8904](#8904) ### New Contributors - @dportalesr made their first contribution in [#8876](#8876) - @timothysparg made their first contribution in [#8898](#8898) - @hehaoqian made their first contribution in [#8750](#8750) - @jdbruijn made their first contribution in [#8598](#8598) - @cprecioso made their first contribution in [#8776](#8776) - @yaleman made their first contribution in [#8857](#8857) - @kenn made their first contribution in [#8884](#8884) - @fragon10 made their first contribution in [#8524](#8524) ## 📦 Aqua Registry Updates #### New Packages (6) - [`ahkohd/oyo`](https://github.com/ahkohd/oyo) - [`bellicose100xp/jiq`](https://github.com/bellicose100xp/jiq) - [`kurama/dealve-tui`](https://github.com/kurama/dealve-tui) - [`micahkepe/jsongrep`](https://github.com/micahkepe/jsongrep) - [`textfuel/lazyjira`](https://github.com/textfuel/lazyjira) - [`ubugeeei/vize`](https://github.com/ubugeeei/vize) #### Updated Packages (1) - [`sigstore/cosign`](https://github.com/sigstore/cosign)
Referencing discussion #8494
Summary
Adds support for installing .NET runtimes alongside or instead of SDKs, via an inline tool option (
runtime). Uses the existing backend-name side bracket syntax options.Usage
mise use dotnet[runtime=dotnet]@8.0.14 dotnet --list-runtimesValid runtime values:
dotnet,aspnetcore,windowsdesktopChanges
src/plugins/core/dotnet.rs:runtimeoption value against known framework names.--runtime/-Runtimeto the install script when the option is set.dotnet --versionpost-install check for runtime installs.shared/<framework>/<version>instead ofsdk/<version>).src/cli/uninstall.rs:get_requested_tool_versions()sotvr.resolve()(which carries tool options) is pushed before filesystem matches. Theunique_bydedup keeps the first entry, so the options-bearingToolVersionnow wins instead of being silently dropped.e2e/core/test_dotnet: Add tests for runtime-only install and invalid runtime option validation.docs/lang/dotnet.md: Document the runtime-only install feature, valid values, and usage notes.