Skip to content

fix(mise): fail package-backend lookups the project could redirect - #176

Merged
sweepies merged 3 commits into
mainfrom
feat/mise-origins
Nov 4, 2026
Merged

sweepies merged 3 commits into
mainfrom
feat/mise-origins

Conversation

@sweepies

@sweepies sweepies commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Last per-ecosystem fix from the registry audit, after Bundler (#168), Composer (#170), NuGet (#171), Maven/Gradle (#173), Cargo (#174) and Go (#175).

The gap

The Count lists a mise tool's versions with mise ls-remote in a sandbox, with no project configuration (MISE_NO_CONFIG, MISE_NO_ENV). mise installs the tool with the project's configuration, though. For a tool whose backend installs from a package registry, that configuration can point the backend somewhere else. Then the Count lists the public package of that name while mise installs another one.

The rule

A tool whose backend is npm, pypi/pipx, cargo, gem or dotnet fails its lookup when committed settings could redirect that backend. The backend can be written explicitly or come from mise's registry: aws-cdk is npm:aws-cdk, taken from the registry snapshot the mise crate already carries. The settings that count:

  • mise configuration in the tool's folder, above it, or below it:
    • registry variables in [env]: NPM_CONFIG_*/YARN_*, PIP_*/UV_*/PIPX_*, CARGO_*, GEM_*/BUNDLE_*, NUGET_*/DOTNET_*;
    • any MISE_* variable, or files loaded through _ directives;
    • backend [settings], or url_replacements, env_file and env_files.
  • A mise configuration the Count can't read.
  • The project's own settings that the backend reads when mise runs it there:
    • .npmrc or .yarnrc.yml naming a registry;
    • uv.toml, pip.conf/pip.ini, or a pyproject.toml with index settings;
    • Cargo source replacement (cargo::replaced);
    • NuGet feeds other than nuget.org's (nuget::Feeds::origin).

These settings files are read whenever mise is enabled, even if the matching manager is off.

Core tools and the GitHub and aqua backends fail only on MISE_* variables, settings for their own backend, or url_replacements.

Policy: visible evidence

The rule became allowlists after review. Every mise configuration name is read, including mise.local.toml, .config/mise/, conf.d and .miserc. Any top-level table or setting outside a short plain list fails every tool. Options beyond version and os on a tool's entry fail it.

[env] stays a list of known patterns, because environment variables feed whatever mise runs and no list can be complete. That's the same visible-evidence policy as Maven/Gradle in #173. Matching variables include:

  • registry variables;
  • GO*, COREPACK_*, MISE_*;
  • homes, paths, mirrors, proxies, *_CONFIG and *RC.

Follow-ups

  • Over-failing that fails closed:
    • a _.file .env fails every package backend;
    • unknown settings fail every tool;
    • any registry text in an .npmrc counts, whatever scope it names;
    • harmless variables that match the patterns, such as CARGO_TERM_COLOR or UV_LINK_MODE, fail their backends.
  • Global mise configuration and environment on the machine that runs mise aren't seen.
  • A committed mise.lock naming artifact URLs isn't read.

The Count lists mise tool versions in a sandbox without the project's
configuration, but mise installs a tool with it. A tool whose backend
installs from a package registry (npm, pypi/pipx, cargo, gem, dotnet,
written explicitly or through mise's registry) now fails its lookup where
committed settings could send it elsewhere: a mise configuration in its
folder, above or below with registry variables in [env], any MISE_*
variable, files loaded through _, backend [settings] or
url_replacements; a mise configuration the Count cannot read; or the
project's own .npmrc or .yarnrc.yml naming a registry, Python index
settings, Cargo source replacement or NuGet feeds other than nuget.org's.
Those settings files are read whenever mise is enabled.

Which backends a short name uses comes from the registry snapshot the
mise crate already carries.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula 8c8278e Commit Preview URL

Branch Preview URL
Nov 04 2026, 04:38 AM

Review found redirects the denylist missed: configuration under other
names mise reads (mise.local.toml, .config/mise/, conf.d, .miserc), tool
aliases, settings like [settings.pipx], options on a tool's own entry,
settings files below the tool, unreadable .npmrc placeholders, Cargo's
registry.default and task files' including configuration.

Now every mise configuration name is read; a configuration with any
top-level table but the plain ones, any setting but a few plain ones, a
MISE_* variable, or a .miserc fails every tool it governs; options beyond
version and os on a tool's own entry fail that tool; [env] registry
variables and file-loading directives fail package backends; and the
project's own registry settings count above and below the tool, an
unreadable one included. _.path and _.python are fine.
- [env] variables that move where tools read configuration or download
  from (HOME, PATH, XDG homes, mirrors, dist servers, proxies, *_CONFIG,
  *RC) fail every tool; GO* variables fail go: tools; COREPACK_* npm.
- A backend's own [settings] table fails its tools only, and a core
  tool's (such as [settings.python]) that tool only.
- Options beyond version and os on a tool's entry count in every related
  configuration, in task files and in array form.
- mise configurations, .npmrc, .yarnrc.yml and pip files become
  unreadable placeholders when a working tree holds them as symlinks or
  non-text, so they fail closed there too.
@sweepies
sweepies merged commit 1a225f0 into main Nov 4, 2026
11 checks passed
@sweepies
sweepies deleted the feat/mise-origins branch November 4, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant