Repository navigation
Description
Summary
In a Codex IDE session using the default sandbox with external networking restricted, Node.js spawnSync returned an EPERM error even though the Git child process printed its version and exited with status 0. Direct Git execution succeeded in an earlier comparison.
Environment
- Ubuntu 24.04, Linux 6.8.0-139-generic, x86_64
- Node.js v22.23.2
- Git 2.43.0
- Codex IDE extension 26.1007.21434
- Currently installed Codex binary: 0.162.0-alpha.17.2
The Codex version was checked after the reproduction; the exact launcher build used during the recorded run was not independently preserved.
Execution context
Node ran through the IDE session’s execution tool with sandbox_permissions set to use_default. It did not run through SSH or a nested codex sandbox command. A separate host-side session performed bounded diagnostic tracing.
The target process had AppArmor enforcement, NoNewPrivs=1, Seccomp=2 and CapEff=0. It used a separate network namespace without external IPv4 routes. Default filesystem restrictions remained active.
Observed call
const { spawnSync } = require('node:child_process');
const result = spawnSync('git', ['--version'], {
encoding: 'utf8',
windowsHide: true,
timeout: 2000
});Observed result
- status: 0
- signal: null
- stdout: "git version 2.43.0\n"
- stderr: empty
- error.code: EPERM
- error.errno: -1
- error.syscall: spawnSync git
Reproduction limitation
The recorded run used a temporary JavaScript preload that restricted network and DNS APIs. Inspection found no modification of child_process or spawnSync. The preload contains project-specific fixture configuration and is not attached. Execution without it has not been tested, so the snippet above is not yet a complete standalone reproduction. Its possible influence has not been fully excluded.
Trace observations
During the approximately 11 ms call window, tracing recorded:
- io_uring_setup (x86_64 syscall 425): -EPERM once
- setsockopt (54): -EPERM twelve times
- shutdown (48): -EPERM once
The parent Node process and Git child were correlated using host-side process identity and fork evidence. The shutdown entry event was missing, so its file descriptor and how argument are unknown. The trace also contains unmatched entry/exit events; completeness is not claimed.
Related source
The source tagged rust-v0.162.0-alpha.17.2 contains Restricted-mode rules denying shutdown and setsockopt with EPERM. Socket creation distinguishes AF_UNIX, but these two denial rules do not inspect the descriptor’s socket family.
This is consistent with the observations, but does not prove which filter was loaded during the run. Neither AppArmor/Seccomp decisions nor native/libuv error propagation were captured. We therefore cannot conclusively attribute result.error to a particular denied syscall or policy rule.
Expected behavior
The call should return status 0, the expected Git output and no error, while preserving filesystem isolation and external-network restrictions for IPv4 and IPv6. A fix should not require ignoring result.error, disabling the sandbox, elevating Node, or enabling alternative networking paths through AF_VSOCK or io_uring.
Could you confirm whether these syscall restrictions can interfere with Node’s local IPC and synchronous child-process handling, and advise on a supported fix or a more useful minimal reproduction?
Activity