jdx/mise · error

vfox plugin archive contains an unsafe path

Error message

vfox plugin archive contains an unsafe path

What it means

`validate_archive` inspects each entry path of a vfox plugin archive before extraction. Any path component that is not a normal component (e.g. `..`, absolute/root components) — or a component containing backslash/colon, or named `.git`/a state file — causes a bail to prevent zip-slip style path traversal and overwrite attacks.

Solutions

  1. Do not install this plugin archive; obtain the plugin from its official repository and download a fresh release.
  2. Report the archive to the plugin maintainer — repack it with relative, forward-slash paths if you are the maintainer.
  3. Verify the archive's integrity (checksum/signature) if the plugin offers one, then retry the install.

Example fix

// before (archive built on Windows with backslash paths)
tar -czf plugin.tar.gz C:\build\vfox-plugin
// after (relative, normalized paths)
cd build/vfox-plugin && tar -czf ../plugin.tar.gz .
Defensive patterns

Strategy: fallback

Validate before calling

tar -tzf plugin.tar.gz | grep -E '(^|/)(\.\.|\.git)(/|$)|\\|:' && echo UNSAFE && exit 1 || true

Prevention

When it happens

Trigger: Installing a vfox plugin whose release tarball/zip contains entries with `..` or absolute path components, backslashes or colons in names, or `.git`/state-file entries at any level.

Common situations: A malicious or sloppily built plugin archive crafted on Windows (backslash separators); an archive built with absolute paths; a tampered plugin release during a supply-chain incident.

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/061ccf2874da5b32. Report an issue: GitHub.

Appendix: source

Thrown at src/plugins/packslip.rs:226

pub(crate) fn validate_archive(path: &Path) -> Result<()> {
    let reader = flate2::read::GzDecoder::new(std::fs::File::open(path)?);
    let mut archive = jdx_tar::Archive::new(reader);
    for entry in archive.entries()? {
        let entry = entry?;
        ensure!(
            matches!(
                entry.entry_type(),
                jdx_tar::EntryType::File | jdx_tar::EntryType::Directory
            ),
            "vfox plugin archive contains a link or special file"
        );
        let path = entry.path()?;
        for component in path.components() {
            if component == Component::CurDir {
                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"
    );

View on GitHub (pinned to 533346cc37)