jdx/mise · error

the packslip names an artifact

Error message

the packslip names an artifact {:?}, which is not a plain file name

What it means

mise derives the local download path by joining the tool's download directory with the artifact's name. If the artifact name is not a plain file name (contains path separators, `..`, absolute path components, etc.), it could escape the download directory, so mise rejects it as a potential path traversal rather than using it.

Solutions

  1. Report the manifest to the maintainer to rename artifacts to plain file names
  2. Use a version whose packslip uses simple file names
  3. If you control the manifest, set name to the bare file name and keep any directory structure out of it
  4. If you cannot trust the manifest, stop using that source/backend for the tool

Example fix

// before
[[artifacts]]
name = "dist/foo-linux-amd64.tar.gz"
// after
[[artifacts]]
name = "foo-linux-amd64.tar.gz"
Defensive patterns

Strategy: validation

Validate before calling

# Only trust manifests whose artifact names are plain file names
jq -e '.artifacts | all(.name | test("^[A-Za-z0-9._@+-]+$"))' packslip.json

Type guard

const isPlainFileName = (n: string) => /^[^/\\]+$/.test(n) && !n.startsWith('.');

Prevention

When it happens

Trigger: install_payload calls file::is_plain_file_name(&artifact.name) and it returns false — the packslip declares an artifact name like `sub/dir/foo.tar.gz`, `../foo`, or an absolute path.

Common situations: A maliciously crafted or buggy manifest embeds directory components in artifact names; a maintainer names assets with prefixes like `dist/foo.tar.gz`; automated manifest generation copies a URL path into the name field.

Understand the failure class

Background: Path traversal blocked: "path escapes the workspace" and "outside site root" errors when a path will not stay inside its allowed directory — this error's family across 26 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/c9138b6bc635b472. Report an issue: GitHub.

Appendix: source

Thrown at src/backend/packslip.rs:1379

        let mut commands = BTreeMap::new();
        if let Some(req) = &artifact.requires {
            for bin in &req.bin {
                // Spawnable, not merely present: the probe below runs the
                // path with `--version`, so a shebang-only script or a `.ps1`
                // would be chosen and then fail to start.
                if let Some(path) = ctx.ts.which_bin_spawnable(&ctx.config, &bin.name).await {
                    commands.insert(bin.name.clone(), path);
                }
            }
        }
        crate::packslip_requirements::check(&artifact, &commands)
            .await
            .enforce(raw_opts.get("ignore_requirements") == Some("true"))?;
        let Some(url) = artifact.url.clone() else {
            bail!("the packslip gives no download URL for {}", artifact.name);
        };
        if !file::is_plain_file_name(&artifact.name) {
            bail!(
                "the packslip names an artifact {:?}, which is not a plain file name",
                artifact.name
            );
        }
        let file_path = tv.download_path().join(&artifact.name);
        ctx.pr.next_operation();
        ctx.pr.set_message(format!("download {}", artifact.name));
        crate::packslip::download_file(&url, &file_path, Some(ctx.pr.as_ref())).await?;

        // The signed digest and size first, then what the lockfile remembers:
        // a lock entry written from an earlier packslip keeps its checksum and
        // is compared, so a newly signed manifest cannot quietly replace what
        // the project committed to. A fresh entry records the signed sha256.
        ctx.pr.next_operation();
        ctx.pr.set_message(format!("verify {}", artifact.name));
        verify_bundle(&bundle, &pin, require_log, &[&file_path])
            .wrap_err_with(|| format!("verifying {} against its packslip", artifact.name))?;
        {

View on GitHub (pinned to 533346cc37)