🤖 fix: enforce owner-only file permissions under ~/.mux/ (CDM-01-007)#2784
🤖 fix: enforce owner-only file permissions under ~/.mux/ (CDM-01-007)#2784ibetitsmike merged 2 commits intomainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac7fc70ac1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Run chmod after mkdir in ensurePrivateDir/ensurePrivateDirSync so existing directories from older installs are tightened to 0o700. Also added async and sync tests that start from a permissive mode and verify permissions are tightened.
|
@codex review Addressed P1 feedback: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff5ee611b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed all prior feedback. P1 resolved with chmod for pre-existing dirs. P2 resolved as intentional design tradeoff (explained in thread). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff5ee611b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review All threads resolved. The P2 about CLI umask scope is an intentional design choice (explained in previous thread reply). |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Fix CDM-01-007 (Medium): session directories and files under
~/.mux/are created with default permissions (world-readable), exposing chat history, workspace metadata, and user prompts to other local OS users.Background
Pentest finding CDM-01-007 identified that 31+
mkdircalls and 10+writeFilecalls operate on~/.mux/paths without setting restrictive permissions. OnlytempDir.tsand a few secret-handling files set explicit modes.Implementation
Process-wide umask (
0o077) set at the earliest point in both entry points (src/desktop/main.ts,src/cli/index.ts). With this umask:mkdirdefaults (0o777) become 0o700 (owner-only)writeFiledefaults (0o666) become 0o600 (owner-only)mode: 0o600on secrets remain correctensurePrivateDirhelper (src/node/utils/fs.ts) provides defense-in-depth with explicitmode: 0o700at 9 high-sensitivity root-directory creation callsites (config.ts,historyService.ts,aiService.ts,workspaceService.ts,analyticsService.ts).~55 LoC added across 8 files touched. On Windows, neither
modenorumaskare enforced by Node.js — NTFS ACLs handle permissions instead, so this is a safe no-op there.Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh• Cost:$5.27