Repository navigation
fix(daemon): the data directory is created owner-only - #892
Merged
Merged
Conversation
Contributor
Author
Review (maintainer's agent, round 1)One fix, otherwise sound. Fix
Checked and fine
Note, no change needed: on a gateway-only machine |
Contributor
Author
Review round 1, correctionThe one fix above is withdrawn. Line 18 of No blocking findings remain. |
V3RON
marked this pull request as ready for review
October 26, 2026 09:46
V3RON
force-pushed
the
security/data-dir-mode
branch
from
October 26, 2026 10:29
53935ba to
4671805
Compare
V3RON
force-pushed
the
security/data-dir-mode
branch
from
October 26, 2026 14:25
4671805 to
68d941d
Compare
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.
Summary
The security model says file modes are the real boundary, but the data directory (
~/.simlock,~/.simlock/gateway) was created with the umask default, usually0755. Now whatever creates it first makes it0700. An existing directory keeps its mode. When the group or others can reach it, the daemon logs onewarnat start:data directory <path> is accessible to other users (mode <octal>); run chmod 700 <path>.Changes
Filesystem.mkdirp(path, { mode }): the mode applies only to a directory the call creates; the Node adapter runschmodaftermkdirso the umask cannot drop bits.DATA_DIRECTORY_MODE = 0o700insrc/ports/paths.ts.prepareDataDirectoryruns first incomposeDaemon;DaemonEndpointHost.startcreates the socket's directory0700.config set, the auto-launch and service install create the directory0700.worker/running-the-daemon.mdx, manuals forsrc/ports,src/daemon,src/cli, andflows/startup.md.Tests
startDaemon(missing,0700,0750,0755), the launcher, service install, ande2e/daemon-folders.test.ts.Assumptions
0700? — yes; on a fresh machine they create it first, and the daemon would otherwise warn about its own launcher's directory.composeDaemon, before the log sink; latermkdirpcalls stay plain because the directory exists by then.NodeDaemonLauncherimportDATA_DIRECTORY_MODE? — no, it uses the literal0o700, because a test loads it alone in a child process that cannot resolve local imports.mode & 0o077); the warning repeats on every start until fixed.Review
Spec review: skipped. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: skipped.
Rounds: 1. Tokens: n/a.
One combined review by the maintainer's agent on 2026-10-22 (comment below); no blocking findings. Its one fix was withdrawn in a follow-up comment.
Rebased onto
maine1f2f43 on 2026-10-26 as one commit. No conflicts.Written by an agent.