{"record":{"id":"31b677caa8aed2f6","repo":"jdx/mise","slug":"vfox-plugin-archive-contains-a-reserved-or-unsafe","errorCode":null,"errorMessage":"vfox plugin archive contains a reserved or unsafe path","messagePattern":"vfox plugin archive contains a reserved or unsafe path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/packslip.rs","lineNumber":241,"sourceCode":"                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    );\n    Ok(())\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn plugin_artifact_contract() {\n        let payload = packslip::sigstore::peek_statement(include_str!(\n            \"../../test/fixtures/packslip-vfox/packslip.sigstore.json\"\n        ))\n        .unwrap();\n        let mut statement: packslip::model::Statement = serde_json::from_slice(&payload).unwrap();\n        let artifact = statement.predicate.artifacts.remove(0);","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/packslip.rs#L223-L259","documentation":"mise additionally rejects vfox plugin archive entries whose normal path components are reserved or unsafe: names containing a backslash or colon, a component named .git (any case), or a component matching mise's internal STATE_FILE name. These could clobber mise's own state or create confusion with VCS metadata, so the archive is refused.","triggerScenarios":"Installing a vfox plugin whose archive contains entries like pkg:meta.lua, dir\\\\file.lua, a .git directory inside the archive, or a file named after mise's state file (state.json-style reserved name).","commonSituations":"Plugins accidentally packaged with their .git directory (e.g. git archive replaced by plain tar of the repo); Windows-built archives retaining backslash/colon characters in member names; a bundled file colliding with mise's reserved state filename.","solutions":["Rebuild the archive excluding .git directories and any file matching mise's reserved state file name","Replace backslashes/colons in member names with safe forward-slash relative paths before packaging","Verify with `tar -tf plugin.tar.gz | grep -Ei '\\\\\\\\|:|\\.git'` that no reserved names remain","Ask the plugin author to republish a cleaned archive"],"exampleFix":"// before\nmyplugin/.git/config   myplugin/a:b.lua\n// after\nmyplugin/lib/ab.lua   (no .git members)","handlingStrategy":"validation","validationCode":"const reserved = names.filter(n => /(^|\\\\/)(\\\\.git)(\\\\/|$)/i.test(n) || n.includes('\\\\\\\\') || n.includes(':'));\nif (reserved.length) throw new Error(`reserved names in archive: ${reserved.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try { await installVfoxPlugin(url); } catch (e) {\n  if (String(e).includes('reserved or unsafe path')) {\n    console.error('Archive contains .git, drive-colon, backslash, or mise state-file names; republish a cleaned archive.');\n    return null;\n  }\n  throw e;\n}","preventionTips":["Exclude .git from packaging (use `git archive` or .gitattributes export-ignore)","Strip ':' and '\\\\' from filenames before tarring","Never name plugin files after mise's internal state file"],"tags":["archive","vfox","security","reserved-path"],"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"}