Skip to content

Commit 4535ba1

Browse files
hclsysclaude
andcommitted
fix(plugins): distinguish missing entry file from security violation
resolvePackageEntrySource() treats all openBoundaryFileSync failures as path-escape security violations. When an extension entry file is simply missing (ENOENT, reason="path"), the gateway emits "extension entry escapes package directory" and aborts — crashing in a loop. Root cause: src/plugins/discovery.ts:478 checks !opened.ok but never inspects opened.reason. SafeOpenSyncResult already distinguishes "path" (ENOENT) from "validation" (actual path escape). Fix: only push the security diagnostic when opened.reason is "validation". For "path" or "io" failures, return null to skip the entry silently — a missing file is not a security violation. Closes #52445 Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: HCL <[email protected]>
1 parent d6c6316 commit 4535ba1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/plugins/discovery.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ function resolvePackageEntrySource(params: {
476476
rejectHardlinks: params.rejectHardlinks ?? true,
477477
});
478478
if (!opened.ok) {
479+
if (opened.reason !== "validation") {
480+
// File missing (ENOENT) or I/O error — skip silently, not a security violation.
481+
return null;
482+
}
479483
params.diagnostics.push({
480484
level: "error",
481485
message: `extension entry escapes package directory: ${params.entryPath}`,

0 commit comments

Comments
 (0)