fix: restrict IPC socket directory permissions to owner-only#216
Open
garagon wants to merge 2 commits intoopenclaw:mainfrom
Open
fix: restrict IPC socket directory permissions to owner-only#216garagon wants to merge 2 commits intoopenclaw:mainfrom
garagon wants to merge 2 commits intoopenclaw:mainfrom
Conversation
The queue socket directory at /tmp/acpx-<hash>/ and the queue base directory at ~/.acpx/queues/ are created with mkdir without explicit mode, inheriting the default umask (typically 0o755). This allows other local users to list socket files and connect to them. Set mode 0o700 on both directories so only the owning user can access the IPC sockets.
mkdir with recursive: true does not change permissions on directories that already exist. An explicit chmod ensures the correct mode is applied even if the directory was previously created with a more permissive umask.
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.
The queue socket directory at
/tmp/acpx-<hash>/and the queue base directory at~/.acpx/queues/are created withfs.mkdirwithout an explicitmode, so they inherit the default umask (typically0o755). This allows other local users to traverse the directory and discover session socket files.This change sets
mode: 0o700on both directories so only the owning user can access the IPC sockets.What changed:
ensureQueueDir()insrc/queue-lease-store.tsnow passesmode: 0o700to bothmkdircallsWhat did NOT change:
How I verified:
queueBaseDir()resolves to~/.acpx/queues/andqueueSocketBaseDir()resolves to/tmp/acpx-<hash>/modeis respected by Node.jsfs.mkdiron Linux and macOS