mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Isolate app-server Unix sockets from filesystem-restricted commands (#45984)
## Why Network access and Unix-socket allowlists must not let commands with filesystem restrictions reach the privileged app-server RPC transport. ## What changed - Bind Unix control sockets in a fixed, user-owned directory with mode `0700`, independent of environment settings, and expose the advertised paths as symlinks. Preserve existing parent permissions, reject unsafe parents, and serialize socket setup and publication. - Mask the socket directory in Linux bubblewrap sandboxes after each bind that exposes it. Reject host mount aliases and nested mounts that compromise isolation. - Deny access to the directory and outbound connections to its sockets in macOS Seatbelt policies, including when network access or Unix-socket allowlists grant broader access. - Require bubblewrap for filesystem-restricted Linux execution. Users with `features.use_legacy_landlock` enabled must disable it for these policies. ## Testing Add regression coverage for direct and symlink socket access, hardlink attempts, Linux host-process links and bind-mount aliases, and continued use of unrelated and sandbox-local sockets. Add transport coverage for parent permissions, concurrent restart after a stale symlink, and cleanup that preserves a replacement at the advertised path. GitOrigin-RevId: 53372c27eea278d964f2cf68aed24323ef3b7082
This commit is contained in:
1 parent
0666c12e78
commit
49305d74b4
25 files changed
+828
-191
No files matched your search
@@ -37,12 +37,9 @@ commands that would enter the bubblewrap path.
|
||||
- WSL2 uses the normal Linux bubblewrap path.
|
||||
- WSL1 is not supported for bubblewrap sandboxing; Codex rejects sandboxed
|
||||
shell commands that would require the bubblewrap path before invoking `bwrap`.
|
||||
- Legacy Landlock + mount protections remain available as an explicit legacy
|
||||
fallback path.
|
||||
- Set `features.use_legacy_landlock = true` (or CLI `-c use_legacy_landlock=true`)
|
||||
to force the legacy Landlock fallback.
|
||||
- The legacy Landlock fallback is used only when the split filesystem policy is
|
||||
sandbox-equivalent to the legacy model after `cwd` resolution.
|
||||
- Filesystem-restricted execution requires bubblewrap. The legacy Landlock
|
||||
option is rejected for these policies because it cannot isolate app-server
|
||||
Unix sockets. Disable `features.use_legacy_landlock` when upgrading.
|
||||
- Split-only filesystem policies that do not round-trip through the legacy
|
||||
`SandboxPolicy` model stay on bubblewrap so nested read-only or denied
|
||||
carveouts are preserved.
|
||||
|
||||
Reference in new issue
Block a user