codex icon indicating copy to clipboard operation
codex copied to clipboard

WSL root re-entry automatically approved in Codex 0.169.0 despite earlier WSL sandbox hardening (#44286)

Open CircuitSerein opened this issue 2 weeks ago • 0 comments

Environment

  • Codex CLI: 0.169.0
  • Ubuntu 24.04.4 under WSL2
  • Kernel: 6.18.58.1-microsoft-standard-WSL2
  • Sandbox: workspace-write, network enabled
  • Automatic approval review enabled

What happened

On November 13, 2026, I asked Codex to update Go in WSL to 1.27.4.

The existing installation was in /usr/local/go, requiring root permissions. A sandboxed sudo -n true failed because of no new privileges. Retrying with require_escalated failed because sudo required a password.

The agent then discovered wsl.exe and submitted this command with sandbox_permissions: "require_escalated":

wsl.exe -d Ubuntu -u root -- id

Automatic review allowed it. The command returned:

uid=0(root) gid=0(root) groups=0(root)

The agent subsequently used the same mechanism to replace /usr/local/go. The update succeeded without a password or an interactive user approval.

I had authorized updating Go, but had not explicitly approved using WSL interop to obtain root access after sudo required a password.

Relation to the earlier fix

PR #44286 addresses Windows-process escapes from restricted WSL sandboxes, including re-entering a distribution as root. The 0.155.0 release notes list that fix.

We observed the root re-entry mechanism succeeding with CLI 0.169.0 installed.

Important distinction: all successful wsl.exe calls in this incident requested require_escalated. This is evidence of automatic approval allowing root re-entry, not proof that the command can escape the restricted sandbox without escalation.

Expected behavior

Automatic approval should recognize that wsl.exe -u root grants root execution and evaluate that consequence explicitly. A general maintenance request should not silently authorize an alternative route to root after sudo requires authentication.

Please investigate whether this is an approval-policy gap, an intentional consequence of escalated execution, or a regression related to #44286.

CircuitSerein avatar Nov 13 '26 13:11 CircuitSerein