Repository navigation
Replies: 2 comments 1 reply
|
Your mechanism-level reproduction lands on a producer a published advisor already names, so there is a tested description of this shape to cite — your report stands on its own, but the family is already written down.
Two source anchors that answer your closing question, and your suggested option 3 in particular — why this arrives as an opaque
The same producer has a longer mechanism write-up in #9238, whose author measured the launcher matrix. |
Thanks — this names exactly what the report was missing, and both anchors check out against the shipped
Acting on the second measured remedy: the shim now saves the runner's three standard handles, calls Published as v0.1.1: https://github.com/TJZF-4j97/dsh-sandbox-console-fix/releases/tag/v0.1.1 I have not verified configuration (b), 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.
TL;DR
On the packaged Windows desktop app any shell call under
workspace-writefails instantly with0xC0000142(STATUS_DLL_INIT_FAILED).read-onlyanddanger-full-accessare fine.pwsh,cmdand
powershellall fail the same way.Cause:
dsh-sandbox-localspawns the Windows ACL sandbox runner withprocess.execPath, which inthe packaged app is the Electron binary — a GUI-subsystem image with no console. The ACL runner
spawns the confined child with no console-isolation flag on purpose, expecting the child to inherit
the runner's console; with nothing to inherit, the console-subsystem child must create one, which fails
in
workspace-write. Giving the runner a console fixes it in both modes, and the confinement isunaffected.
Environment
0.2.0-rc.2(DeepSeek Harness.exe, Electron 44.0.0 / Node 24.18.1)pwsh 7.6.6(MSI), Store-packagedpwsh 7.6.6,powershell.exe 5.1,cmd.exeReproduction
Shortest mechanism-level reproduction (no Harness needed, ACL runner extracted to real files):
Failure matrix (shipped ACL runner + restricted token, child
pwsh 7.6.6)node.exe7✅node.exe7✅7✅3221225794❌7✅Measured with koffi from the same parent process:
node.exe→GetConsoleWindow() != 0;DeepSeek Harness.exe→GetConsoleWindow() == 0. A GUI-subsystem child of a console-owning parentstill gets no console, and
CREATE_NEW_CONSOLEdoes not give it one — so "launch the app from aterminal" is not a workaround.
Ruled out by direct test: shell choice, workspace/temp path (ASCII, spaces, CJK,
%TEMP%), therunner's working directory,
TMP/TEMPvalues, private-temp bookkeeping (agentless vs seam-managed),the fd-7 control channel,
windowsHide, host creation flags, and thediagnose-windows-sandbox-aclverdict for thepwshinstall path (NOT_THIS_CLASS, 0 repairs).Root cause
packages/sandbox/sandbox-local/src/index.ts→windowsAclRunnerInvocation()(
@deepseek-ai/dsh-sandbox-local/lib/index.js:539-543):The package documentation already states the two halves of the rule
("children share the host console", and
CREATE_NO_WINDOW/CREATE_NEW_CONSOLEchildren die duringDLL initialization under the restricted token) — but on the packaged desktop app the host has no
console to share, so the premise does not hold.
Is this a security problem?
No — it fails closed: the confined child never starts, and with a console supplied the confinement is
intact. Escape-write probe from inside the confined child (
workspace-write, Electron host, runner givena console):
The impact is availability: on Windows desktop the
workspace-writesandbox cannot run shell commandsat all, so the practical choice is
danger-full-access, which removes confinement entirely.Suggested fix
AllocConsole()in the Windows ACL runnerbefore it creates the restricted token (smallest change; keeps the
[execPath, runner.js]contractand every confinement decision).
SANDBOX_UNAVAILABLE/ a clear diagnosticinstead of letting the child die with
0xC0000142.Workaround available
A
dsh-plugin-tagged bundle implements option 1 without patching anything — it subclassesLocalSandboxProviderand inserts--import <console-shim>in front of the runner entry (the sameargument shape the Harness's own development runner path already uses):
https://github.com/TJZF-4j97/dsh-sandbox-console-fix (topic:
dsh-plugin)Verified end-to-end on the packaged Windows desktop app (
0.2.0-rc.2): with the bundle installed throughthe Harness's own installer, a
workspace-writeshell call returnspwsh 7.6.6instead of0xC0000142,while writes outside the workspace are still denied. Evidence:
https://github.com/TJZF-4j97/dsh-bug-windows-sandbox-console
Verification record: https://github.com/TJZF-4j97/dsh-bug-windows-sandbox-console
Question
Is a host console an intended requirement of the Windows ACL runner? If yes, it would be worth stating
that the desktop app needs one (and how), because today the failure surfaces as an opaque
0xC0000142deep inside the sandbox seam.All reactions