Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

test(security): remove recovery marker TOCTOU

Rahman7982fe9c0844
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index cf8d54d9..6bc70003 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -21,6 +21,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Tests**
+- `security` remove recovery marker TOCTOU
- `gateway` assert one live tunnel after concurrent start
- `install` read abort capture by descriptor
- `install` align bootstrap and abort harness
diff --git a/scripts/mso-gateway-natural-exit.test.ts b/scripts/mso-gateway-natural-exit.test.ts
index 6c3f8e26..2e4a3348 100644
--- a/scripts/mso-gateway-natural-exit.test.ts
+++ b/scripts/mso-gateway-natural-exit.test.ts
@@ -44,6 +44,9 @@ it("persists recovery intent when an owned fallback exited naturally before upda
const state = JSON.parse(fs.readFileSync(path.join(f.state, "state.json"), "utf8"));
expect(state.runtimeOwned).toBe(false);
expect(state.runtimeIdentity).toBeNull();
- expect(fs.statSync(marker).mode & 0o777).toBe(0o600);
- expect(fs.readFileSync(marker, "utf8").trim()).toBe("1");
+ const markerFd = fs.openSync(marker, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
+ try {
+ expect(fs.fstatSync(markerFd).mode & 0o777).toBe(0o600);
+ expect(fs.readFileSync(markerFd, "utf8").trim()).toBe("1");
+ } finally { fs.closeSync(markerFd); }
});