jdx/mise · error

vfox plugin archive contains a link or special file

Error message

vfox plugin archive contains a link or special file

What it means

When validating a vfox plugin archive, mise rejects any tar entry that is not a regular File or Directory — symlinks, hardlinks, and special files (devices, fifos) are refused. This prevents archives from shipping links that could otherwise be resolved to paths outside the install directory while a later entry is being unpacked (a classic tar-link escape).

Solutions

  1. Rebuild the plugin archive dereferencing links into real files (e.g. `tar --dereference -czf plugin.tar.gz ...` or `tar -h`)
  2. Remove symlinks/special files from the plugin directory before packaging
  3. Only install plugins from trusted sources — the archive is malformed or hostile, so do not attempt to bypass the check
  4. Ask the plugin author to republish a link-free archive

Example fix

// before
ln -s /etc/passwd extra.lua && tar czf plugin.tar.gz myplugin/
// after
cp real-extra.lua myplugin/extra.lua && tar czf plugin.tar.gz myplugin/
Defensive patterns

Strategy: validation

Validate before calling

const types = await tarList(archivePath);
const bad = types.filter(e => e.type !== 'file' && e.type !== 'directory');
if (bad.length) throw new Error(`archive contains links/special files: ${bad.map(e=>e.path).join(', ')}`);

Try / catch

try { await installVfoxPlugin(url); } catch (e) {
  if (String(e).includes('link or special file')) {
    console.error('Plugin archive contains symlinks/special files; rebuild with tar -h or use a trusted source.');
    return null;
  }
  throw e;
}

Prevention

When it happens

Trigger: Installing a vfox plugin whose tar.gz contains symlink or hardlink entries (e.g. lib/current -> ../../.., or a link to /etc), or device/fifo special entries.

Common situations: Plugin archives packaged on Unix with developer symlinks left inside (node_modules-style links); archives built with tar flags preserving links; a deliberately malicious plugin using link-then-write to escape the install directory.

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

Appendix: source

Thrown at src/plugins/packslip.rs:213

    ensure!(
        artifact.requires.is_none(),
        "vfox plugin artifacts must not declare host requirements"
    );
    ensure!(
        matches!(artifact.format.as_deref(), Some("tar.gz" | "tgz")),
        "vfox plugin artifacts currently require tar.gz format"
    );
    Ok(())
}

/// Reject links and special files before extraction, including links whose
/// targets might otherwise be resolved while unpacking a later archive entry.
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")

View on GitHub (pinned to 533346cc37)