jdx/mise · error

vfox plugin archive contains a reserved or unsafe path

Error message

vfox plugin archive contains a reserved or unsafe path

What it means

mise additionally rejects vfox plugin archive entries whose normal path components are reserved or unsafe: names containing a backslash or colon, a component named .git (any case), or a component matching mise's internal STATE_FILE name. These could clobber mise's own state or create confusion with VCS metadata, so the archive is refused.

Solutions

  1. Rebuild the archive excluding .git directories and any file matching mise's reserved state file name
  2. Replace backslashes/colons in member names with safe forward-slash relative paths before packaging
  3. Verify with `tar -tf plugin.tar.gz | grep -Ei '\\\\|:|\.git'` that no reserved names remain
  4. Ask the plugin author to republish a cleaned archive

Example fix

// before
myplugin/.git/config   myplugin/a:b.lua
// after
myplugin/lib/ab.lua   (no .git members)
Defensive patterns

Strategy: validation

Validate before calling

const reserved = names.filter(n => /(^|\\/)(\\.git)(\\/|$)/i.test(n) || n.includes('\\\\') || n.includes(':'));
if (reserved.length) throw new Error(`reserved names in archive: ${reserved.join(', ')}`);

Try / catch

try { await installVfoxPlugin(url); } catch (e) {
  if (String(e).includes('reserved or unsafe path')) {
    console.error('Archive contains .git, drive-colon, backslash, or mise state-file names; republish a cleaned archive.');
    return null;
  }
  throw e;
}

Prevention

When it happens

Trigger: Installing a vfox plugin whose archive contains entries like pkg:meta.lua, dir\\file.lua, a .git directory inside the archive, or a file named after mise's state file (state.json-style reserved name).

Common situations: Plugins accidentally packaged with their .git directory (e.g. git archive replaced by plain tar of the repo); Windows-built archives retaining backslash/colon characters in member names; a bundled file colliding with mise's reserved state filename.

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/31b677caa8aed2f6. Report an issue: GitHub.

Appendix: source

Thrown at src/plugins/packslip.rs:241

                continue;
            }
            let Component::Normal(name) = component else {
                bail!("vfox plugin archive contains an unsafe path");
            };
            let name = name.to_string_lossy();
            ensure!(
                !name.contains(['\\', ':'])
                    && !name.eq_ignore_ascii_case(".git")
                    && !name.eq_ignore_ascii_case(STATE_FILE),
                "vfox plugin archive contains a reserved or unsafe path"
            );
        }
    }
    Ok(())
}

pub(crate) fn validate_layout(path: &Path) -> Result<()> {
    ensure!(
        path.join("metadata.lua").is_file(),
        "vfox plugin archive must contain metadata.lua at its root"
    );
    Ok(())
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn plugin_artifact_contract() {
        let payload = packslip::sigstore::peek_statement(include_str!(
            "../../test/fixtures/packslip-vfox/packslip.sigstore.json"
        ))
        .unwrap();
        let mut statement: packslip::model::Statement = serde_json::from_slice(&payload).unwrap();
        let artifact = statement.predicate.artifacts.remove(0);

View on GitHub (pinned to 533346cc37)