astrid-runtime/astrid · error

Malicious archive detected: symlinks are not allowed

Error message

Malicious archive detected: symlinks are not allowed ('{}')

What it means

Fired by unpack_and_install_internal when a tar entry is a symlink or hard link. Link entries could redirect installed files outside the unpack directory, so capsule archives must contain only regular files and directories.

Solutions

  1. Reject this archive; links are not permitted in capsule packages
  2. Repack the archive with links resolved to real files
  3. Report the malicious archive to the publisher
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-capsule-install/src/archive.rs:377 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/502c1afa830c9d3f. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-capsule-install/src/archive.rs:377

        if entry_path.is_absolute()
            || entry_path
                .components()
                .any(|c| matches!(c, std::path::Component::ParentDir))
        {
            bail!(
                "Malicious archive detected: invalid path '{}'",
                entry_path.display()
            );
        }

        let out_path = unpack_dir.join(&entry_path);
        if let Some(parent) = out_path.parent() {
            std::fs::create_dir_all(parent)?;
        }

        if entry.header().entry_type().is_symlink() || entry.header().entry_type().is_hard_link() {
            bail!(
                "Malicious archive detected: symlinks are not allowed ('{}')",
                entry_path.display()
            );
        }

        entry
            .unpack(&out_path)
            .with_context(|| format!("Failed to unpack file: {}", out_path.display()))?;
    }

    match installed_authority {
        Some(authority) => install_from_local_path_internal(
            unpack_dir,
            home,
            options,
            target_principal,
            workspace,
            expected,

View on GitHub (pinned to affd8760f4)