Skip to content

Windows: every sandbox mode (elevated/unelevated/mxc) — sandboxed processes fail with 0xC0000142 (STATUS_DLL_INIT_FAILED); only danger-full-access works #56910

Open

Description

@shymonke

What version of Codex CLI is running?

codex-cli 0.161.0 (winget). Also reproduced with 0.164.0 via npx @openai/[email protected]. Desktop app: OpenAI.Codex 26.1007.9446.0.

What subscription do you have?

Plus

Which model were you using?

gpt-5.6-sol (irrelevant: the failure happens before any command runs)

What platform is your computer?

Microsoft Windows 11, build 10.0.26200.9711, x64

What terminal emulator and version are you using (if applicable)?

Headless via codex exec and the app-server (Ruddr); also reproduced with codex sandbox -- ... from a normal shell.

What issue are you seeing?

Under every Windows sandbox implementation, nearly all processes started inside the sandbox fail at startup with STATUS_DLL_INIT_FAILED (0xC0000142 / -1073741502). Only danger-full-access works.

Mode Result
elevated (desktop app running) helper_unknown_error: setup refresh had errors: os error 32 on the locked node_repl.exe (same as #51862)
elevated (desktop app fully quit) setup refresh passes, then timed out after 15000ms connecting runner pipe-in; the System log has an Application Popup (Event 26): codex-command-runner-0.161.0.exe - Application Error : The application was unable to start correctly (0xc0000142)
unelevated cmd.exe itself starts, but children fail: whoami.exe, findstr.exe, git.exe, powershell.exe → -1073741502. One .NET Framework exe (csc.exe -help) succeeds.
mxc identical to unelevated
danger-full-access everything works

Minimal repro (probe.cmd, run in the workspace):

@echo off
"%SystemRoot%\System32\whoami.exe" >nul & echo whoami_exit=%ERRORLEVEL%
"%SystemRoot%\System32\findstr.exe" /? >nul & echo findstr_exit=%ERRORLEVEL%
"%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\csc.exe" -help >nul & echo dotnetfx_exit=%ERRORLEVEL%
git --version & echo git_exit=%ERRORLEVEL%
> codex -c windows.sandbox=mxc sandbox -- cmd.exe /d /c probe.cmd
whoami_exit=-1073741502
findstr_exit=-1073741502
dotnetfx_exit=0
git_exit=-1073741502

Same output with -c windows.sandbox=unelevated, on 0.161.0 and 0.164.0, and from a cwd on C: as well as D:.

Ruled out:

  • AppInit_DLLs empty, LoadAppInit_DLLs=0 (native and WOW6432Node); no IFEO entries for the affected executables
  • Environment intact inside the sandbox (SystemRoot, PSModulePath present)
  • Desktop heap at defaults (SharedSection=1024,20480,768)
  • Smart App Control off (VerifiedAndReputablePolicyState=0)
  • CLI version (0.161.0 and 0.164.0 behave identically)
  • windows.sandbox_private_desktop can no longer be toggled (removed in Always use private desktops for legacy Windows sandboxes #46554), so I couldn't test whether the private desktop is involved

Possibly relevant: McAfee consumer security is running; Kaspersky/Quick Heal are registered in SecurityCenter but their AV services are not running. Not yet tested with McAfee disabled.

What steps can reproduce the bug?

  1. On the machine above, run codex -c windows.sandbox=mxc sandbox -- cmd.exe /d /c probe.cmd (or unelevated).
  2. Observe -1073741502 for most child executables.
  3. With elevated (desktop app quit so Windows: setup refresh fails (helper_unknown_error) because node_repl.exe in cua_node runtime is locked by Codex's own process (os error 32) #51862 doesn't trigger), codex sandbox -- cmd.exe /d /c echo hi fails with a runner pipe timeout, and Event 26 shows codex-command-runner crashing with 0xc0000142.

What is the expected behavior?

Sandboxed commands start normally, as they do under danger-full-access.

Additional information

Sandbox log excerpts (from %USERPROFILE%\.codex\.sandbox\sandbox.2026-10-25.log):

runtime read/execute validation failed: validate runtime read/execute access on C:\Users\<user>\AppData\Local\OpenAI\Codex\runtimes\cua_node\a9ba6825a525118c\bin\node_repl.exe: open ACL target for root-only update: The process cannot access the file because it is being used by another process. (os error 32)
setup refresh completed with errors
...
helper launch resolution: using copied command-runner path C:\Users\<user>\.codex\.sandbox-bin\codex-command-runner-0.161.0.exe

Related: #51862 (node_repl lock), #7466 / #17847 (same exit code, older versions), #29427 (0xc0000142 in setup helper).

Activity

  1. added
    bug
    CLI
    windows-os
    sandbox
    on Oct 25, 2026
  2. shymonke commented on Oct 25, 2026

    @shymonke
    Author

    Update: reproduced on codex-cli 0.164.0 (npm, sole install on PATH). Change vs 0.161.0: whoami.exe now starts under unelevated/mxc, but git.exe and powershell.exe still exit -1073741502 (0xC0000142); elevated still fails with timed out after 15000ms connecting runner pipe-in (desktop app quit). A real codex exec/app-server run with read-only gets 0xC0000142 for Get-Location and git --version; the same run with danger-full-access succeeds (git version 2.55.0.windows.3).

  3. denelon commented on Nov 5, 2026

    @denelon

    A Microsoft MXC issue documents a similar STATUS_DLL_INIT_FAILED pattern that may provide useful diagnostic context:

    Both reports observe 0xC0000142 during process startup, with cmd.exe able to run while applications such as PowerShell and Git or other USER32-importing workloads fail. The MXC issue specifically reproduces the behavior from a non-interactive session-0 host, whereas this Codex report does not establish that hosting context and also reproduces failures with non-MXC sandbox implementations. The matching status and workload pattern may therefore help distinguish a shared Windows UI/session dependency from a broader Codex or host-environment problem, but it does not establish a common root cause.

    Drafted with GitHub Copilot assistance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions