fix(config): ignore local trust controls#10357
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughStrips trust-related fields (ci, paranoid, trusted_config_paths, yes) from non-global settings during parsing via a new helper, integrates it into Settings::parse_settings_file, and adds unit and end-to-end tests validating local configs cannot set those controls. ChangesTrust Controls Enforcement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Greptile SummaryThis PR fixes GHSA-436v-8fw5-4mj8 by marking
Confidence Score: 5/5Safe to merge — the change is minimal, extends an already-proven stripping mechanism, and is covered by both unit and e2e tests that directly exercise the bypass scenario. The fix piggybacks on the existing No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "refactor(config): clarify global-only tr..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e/config/test_local_settings_trust_controls`:
- Around line 22-33: The test currently masks hook-env's exit status by
appending "|| true" so it can wrongly pass when hook-env warns but exits 0;
change the test to capture and assert hook-env's actual exit code instead of
ignoring it: run the command (MISE_YES=0 MISE_PARANOID=1 mise hook-env -s bash
--force) into output, capture its exit status (e.g., via $?), assert that the
exit status is non-zero (fail the test if it is zero), and then continue to
check the marker absence and that output contains "not trusted"; update
references to the hook-env invocation and the marker check accordingly so the
test fails when hook-env exits 0.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f0778bb7-02f0-4440-9792-1812c9a4f092
📒 Files selected for processing (2)
e2e/config/test_local_settings_trust_controlssrc/config/settings.rs
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.4 x -- echo |
21.9 ± 1.4 | 19.6 | 29.4 | 1.00 |
mise x -- echo |
23.6 ± 1.9 | 20.5 | 40.8 | 1.08 ± 0.11 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.4 env |
21.7 ± 1.3 | 19.3 | 27.6 | 1.00 |
mise env |
22.6 ± 1.5 | 19.9 | 29.9 | 1.04 ± 0.10 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.4 hook-env |
23.7 ± 1.6 | 20.3 | 29.4 | 1.00 |
mise hook-env |
24.2 ± 1.7 | 20.5 | 30.4 | 1.02 ± 0.10 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.4 ls |
19.2 ± 1.5 | 15.6 | 23.8 | 1.00 |
mise ls |
19.6 ± 1.4 | 16.7 | 25.7 | 1.02 ± 0.11 |
xtasks/test/perf
| Command | mise-2026.6.4 | mise | Variance |
|---|---|---|---|
| install (cached) | 148ms | 149ms | +0% |
| ls (cached) | 67ms | 69ms | -2% |
| bin-paths (cached) | 73ms | 73ms | +0% |
| task-ls (cached) | 143ms | 143ms | +0% |
2b272c2 to
37e2538
Compare
Fixes GHSA-436v-8fw5-4mj8 by ignoring trust-control settings from non-global config files before trust checks run.
Summary
Tests
Note
High Risk
Security fix for config trust bypass; behavior change for anyone who relied on project-level
trusted_config_paths,paranoid,ci, oryesin local mise.toml files.Overview
Fixes a trust bypass (GHSA-436v-8fw5-4mj8) by treating
ci,paranoid,trusted_config_paths, andyesas global-only settings insettings.toml, so they are stripped when loading project/local config via the existingstrip_local_only_settingspath inparse_settings_file.A malicious local
.mise.tomlcan no longer set e.g.trusted_config_paths = ["/"]orparanoid = falseto auto-trust itself or skip prompts before env sources run. Global config, CLI flags, and environment variables are unchanged.Regression coverage adds unit tests for strip vs preserve behavior and an e2e script that asserts
hook-envrejects an untrusted config (withMISE_PARANOID=1) and does not run_.sourcescripts.Reviewed by Cursor Bugbot for commit 37e2538. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
Tests