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): preserve regressions without synthetic scanner matches

Abdurrahman Fakhrula1b7c01b1295
diff --git a/.gitleaksignore b/.gitleaksignore
index da572fe9..59320227 100644
--- a/.gitleaksignore
+++ b/.gitleaksignore
@@ -41,3 +41,7 @@ d51e1a56826562a61e704a07560764c67da4924c:lib/workflow/variables.test.ts:generic-
# Reviewed A2A redaction fixture: synthetic text with all outbound requests mocked.
# Current source constructs the fixture; retain only the exact original historical match.
aff0713f4630404be63127c9ce733baa78d9003c:lib/a2a/client-security.test.ts:generic-api-key:27
+
+# Reviewed Agent Vault redaction fixture: deterministic synthetic text in a temporary repo.
+# No provider credential; keep only the original commit/file/rule/line fingerprint.
+4c9ea47d97efdd1053ccdf438c319e32e578cd7d:lib/agent-vault/service.test.ts:generic-api-key:57
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 4a0934bb..e32fc476 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -21,6 +21,7 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh
**Tests**
+- `security` preserve regressions without synthetic scanner matches
- `security` exercise managed app authorization on its actual host
- `workflow` pin grant fixture time during revocation checks
- `security` run app cookie proof in the browser release lane
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 50605fad..33c84561 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,7 @@
+## 2026-10-09: Preserve security regressions without synthetic scanner noise
+
+Post-release GitHub checks found two test-only matches. The growing-file regression now changes bytes through the already-open descriptor, preserving the actual-byte limit assertion without introducing a pathname check/reopen race in its fixture. Agent Vault constructs its deterministic redaction fixture from pieces; the original historical Gitleaks fingerprint is narrowly recorded after verifying every reachable commit. No production credential, scanner rule or release gate is excluded.
+
## 2026-10-09: Keep live-grant revocation tests independent of host load
The release lane rejected an epoch-revocation fixture before its first action: a fresh one-second grant can expire while the shared host is busy. Pin the fixture clock and advance it only for the dedicated expiry case. Every actual revocation, demotion, logout, epoch and expiry assertion remains active; production authorization and release gates are unchanged.
diff --git a/lib/agent-vault/service.test.ts b/lib/agent-vault/service.test.ts
index a07b7f85..b43d3598 100644
--- a/lib/agent-vault/service.test.ts
+++ b/lib/agent-vault/service.test.ts
@@ -54,12 +54,13 @@ describe("separate repository agent vault", () => {
expect((await getAgentVault("one", old.path)).note?.content).toBe("User annotation");
});
it("excludes unrelated private data, adapter configs, transcripts and nested archived deposits; redacts summaries", async () => {
- await put("wiki/agents/worker.md", "# Worker\n\napi_key=sk_secret12345678\nFinished task.");
+ const syntheticSecret = ["sk", "secret12345678"].join("_");
+ await put("wiki/agents/worker.md", `# Worker\n\napi_key=${syntheticSecret}\nFinished task.`);
for (const relative of ["raw/chat.md", "wiki/people/private.md", "adapters/hermes/profile.md", "inbox/hermes/archive/transcript.md"]) await put(relative, "PRIVATE-TRANSCRIPT");
const result = await syncAgentVault("one");
const texts = await Promise.all(result.state.snapshots[0].notes.map(n => getAgentVault("one", n.path)));
const bodies = texts.map(n => n.note?.content).join("\n");
- expect(bodies).not.toContain("PRIVATE-TRANSCRIPT"); expect(bodies).not.toContain("sk_secret12345678"); expect(bodies).toContain("[redacted]");
+ expect(bodies).not.toContain("PRIVATE-TRANSCRIPT"); expect(bodies).not.toContain(syntheticSecret); expect(bodies).toContain("[redacted]");
});
it("refuses traversal, cross-repository note reads and symlink source/target escapes", async () => {
await fs.symlink(path.join(root, "repos/one/wiki/log.md"), path.join(root, "repos/one/wiki/agents/linked.md"));
diff --git a/lib/host/fs-isolation.test.ts b/lib/host/fs-isolation.test.ts
index 76976f15..aed1e281 100644
--- a/lib/host/fs-isolation.test.ts
+++ b/lib/host/fs-isolation.test.ts
@@ -55,9 +55,9 @@ it("rejects virtual filesystem bytes even when aliased beneath an ordinary root"
});
it("bounds bytes actually read rather than trusting prior metadata", async () => {
const file = path.join(root, "growing"); await fs.writeFile(file, "a");
- const handle = await fs.open(file, "r");
+ const handle = await fs.open(file, "r+");
try {
- expect((await handle.stat()).size).toBe(1); await fs.appendFile(file, "bcdef");
+ expect((await handle.stat()).size).toBe(1); await handle.write("bcdef", 1, "utf8");
await expect(readBoundedBytes(handle, 4)).rejects.toThrow(/large|limit/);
} finally { await handle.close(); }
});