Codex CLI 0.172.0 on WSL 2: denied /run/WSL remains listable and write-eligible inside a tmpfs mask
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 34/100
Research direction
Start by reproducing the reported behavior with the supplied codex sandbox command and inspect how filesystem deny rules are resolved and applied to /run/WSL. The report says the reproduction is derived from a verified fixture and has not been rerun independently; the effective configuration is also unverified. Done means listing the masked directory fails and the effective-ID write/search check returns false while host interoperability resources remain inaccessible.
Written by the indexing model from the issue text.
Description
What version of the Codex App are you using (From “About Codex” dialog)?
codex-cli 0.172.0, standalone Linux x86-64 musl build
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Windows host, WSL 2 Linux x86-64, CPython 3.12.3, unprivileged Linux user.
What issue are you seeing?
A named permission profile explicitly denies /run/WSL.
Under Codex CLI 0.172.0, the sandbox masked the host directory with a separate, empty tmpfs. However, the mask remained listable and the effective-ID write/search check returned true.
The full isolation fixture stopped with exit code 1 and reported:
RuntimeError: Isolation failure: Windows interop socket directory unexpectedly succeeded
The actual host interoperability resources were hidden. However, the listable and write-eligible mask does not satisfy the expected behavior of an explicit deny rule.
Actual file creation was not tested. I contacted OpenAI Support, and they indicated that this behavior is not documented as expected.
What steps can reproduce the bug?
This reduced reproduction is derived from the verified full fixture and has not been rerun independently.
Use a disposable WSL workspace with empty scratch/ and exports/ directories.
The fixture reads metadata, attempts a directory listing and checks access using the process's effective IDs. It creates no files and opens no interop sockets.
Save the following sanitized permission profile as repro-profile.toml. The command substitutes the resolved executable path for <CODEX_BIN>.
[permissions.gql-audit.filesystem]
":root" = "deny"
":minimal" = "read"
"/init" = "deny"
"/mnt" = "deny"
"/run/WSL" = "deny"
"/run/user" = "deny"
"<CODEX_BIN>" = "read"
[permissions.gql-audit.filesystem.":workspace_roots"]
"." = "read"
"scratch" = "write"
"exports" = "write"
[permissions.gql-audit.network]
enabled = false
Run from the disposable workspace:
/usr/bin/python3 -I -S -B - <<'PY'
import json
import shutil
import subprocess
import tomllib
from pathlib import Path
workspace = Path.cwd()
binary = shutil.which("codex")
if not binary:
raise SystemExit("Codex CLI not found")
codex = Path(binary).resolve(strict=True)
profile = tomllib.loads(
(workspace / "repro-profile.toml").read_text()
)["permissions"]["gql-audit"]
profile["filesystem"].pop("<CODEX_BIN>")
profile["filesystem"][str(codex)] = "read"
def inline_toml(value):
if isinstance(value, dict):
return "{ " + ", ".join(
f"{json.dumps(key)} = {inline_toml(item)}"
for key, item in value.items()
) + " }"
return json.dumps(value)
fixture = r"""
import json, os, stat
from pathlib import Path
path = Path("/run/WSL")
result = {}
try:
info = path.stat()
result.update(device=info.st_dev, inode=info.st_ino,
mode=f"{stat.S_IMODE(info.st_mode):04o}")
except OSError as error:
result["stat_errno"] = error.errno
try:
result["entry_count"] = len(os.listdir(path))
result["listable"] = True
except OSError as error:
result.update(listable=False, list_errno=error.errno)
result["write_and_search_allowed"] = os.access(
path, os.W_OK | os.X_OK, effective_ids=True
)
result["mountinfo"] = [
line for line in Path("/proc/self/mountinfo").read_text().splitlines()
if line.split(" - ", 1)[0].split()[4] == str(path)
]
print(json.dumps(result, indent=2))
raise SystemExit(1 if result["listable"] or result["write_and_search_allowed"] else 0)
"""
raise SystemExit(subprocess.run([
str(codex), "sandbox",
"--config", "permissions.gql-audit=" + inline_toml(profile),
"--permission-profile", "gql-audit",
"--include-managed-config", "--cd", str(workspace), "--",
"/usr/bin/env", "-i", "PATH=/usr/bin:/bin",
f"TMPDIR={workspace / 'scratch'}",
"/usr/bin/python3", "-E", "-S", "-B", "-c", fixture,
], cwd=workspace, stdin=subprocess.DEVNULL).returncode)
PY
What is the expected behavior?
With the explicit deny rule active, listing /run/WSL should fail, and the effective-ID write/search check should return false.
The host's WSL interoperability resources should remain inaccessible.
OpenAI Support indicated that explicit deny rules are intended to prevent both reads, including directory listing, and writes, and that the observed listable, write-eligible tmpfs behavior is not documented as expected.
I am seeking a supported resolution that preserves sandbox protections and managed security requirements.
Additional information
Verified diagnostic evidence
Diagnostic | Result -- | -- Host /run/WSL | Device 63, inode 8, eight sockets and one symlink Sandbox /run/WSL | Device 103, inode 1, zero entries Sandbox mount | Separate read-write tmpfs Mount propagation tags | [] Directory mode | 0755 Directory listing | Succeeded Effective write/search eligibility | true Actual file creation | Not tested Full fixture exit code | 1Other isolation checks confirmed separate mount and network namespaces, loopback-only interfaces and routes, denial of a harmless outside Unix socket, Windows drive listing, staged input writes, and reads of /init and cmd.exe.
The exported diagnostic SHA-256 hashes matched. No real host interoperability sockets were contacted.
Configuration uncertainty
The launcher explicitly requested gql-audit with --include-managed-config. It supplied neither --sandbox nor a legacy configuration override.
The generated project template contains neither sandbox_mode nor sandbox_workspace_write.
Read-only grep checks returned no matches for these keys or default_permissions in the WSL user and staged project configurations.
However, the complete system and managed configuration stack and the permission profile actually resolved by the noninteractive sandbox helper remain unverified.
Attempting to obtain interactive /status and /debug-config output triggered a project trust prompt. No trust settings were changed.
Request for engineering assistance
Is this a denied-directory mask implementation issue or a configuration-resolution issue?
Is there a supported configuration or stable release that enforces directory-listing and write denial?
What supported read-only diagnostic can confirm the effective permissions and managed policy used by this exact noninteractive
codex sandboxinvocation?
I do not want to disable sandboxing, weaken security requirements or use unrestricted execution as a workaround.
- Dominant language
- Rust
- Stars
- 136k
- Forks
- 21.6k
- Avg merge
- 1m
- Merged PRs (30d)
- 997
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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
-
app bug rate-limits
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Windows PowerShell 5.1: non-ASCII text piped into a native command arrives as `?`Possibly taken @akhil9tiet claimed this today. Openbug CLI tool-calls windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openai/codex#64139 · 2 comments ·
Maintainers usually reply within 1 day
-
bug CLI connectivity
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
core-plugins: remote bundle install keeps the temp directory before a fallible rename and leaves it behind on failurePossibly taken @akhil9tiet claimed this 1 day ago. Openbug CLI skills
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openai/codex#63907 · 2 comments ·
Maintainers usually reply within 1 day
-
bug CLI
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openai/codex#63906 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
My Caps shows "Shared" on private Caps that were never sharedPossibly taken @AksharP5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CapSoftware/Cap#4569 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Document Web UIOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
parquet: reject truncated BYTE_STREAM_SPLIT numeric pages instead of silently fabricating valuesOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day