Codex CLI (and VSCode extension) sandbox unable to handle /proc mounting failures
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- linux, rust
- Domain
- operating-systems, security
Research direction
Start by locating is_proc_mount_failure and its existing tests, then compare the Fedora Bubblewrap 0.12.0 output in the issue with the current detection. Add coverage for the reported /proc error and verify that the sandbox falls back without mounting a fresh /proc using the provided reproduction command.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
0.153.4
What subscription do you have?
Plus
Which model were you using?
gpt-6 Astra
What platform is your computer?
Linux 7.1.13-200.fc44.x86_64 x86_64 unknown
What terminal emulator and version are you using (if applicable)?
No response
Codex doctor report
What issue are you seeing?
I run Codex CLI and VSCode with Codex extension inside a Podman container. Codex's Bubblewrap Linux sandbox fails while trying to mount a fresh /proc:
bwrap: Can't mount proc on /proc: Operation not permitted
Codex seems to have a fallback for environments where mounting a fresh /proc is not permitted.
However, it failed to use the fallback because it wrongly identified as mounting /proc worked.
So in the end the sandbox cannot work and Codex keeps on asking user to run commend outside of the sandbox
The reason for the failure:
The failure detection expects the Bubblewrap error to contain:
/newroot/proc
Bubblewrap 0.12.0 on Fedora instead reports:
bwrap: Can't mount proc on /proc: Operation not permitted
As a result, Codex does not recognise the failure and does not fall back to running Bubblewrap without mounting a fresh /proc.
What steps can reproduce the bug?
podman run --rm -it fedora:44 bash -lc '
dnf -y install nodejs npm bubblewrap &&
npm install -g @openai/codex@0.153.4 &&
echo "== bwrap ==" &&
bwrap --unshare-user --unshare-pid --ro-bind / / --proc /proc true || true &&
echo "== codex ==" &&
codex sandbox linux -- true
'
What is the expected behavior?
It should detect correctly not being able to mount /proc via this Bubblewrap error:
bwrap: Can't mount proc on /proc: Operation not permitted
and automatically fall back to running Bubblewrap without --proc /proc.
Or there might be a better and secure solution to avoid mounting /proc in the first place?
Additional information
The relevant detection currently appears to require /newroot/proc:
fn is_proc_mount_failure(stderr: &str) -> bool {
stderr.contains("Can't mount proc")
&& stderr.contains("/newroot/proc")
&& (stderr.contains("Invalid argument")
|| stderr.contains("Operation not permitted")
|| stderr.contains("Permission denied"))
}
A possible fix would be to avoid depending on the exact path reported by Bubblewrap:
fn is_proc_mount_failure(stderr: &str) -> bool {
stderr.contains("Can't mount proc")
&& (stderr.contains("Invalid argument")
|| stderr.contains("Operation not permitted")
|| stderr.contains("Permission denied"))
}
Or, more conservatively, accept both path formats:
fn is_proc_mount_failure(stderr: &str) -> bool {
stderr.contains("Can't mount proc")
&& (stderr.contains("/newroot/proc")
|| stderr.contains("on /proc"))
&& (stderr.contains("Invalid argument")
|| stderr.contains("Operation not permitted")
|| stderr.contains("Permission denied"))
}
A regression test for the Bubblewrap 0.12.0 output could be:
#[test]
fn detects_proc_mount_operation_not_permitted_on_proc() {
assert!(is_proc_mount_failure(
"bwrap: Can't mount proc on /proc: Operation not permitted"
));
}
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·