{"record":{"id":"a8869076bc039d52","repo":"astrid-runtime/astrid","slug":"malicious-archive-detected-invalid-path","errorCode":null,"errorMessage":"Malicious archive detected: invalid path '{}'","messagePattern":"Malicious archive detected: invalid path '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/archive.rs","lineNumber":365,"sourceCode":"    let tar_gz = std::fs::File::open(archive_path)\n        .with_context(|| format!(\"Failed to open archive: {}\", archive_path.display()))?;\n\n    let tar = flate2::read::GzDecoder::new(tar_gz);\n    let mut archive = tar::Archive::new(tar);\n\n    for entry in archive\n        .entries()\n        .context(\"Failed to read archive entries\")?\n    {\n        let mut entry = entry.context(\"Failed to read archive entry\")?;\n        let entry_path = entry.path().context(\"Invalid path in archive\")?;\n\n        if entry_path.is_absolute()\n            || entry_path\n                .components()\n                .any(|c| matches!(c, std::path::Component::ParentDir))\n        {\n            bail!(\n                \"Malicious archive detected: invalid path '{}'\",\n                entry_path.display()\n            );\n        }\n\n        let out_path = unpack_dir.join(&entry_path);\n        if let Some(parent) = out_path.parent() {\n            std::fs::create_dir_all(parent)?;\n        }\n\n        if entry.header().entry_type().is_symlink() || entry.header().entry_type().is_hard_link() {\n            bail!(\n                \"Malicious archive detected: symlinks are not allowed ('{}')\",\n                entry_path.display()\n            );\n        }\n\n        entry","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/archive.rs#L347-L383","documentation":"Security guard in unpack_and_install_internal while iterating tar entries: an entry path is absolute or otherwise escapes the extraction root (e.g. contains `..` components). This is the classic Zip-Slip/path-traversal attack vector in malicious archives, so installation is refused outright rather than sanitized. All four unpack_and_install entrypoints funnel through this check.","triggerScenarios":"Thrown at crates/astrid-capsule-install/src/archive.rs:365 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not install this archive; it is hostile or corrupted","Obtain the capsule from a trusted source","Rebuild/repack the archive with strictly relative paths"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}