{"record":{"id":"0d05fb680914a1ad","repo":"paperclipai/paperclip","slug":"kubernetes-sync-label-path-is-not-a-confined-ab","errorCode":null,"errorMessage":"Kubernetes sync ${label} path is not a confined absolute path: ${candidate}","messagePattern":"Kubernetes sync (.+?) path is not a confined absolute path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts","lineNumber":133,"sourceCode":"\n/**\n * Host-side complete-mediation guard applied as defense-in-depth below the\n * orchestrator's own confinement. Every sandbox-side path (the sync target for\n * inbound, the sync source for outbound) MUST be an absolute path that\n * canonicalizes lexically inside the workspace remote dir; absolute escapes and\n * `..` traversal are rejected fail-closed before any bytes move. Sandbox paths\n * are POSIX.\n */\nexport function assertConfinedSandboxPath(remoteDir: string, candidate: string, label: string): void {\n  const normalizedRoot = path.posix.normalize(remoteDir);\n  const normalized = path.posix.normalize(candidate);\n  if (\n    !path.posix.isAbsolute(normalized) ||\n    normalized === \"..\" ||\n    normalized.includes(\"/../\") ||\n    normalized.endsWith(\"/..\")\n  ) {\n    throw new Error(`Kubernetes sync ${label} path is not a confined absolute path: ${candidate}`);\n  }\n  const prefix = normalizedRoot.endsWith(\"/\") ? normalizedRoot : `${normalizedRoot}/`;\n  if (normalized !== normalizedRoot && !normalized.startsWith(prefix)) {\n    throw new Error(`Kubernetes sync ${label} path escapes the workspace remote dir: ${candidate}`);\n  }\n}\n\n/**\n * True when `relative` (a POSIX path) escapes its anchoring directory once\n * normalized: an absolute path, `..`, or a `..`-leading traversal all break out.\n */\nfunction posixPathEscapes(relative: string): boolean {\n  const normalized = path.posix.normalize(relative);\n  return normalized === \"..\" || normalized.startsWith(\"../\") || path.posix.isAbsolute(normalized);\n}\n\nasync function withHostTempDir<T>(fn: (dir: string) => Promise<T>): Promise<T> {\n  const dir = await fs.mkdtemp(path.join(os.tmpdir(), \"paperclip-k8s-sync-\"));","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts#L115-L151","documentation":"Error \"Kubernetes sync ${label} path is not a confined absolute path: ${candidate}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an absolute path confined to the allowed root for the sync path."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}