{"record":{"id":"8809ad4449ed491f","repo":"jdx/mise","slug":"remote-task-path-escapes-its-git-checkout","errorCode":null,"errorMessage":"remote task path escapes its Git checkout: {}","messagePattern":"remote task path escapes its Git checkout: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_file_providers/remote_task_git.rs","lineNumber":81,"sourceCode":"            url_without_path: url_without_path.to_string(),\n            path: path.to_string(),\n            branch,\n        }\n    }\n}\n\n/// Ensure a remote task path resolves inside its Git checkout and points at a\n/// regular file or directory.\npub(crate) fn validate_remote_git_path(\n    checkout_root: &Path,\n    path: &Path,\n) -> Result<std::fs::Metadata> {\n    let metadata = path.symlink_metadata()?;\n    if !path\n        .canonicalize()?\n        .starts_with(checkout_root.canonicalize()?)\n    {\n        eyre::bail!(\n            \"remote task path escapes its Git checkout: {}\",\n            display_path(path)\n        );\n    }\n    if metadata.file_type().is_file() || metadata.file_type().is_dir() {\n        return Ok(metadata);\n    }\n    eyre::bail!(\n        \"remote task path is not a regular file or directory: {}\",\n        display_path(path)\n    )\n}\n\nimpl RemoteTaskGit {\n    /// Make fetched task files executable while leaving task include directories intact.\n    fn prepare_remote_path(checkout_root: &Path, path: &Path) -> Result<()> {\n        if validate_remote_git_path(checkout_root, path)?\n            .file_type()","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_file_providers/remote_task_git.rs#L63-L99","documentation":"validate_remote_git_path canonicalized a remote task file path and it no longer starts inside the checkout root — a symlink or ../ traversal points outside the Git checkout. mise refuses to read/execute files outside what the repo pins.","triggerScenarios":"Thrown at src/task/task_file_providers/remote_task_git.rs:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the path/symlink so it stays inside the remote task repository","Use a regular file path relative to the checkout root","Audit the repo for symlinks that escape the checkout"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}