{"record":{"id":"66771f645074935a","repo":"GoogleContainerTools/skaffold","slug":"temporary-file-system-operation-is-out-of-boundary","errorCode":null,"errorMessage":"temporary file system operation is out of boundary, root: %s, trying to access %s","messagePattern":"temporary file system operation is out of boundary, root: (.+?), trying to access (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/render/renderer/kustomize/fs.go","lineNumber":66,"sourceCode":"\t\troot: filepath.Clean(rootPath),\n\t}\n}\n\nfunc (f TmpFSReal) Cleanup() {\n\tos.RemoveAll(f.root)\n}\n\nfunc (f TmpFSReal) GetPath(path string) (string, error) {\n\tres := filepath.Join(f.root, path)\n\tif err := f.validate(res); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn res, nil\n}\n\nfunc (f TmpFSReal) validate(path string) error {\n\tif path != f.root && !strings.HasPrefix(path, f.root+\"/\") {\n\t\treturn fmt.Errorf(\"temporary file system operation is out of boundary, root: %s, trying to access %s\", f.root, path)\n\t}\n\treturn nil\n}\n\ntype TmpFS interface {\n\tWriteTo(path string, content []byte) error\n\tCleanup()\n\tGetPath(path string) (string, error)\n}\n","sourceCodeStart":48,"sourceCodeEnd":76,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/render/renderer/kustomize/fs.go#L48-L76","documentation":"TmpFSReal is a sandboxed in-memory temp filesystem used by the kustomize renderer; validate() ensures every path it touches is the root itself or underneath root (prefix root+\"/\"). Any access outside that boundary returns this error, protecting against kustomize reading or writing files outside the generated tmp tree.","triggerScenarios":"GetPath (via validate) is asked for a path that is not equal to f.root and doesn't start with f.root+\"/\" — e.g. kustomize resolves a resource/loadRestriction to an absolute path outside the temp root, or a symlinked/normalized path escapes the root.","commonSituations":"Kustomization referencing resources via ../ relative paths that escape the tmp root; absolute file paths in resources while loadRestrictions allow them; symlinks inside the tmp dir pointing outside; Skaffold failing to mirror a referenced file into the tmp FS.","solutions":["Remove resource references that escape the kustomization dir (../ or absolute paths)","Set loadRestrictions: NobodyCanLoad from outside the kustomization root so kustomize errors locally instead of escaping the tmp FS","Check for symlinks in your kustomize tree pointing outside the project and replace them with real files","Ensure all referenced bases/resources are inside the kustomization directory so Skaffold copies them into the tmp FS"],"exampleFix":"# before\nresources:\n  - ../../shared/base\n# after: copy or vendor the base under the project, or use a kustomize remote base\nresources:\n  - ./base","handlingStrategy":"validation","validationCode":"grep -rE '(\\.\\./|/[a-z]+/)' kustomization.yaml */kustomization.yaml && echo 'paths may escape kustomization root'","typeGuard":null,"tryCatchPattern":"p, err := tmpFS.GetPath(name)\nif err != nil && strings.Contains(err.Error(), \"out of boundary\") {\n    // the referenced resource lives outside the kustomize tmp root; fix the reference\n}","preventionTips":["Avoid ../ and absolute resource paths in kustomizations","Set loadRestrictions: NobodyCanLoad from outside the kustomization root","Remove symlinks pointing outside the kustomize tree"],"tags":["kustomize","filesystem","security","path-traversal"],"backgroundTag":"filesystem-boundary-violation","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}