Skip to content

fix: restrict IPC socket directory permissions to owner-only#216

Open
garagon wants to merge 2 commits intoopenclaw:mainfrom
garagon:fix/ipc-socket-permissions
Open

fix: restrict IPC socket directory permissions to owner-only#216
garagon wants to merge 2 commits intoopenclaw:mainfrom
garagon:fix/ipc-socket-permissions

Conversation

@garagon
Copy link
Copy Markdown

@garagon garagon commented Apr 4, 2026

The queue socket directory at /tmp/acpx-<hash>/ and the queue base directory at ~/.acpx/queues/ are created with fs.mkdir without an explicit mode, so they inherit the default umask (typically 0o755). This allows other local users to traverse the directory and discover session socket files.

This change sets mode: 0o700 on both directories so only the owning user can access the IPC sockets.

What changed:

  • ensureQueueDir() in src/queue-lease-store.ts now passes mode: 0o700 to both mkdir calls

What did NOT change:

  • No changes to the IPC protocol or queue behavior
  • No changes to socket file creation (Unix sockets inherit directory permissions for access control)

How I verified:

  • Reviewed that queueBaseDir() resolves to ~/.acpx/queues/ and queueSocketBaseDir() resolves to /tmp/acpx-<hash>/
  • Confirmed no other code path creates these directories
  • Confirmed mode is respected by Node.js fs.mkdir on Linux and macOS

garagon added 2 commits April 4, 2026 12:45
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.
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