{"record":{"id":"904e4033a5e51aa8","repo":"apple/pkl","slug":"cannotglobtripledots-904e40","errorCode":"cannotGlobTripleDots","errorMessage":"cannotGlobTripleDots","messagePattern":"cannotGlobTripleDots","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/ast/expression/unary/ReadGlobNode.java","lineNumber":75,"sourceCode":"              sourceSection,\n              \"\",\n              language,\n              new FrameDescriptor(),\n              new ReadGlobMemberBodyNode(sourceSection));\n    }\n    return memberNode;\n  }\n\n  @Specialization\n  @TruffleBoundary\n  public Object read(String globPattern) {\n    var cachedResult = cachedResults.get(globPattern);\n    //noinspection ConstantValue\n    if (cachedResult != null) return cachedResult;\n\n    // use same check as for globbed imports (see AstBuilder)\n    if (globPattern.startsWith(\"...\")) {\n      throw exceptionBuilder().evalError(\"cannotGlobTripleDots\").build();\n    }\n    var globUri = parseUri(globPattern);\n    var context = VmContext.get(this);\n    try {\n      var resolvedUri = IoUtils.resolve(context.getSecurityManager(), currentModule, globUri);\n      var reader = context.getResourceManager().getReader(resolvedUri, this);\n      if (!reader.isGlobbable()) {\n        throw exceptionBuilder().evalError(\"cannotGlobUri\", globUri, globUri.getScheme()).build();\n      }\n      var resolvedElements =\n          GlobResolver.resolveGlob(\n              context.getSecurityManager(),\n              reader,\n              currentModule,\n              currentModule.getUri(),\n              globPattern);\n      var builder = new VmObjectBuilder(resolvedElements.size());\n      for (var entry : resolvedElements.entrySet()) {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/ast/expression/unary/ReadGlobNode.java#L57-L93","documentation":"Thrown when a globbed read (or import) pattern starts with `...` (triple dots). Relative paths beginning with `...` denote parent-directory traversal in Pkl's module scheme, and globbing across such paths is deliberately unsupported. The check mirrors the one used for globbed imports in AstBuilder.","triggerScenarios":"Calling `read*(\".../*.pkl\")` or `import*(\".../*.x\")` — a glob pattern whose string form begins with `...` — in ReadGlobNode.read.","commonSituations":"Trying to glob files in parent directories of the current module, porting shell glob habits where `..` traversal plus wildcards seems natural.","solutions":["Remove the leading `...` and glob within the current module's directory instead.","Place the evaluation entry point (root module) in the common parent directory so patterns like `**/*.pkl` cover the files.","Reference the parent files via explicit imports rather than globbing.","Use a project (PklProject) so the target files are within the project root."],"exampleFix":"// before\nread*(\"../*.pkl\")  // or \".../*.pkl\"\n// after\nread*(\"**/*.pkl\")  // run from the common parent directory","handlingStrategy":"validation","validationCode":"function assertNoTripleDots(pattern) {\n  if (String(pattern).startsWith(\"...\")) throw new Error(\"cannot glob '...' paths\")\n  return pattern\n}","typeGuard":"const isGlobbablePattern = (p) => typeof p === 'string' && !p.startsWith('...')","tryCatchPattern":null,"preventionTips":["Never start glob patterns with `...` or `..`","Restructure the project so globs stay within the current directory tree","Use explicit imports for parent-directory files"],"tags":["glob","path-traversal","unsupported"],"backgroundTag":"path-traversal-blocked","analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}