{"record":{"id":"c8a47f28a0f967cd","repo":"denoland/deno","slug":"refusing-to-extract-tar-entry-outside-dest","errorCode":null,"errorMessage":"Refusing to extract tar entry outside dest: {}","messagePattern":"Refusing to extract tar entry outside dest: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/installer/npm_compat.rs","lineNumber":1030,"sourceCode":"    let entry_type = entry.header().entry_type();\n    if entry_type.is_symlink() || entry_type.is_hard_link() {\n      continue;\n    }\n    let path = entry.path()?.into_owned();\n    // Skip the leading \"package/\" (or whatever the single root dir is named).\n    let stripped: PathBuf = path.components().skip(1).collect();\n    if stripped.as_os_str().is_empty() {\n      continue;\n    }\n    if stripped.is_absolute()\n      || stripped.components().any(|c| {\n        matches!(\n          c,\n          std::path::Component::ParentDir | std::path::Component::RootDir\n        )\n      })\n    {\n      return Err(anyhow!(\n        \"Refusing to extract tar entry outside dest: {}\",\n        path.display()\n      ));\n    }\n    let out_path = dest.join(stripped);\n    // tar entries aren't guaranteed to list a directory before the files under\n    // it, and `Entry::unpack` won't create missing parents — so ensure the\n    // parent exists first (otherwise nested files like `_dist/mod.d.ts` fail).\n    if let Some(parent) = out_path.parent() {\n      std::fs::create_dir_all(parent)?;\n    }\n    entry.unpack(&out_path)?;\n  }\n  Ok(())\n}\n\n/// A resolved entry for the tsconfig `paths` table: maps a user-facing URL\n/// (whatever appears in source as `import \"...\"`) to the local mirror file","sourceCodeStart":1012,"sourceCodeEnd":1048,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/installer/npm_compat.rs#L1012-L1048","documentation":"Error \"Refusing to extract tar entry outside dest: {}\" thrown in denoland/deno.","triggerScenarios":"Thrown at cli/tools/installer/npm_compat.rs:1030 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}