Codex CLI 0.172.0 on WSL 2: denied /run/WSL remains listable and write-eligible inside a tmpfs mask
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 34/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 136k
- Fork
- 21.6k
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 997
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openai/codex
-
app bug rate-limits
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows PowerShell 5.1: non-ASCII text piped into a native command arrives as `?`Có thể đã có người làm @akhil9tiet đã nhận 1 ngày trước. Đang mởbug CLI tool-calls windows-os
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openai/codex#64139 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CLI connectivity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
core-plugins: remote bundle install keeps the temp directory before a fallible rename and leaves it behind on failureCó thể đã có người làm @akhil9tiet đã nhận 1 ngày trước. Đang mởbug CLI skills
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openai/codex#63907 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CLI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openai/codex#63906 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
kornia/kornia-rs#1416 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
My Caps shows "Shared" on private Caps that were never sharedCó thể đã có người làm @AksharP5 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CapSoftware/Cap#4569 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày