Repository navigation
feat(core): block host keyring and IPC access in private commands - #406
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ 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". |
Private filesystem commands could still read host kernel keyrings and System V shared memory. A native regression reproduced both leaks using synthetic secrets. Give private commands a new IPC namespace, mount only its message queues, and install an inherited seccomp filter before executing the payload. Refuse host message-queue mounts, including read-only grants.
The filter blocks direct keyring calls, BPF/io_uring bypass paths, filesystem-key ioctls and nonstandard socket families including kernel crypto. Ordinary Unix/IP/netlink sockets remain subject to the existing network policy; descriptor/terminal operations and file cloning remain available. x32 calls are refused and other ABI mismatches terminate the payload. One Linux-only dependency,
seccompiler0.5 with default features disabled; its only dependency is the already-used libc.Verified on native Linux x86_64: the regression failed before the fix; 65 focused core tests and 41 worker/process tests pass. New tests cover shell/exec secret denial, private shared memory/message queues, ordinary ioctls, key/crypto/indirect syscall denial, x32 and 32-bit compatibility attempts, and host-mount refusal. The explicit delegated resource fixture also passes memory OOM, task limits, cancellation and cleanup with this guard enabled. Formatting, lint and Clippy pass. Full platform checks run in CI per the requested workflow.
Fifth layer after #405. Auto still selects host authority. Kernel crypto, BPF/io_uring and unlisted ioctls are intentionally unavailable to private commands. File/environment credentials, authenticated-operation brokering, hardlink isolation, shared task/server budgets, disk limits and macOS/Windows containment remain before Auto enablement. No comparative performance claim.