From b9d9a474cf53615ba60651f429068cf3c69fbbb9 Mon Sep 17 00:00:00 2001 From: Luis Taffelli <86675342+LuisTaffelli@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:28:41 -0300 Subject: [PATCH] fix(verification): report identified Hopper leaks before proc errors --- scripts/lib/clean-linux-hopper-runtime.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/lib/clean-linux-hopper-runtime.mjs b/scripts/lib/clean-linux-hopper-runtime.mjs index f7556ec67..27a306fce 100644 --- a/scripts/lib/clean-linux-hopper-runtime.mjs +++ b/scripts/lib/clean-linux-hopper-runtime.mjs @@ -31,6 +31,7 @@ export const assertCleanLinuxHopperRuntime = async ( if (launchers.length === 0) return; // /proc exposes the executed file even when argv[0] names a removed symlink. // Compare file identity, not a display path or a process name. + let inspectionError; for (const entry of await readdir("/proc", { withFileTypes: true })) { if (!entry.isDirectory() || !/^\d+$/u.test(entry.name)) continue; let executable; @@ -47,7 +48,10 @@ export const assertCleanLinuxHopperRuntime = async ( }); if (owner === undefined || owner.uid !== process.getuid()) continue; } - throw error; + // Finish the inventory so an unrelated restricted process cannot mask a + // positively identified leak. Unknown caller processes still fail closed. + inspectionError ??= error; + continue; } if ( launchers.some( @@ -56,4 +60,5 @@ export const assertCleanLinuxHopperRuntime = async ( ) throw new Error("Clean Linux runner retained a Hopper demo process"); } + if (inspectionError !== undefined) throw inspectionError; };