Skip to content

fix(design): restrict session file permissions to owner-only#859

Open
garagon wants to merge 1 commit intogarrytan:mainfrom
garagon:fix/design-session-file-permissions
Open

fix(design): restrict session file permissions to owner-only#859
garagon wants to merge 1 commit intogarrytan:mainfrom
garagon:fix/design-session-file-permissions

Conversation

@garagon
Copy link
Copy Markdown
Contributor

@garagon garagon commented Apr 6, 2026

What

Add { mode: 0o600 } to both writeFileSync calls in design/src/session.ts.

Why

Design session files are written to /tmp without restricted permissions. Default umask (typically 0644) makes them world-readable on shared systems. Sessions contain originalBrief and feedbackHistory with user design prompts and iteration data.

The rest of the codebase uses mode: 0o600 for sensitive file writes (16 locations across browse/src/server.ts, browse/src/sidebar-agent.ts, browse/src/browser-manager.ts, browse/src/cli.ts, browse/src/meta-commands.ts, and design/src/auth.ts).

Files

  • design/src/session.ts: createSession() line 52 and updateSession() line 78

Design session files are written to /tmp without mode 0o600, making them
world-readable on shared systems. Sessions contain originalBrief and
feedbackHistory (user design prompts and iteration data).

The rest of the codebase (16 locations in browse/src and design/src/auth.ts)
correctly uses mode 0o600 for sensitive file writes.
@garagon
Copy link
Copy Markdown
Contributor Author

garagon commented Apr 6, 2026

CI note: the E2E eval failures require ANTHROPIC_API_KEY which is not available on fork PRs. Free tests (build-image) pass. The change adds { mode: 0o600 } to two writeFileSync calls — no impact on eval test paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant