{"record":{"id":"061ccf2874da5b32","repo":"jdx/mise","slug":"vfox-plugin-archive-contains-an-unsafe-path","errorCode":null,"errorMessage":"vfox plugin archive contains an unsafe path","messagePattern":"vfox plugin archive contains an unsafe path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/packslip.rs","lineNumber":226,"sourceCode":"pub(crate) fn validate_archive(path: &Path) -> Result<()> {\n    let reader = flate2::read::GzDecoder::new(std::fs::File::open(path)?);\n    let mut archive = jdx_tar::Archive::new(reader);\n    for entry in archive.entries()? {\n        let entry = entry?;\n        ensure!(\n            matches!(\n                entry.entry_type(),\n                jdx_tar::EntryType::File | jdx_tar::EntryType::Directory\n            ),\n            \"vfox plugin archive contains a link or special file\"\n        );\n        let path = entry.path()?;\n        for component in path.components() {\n            if component == Component::CurDir {\n                continue;\n            }\n            let Component::Normal(name) = component else {\n                bail!(\"vfox plugin archive contains an unsafe path\");\n            };\n            let name = name.to_string_lossy();\n            ensure!(\n                !name.contains(['\\\\', ':'])\n                    && !name.eq_ignore_ascii_case(\".git\")\n                    && !name.eq_ignore_ascii_case(STATE_FILE),\n                \"vfox plugin archive contains a reserved or unsafe path\"\n            );\n        }\n    }\n    Ok(())\n}\n\npub(crate) fn validate_layout(path: &Path) -> Result<()> {\n    ensure!(\n        path.join(\"metadata.lua\").is_file(),\n        \"vfox plugin archive must contain metadata.lua at its root\"\n    );","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/packslip.rs#L208-L244","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Do not install this plugin archive; obtain the plugin from its official repository and download a fresh release.","Report the archive to the plugin maintainer — repack it with relative, forward-slash paths if you are the maintainer.","Verify the archive's integrity (checksum/signature) if the plugin offers one, then retry the install."],"exampleFix":"// before (archive built on Windows with backslash paths)\ntar -czf plugin.tar.gz C:\\build\\vfox-plugin\n// after (relative, normalized paths)\ncd build/vfox-plugin && tar -czf ../plugin.tar.gz .","handlingStrategy":"fallback","validationCode":"tar -tzf plugin.tar.gz | grep -E '(^|/)(\\.\\.|\\.git)(/|$)|\\\\|:' && echo UNSAFE && exit 1 || true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only install vfox plugins from trusted, official sources.","Verify archive checksums/signatures when the plugin publishes them.","Before extraction, list archive contents and reject entries with `..`, absolute paths, or backslashes."],"tags":["archive","security","path-traversal"],"backgroundTag":"path-traversal-blocked","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}