Repository navigation
Replies: 1 comment
|
Your carrier table is the right instrument, and it matches a boundary this backend already documents: 1. Why it surfaces as a bare exit code instead of a sandbox failure. The runtime path is:
So your second suggestion is structurally right and cheap to state: this is one missing rule, not one missing sentence. The runner did not fail — the restricted child died before 2. If it helps you confirm which producer you are in: a runner-side failure prints a For visibility, the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Bug report: Windows desktop shell commands fail with 0xC0000142 under workspace-write
Upstream report for DeepSeek Harness (Windows desktop / Electron host).
Everything below was reproduced on the reporter's machine; the upstream
reviewer has confirmed the direction and supplied the two implementation notes
in §5 and §6.
1. Summary
Under the default
workspace-writepermission, every shell command on theWindows desktop app exits immediately with
3221225794(0xC0000142,STATUS_DLL_INIT_FAILED). File tools (read/write/edit/glob/grep) keep working — only the shell is affected.Nothing in the command matters:
cmd.exe,powershell.exe,python.exeallfail identically, including
cmd.exe /c echo hello. Installing PowerShell 7does not help.
The practical consequence is severe: the only way to get a working shell is to
switch the session to
danger-full-access, which gives up all fileisolation. This forces every Windows desktop user to choose between "no shell"
and "no sandbox".
2. Reproduction
workspace-write(the default for a new session).pwshtool:Also reproduces with
cmd.exe /c echo hello, and with Python.3. Root cause (two axes, one signature)
3.1 The signature is not self-diagnosing
0xC0000142is shared by at least two distinct producers:createRestrictedTokenrequires a keep-alivegroup (logon SID + EVERYONE) precisely because a token without it dies
during DLL initialization with the identical code;
restricted child can inherit a console but can never create one; creating
one (
CREATE_NO_WINDOW/CREATE_NEW_CONSOLE) under the restriction is thedocumented death path.
So
0xC0000142alone cannot name the cause. Two discriminators are needed, andboth are cheap:
3.2 Discriminator 1 — the mode split (narrows it to the token side)
read-onlyworkspace-write0xC0000142— child diesread-onlyis alive andworkspace-writeis dead. The difference between thetwo is the restricting list plus the token default DACL, so this narrows the
fault to the token side.
3.3 Discriminator 2 — the carrier (the second independent prerequisite)
Same runner, same arguments, same workspace, only the carrier process differs:
workspace-writenode.exeDeepSeek Harness.exe(Electron)0xC0000142This is the axis that determines whether the console can be inherited at all,
and it is independent of 3.2. Both axes must hold for the shell to work.
3.4 The culprit
On Windows the desktop host spawns the sandbox runner with
process.execPath,which is
DeepSeek Harness.exe— the Electron GUI binary. It is aGUI-subsystem process with no console, so the
WRITE_RESTRICTEDchild itcreates has no console to inherit and cannot create one. The backend's own
documented boundary ("children created with CREATE_NO_WINDOW / CREATE_NEW_CONSOLE
die with STATUS_DLL_INIT_FAILED under the restriction") is reached here
through the carrier, not through a creation flag — which is why removing
the flags does not help.
3.5 Producer confirmation (no rebuild needed)
The reporter's recorded capture distinguishes the two producers with a single
check, exactly as the reviewer suggested:
windows-acl-run:on stderrbefore the child is created;
exit=0xC0000142, stdout empty, stderr empty, nowindows-acl-run:line.The line's absence alongside
0xC0000142places the death inside therestricted child, before
main()— the runner itself never failed.4. Impact
danger-full-access, losing isolation silently.5. Why this surfaces as a bare exit code — one missing rule
The reviewer's implementation notes, reproduced here for the record.
sandbox-local's windows-acl runner-failure rule is:and
sandbox's match loop continues onallowedExitCodesbefore it everlooks at stderr. So:
0xC0000142is not127, andwhich means it can never become a
RunnerFailureMatch→ noSandboxUnavailableError→tool-pwshthen reports it as an ordinary non-zeroexit ("non-zero exits are reported, not errored").
This is one missing classification rule, not one missing error message. The
runner did not fail — the restricted child died before
main()— and the ruletable has no entry for "the restricted child never started". A rule covering
that case would turn this from a silent bare exit code into a diagnosable
sandbox failure. That is the single highest-value change in this report, and
it is what would have made this bug findable without the carrier table.
6. Suggested fixes
6.1 Durable fix (upstream)
Carry the Windows sandbox runner with
node.exerather thanprocess.execPath. The reviewer confirmed the Electron-vs-node carrierdistinction is a real prerequisite, so this is a mitigation that addresses the
cause rather than working around a misdiagnosis.
6.2 Diagnostic fix (upstream, independent)
Add the classification rule from §5 so "the restricted child died before
main()" is reported as a sandbox failure instead of a bare exit code. This isworth doing regardless of 6.1 — it is what makes the next occurrence of this
class cheap to diagnose.
6.3 Local mitigation (what the reporter shipped)
Until the above lands, the reporter is using the
runnerCommandhook to carrythe genuine runner via
node.exe; the write boundary is unchanged andenforcementstill reportsfull. The local mitigation is not a substitutefor 6.1/6.2, and should not be treated as making them optional.
7. Local verification of the mitigation
Verified in the reporter's own harness (not just by direct invocation):
workspace-write: PowerShell runsworkspace-write: write outside the workspaceread-only: write inside the workspaceA separate observation, worth noting because it bounds the reproduction: from
inside the sandbox, spawning any executable outside the granted roots
returns
EPERM. The sandbox is therefore unable to re-spawn the originalbroken carrier from within a confined session — any reproduction of the failure
must run unconstrained, or go through the host's own tool.
8. Environment
dsh-sandbox-windows-acl0.2.0-rc.2(irrelevant to the fault —
cmd.exefails identically)9. Reporter's note
For completeness: a third-party diagnostic plugin
(
@argszero/cordis-plugin-sandbox-grant-advisor, 0.20.0) was pointed out asalready classifying this signature. It has not been installed — the
reviewer described it as a diagnosis aid only, and it does not replace the
upstream fixes in §6.
All reactions