gstack/design/test
Bunlong Heng ab4da32cb9 fix(design): create OpenAI key file owner-only to close write-then-chmod race
saveApiKey wrote ~/.gstack/openai.json at the default umask (typically
0644) and only tightened it to 0600 with a following chmodSync. Between
the write and the chmod the file containing the OpenAI API key is
group/world-readable, so any local user on a shared host can read the key
in that window (CWE-377 insecure file creation / CWE-367 TOCTOU).

Pass { mode: 0o600 } to writeFileSync so the file is created owner-only up
front, matching the convention already used for session files in
design/src/session.ts (#859). The trailing chmodSync is kept as a backstop
to tighten a pre-existing loose file.

Adds a regression test asserting the key file is 0600 (no group/other
bits) even when written under a permissive umask.
2026-08-06 13:59:54 -04:00
..
auth.test.ts fix(design): create OpenAI key file owner-only to close write-then-chmod race 2026-08-06 13:59:54 -04:00
daemon-discovery.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
daemon-tests-fixtures.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
daemon.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
feedback-roundtrip-daemon.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
feedback-roundtrip.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
gallery.test.ts feat: design binary — real UI mockup generation for gstack skills (v0.13.0.0) (#551) 2026-03-27 20:32:59 -06:00
serve.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
variants-retry-after.test.ts v1.30.0.0 fix wave: 21 community PRs + Windows CI extension + codex flag-semantics smoke (#1391) 2026-05-09 08:06:47 -07:00