fix(design): restrict session file permissions to owner-only#859
Open
garagon wants to merge 1 commit intogarrytan:mainfrom
Open
fix(design): restrict session file permissions to owner-only#859garagon wants to merge 1 commit intogarrytan:mainfrom
garagon wants to merge 1 commit intogarrytan:mainfrom
Conversation
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.
Contributor
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
{ mode: 0o600 }to bothwriteFileSynccalls indesign/src/session.ts.Why
Design session files are written to
/tmpwithout restricted permissions. Default umask (typically 0644) makes them world-readable on shared systems. Sessions containoriginalBriefandfeedbackHistorywith user design prompts and iteration data.The rest of the codebase uses
mode: 0o600for sensitive file writes (16 locations acrossbrowse/src/server.ts,browse/src/sidebar-agent.ts,browse/src/browser-manager.ts,browse/src/cli.ts,browse/src/meta-commands.ts, anddesign/src/auth.ts).Files
design/src/session.ts:createSession()line 52 andupdateSession()line 78