You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows 10: every sandboxed command fails with 0xC0000142 (workspace-write)
#11214
Symptom
Every command executed through the sandboxed shell tools exits with
3221225794 (0xC0000142, STATUS_DLL_INIT_FAILED) and produces no output —
pwsh, cmd.exe, anything. read-only mode works, and the same source tree
works when the host process is node.exe.
Root cause
AclSandbox.init() merges one full-access ACE into the restricted token's
default DACL — the DACL every new object the confined child creates inherits —
for a capability SID (the private temp write SID, else the workspace write SID).
A restricted token's access check runs twice: pass 1 with the token's ordinary
groups, pass 2 with the restricting SIDs only. A capability SID exists only in
the restricting list, so pass 1 never matches that ACE: every object the child
creates is unreachable to the child's own identity, and object creation that
Windows performs on the process's behalf fails before the process runs.
That object is a console whenever the spawning process owns none. The
packaged desktop app builds the runner argv from process.execPath, so the
confined child's parent is the Electron binary — GUI subsystem, no console —
and every child therefore needs a new console, which the broken default DACL
prevents.
Fix
Name the logon SID in the default DACL instead. It is a restricting SID
and stays in the token's ordinary group list, so both access checks can
satisfy it. It is narrower than read-only's world SID.
Reproduced with the packaged module under an Electron parent: 0xC0000142
before, 0 after.
Reproduced with the real sandbox-local provider plus subprocess-local
runtime from source: both modes return 0.
Confinement unchanged: a write inside the workspace succeeds; a write outside
is denied (Access is denied., exit 1).
tsc -b tsconfig.host.json, translation pairing, and the package README
verifiers pass.
Why CI does not catch it
Every test host is console-subsystem (node.exe, vitest workers), so confined
children inherit a console and never exercise the failing path. Only a
GUI-subsystem spawner — the packaged desktop host — forces console creation.
Secondary gap
The Windows chain is a sole rung selected without a probe, so a broken confined
spawn surfaces as a bare NTSTATUS exit code instead of SANDBOX_UNAVAILABLE.
Worth a separate change.
After the DACL fix: HTTPS through Schannel still fails
Fixing process startup does not restore networking. Clients that delegate TLS to
Windows SSPI still fail inside the sandbox, because the low-integrity restricted
token cannot acquire the credentials Schannel asks for. Reproduced on the same
host, read-only mode:
So the boundary is narrower than "processes run again": anything that hands TLS
to Schannel or SSPI — the system curl, PowerShell's Invoke-WebRequest, a
default Git — cannot reach HTTPS from inside the sandbox. Clients that carry
their own TLS stack (Node, Python, Git with the OpenSSL backend) work, because
they only read the public CA store.
Which token property blocks credential acquisition is untested; changing the
integrity level and the restricting list one at a time would settle it.
Workarounds: git config http.sslBackend openssl; a curl build linked against
OpenSSL; or run the Schannel clients unconfined.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Windows 10: every sandboxed command fails with 0xC0000142 in workspace-write
Environment
Windows 10 22H2 (build 19045), x64
DeepSeek Harness desktop 0.2.1-rc.3
Permission preset: workspace-write
Symptom
Every command executed through the sandboxed shell tools exits with
3221225794 (0xC0000142, STATUS_DLL_INIT_FAILED) and produces no output —
pwsh, cmd.exe, anything. read-only mode works, and the same source tree
works when the host process is node.exe.
Root cause
AclSandbox.init() merges one full-access ACE into the restricted token's
default DACL — the DACL every new object the confined child creates inherits —
for a capability SID (the private temp write SID, else the workspace write SID).
A restricted token's access check runs twice: pass 1 with the token's ordinary
groups, pass 2 with the restricting SIDs only. A capability SID exists only in
the restricting list, so pass 1 never matches that ACE: every object the child
creates is unreachable to the child's own identity, and object creation that
Windows performs on the process's behalf fails before the process runs.
That object is a console whenever the spawning process owns none. The
packaged desktop app builds the runner argv from process.execPath, so the
confined child's parent is the Electron binary — GUI subsystem, no console —
and every child therefore needs a new console, which the broken default DACL
prevents.
Fix
Name the logon SID in the default DACL instead. It is a restricting SID
and stays in the token's ordinary group list, so both access checks can
satisfy it. It is narrower than read-only's world SID.
A regression test pins the trustee to the SID findLogonSid copies out. It
fails against the previous trustee and passes after the change.
Branch with the full change (code + test + bilingual README note):
https://github.com/wanniba200-png/deepseek-harness/tree/fix/win10-sandbox-default-dacl
Verification
Reproduced with the packaged module under an Electron parent: 0xC0000142
before, 0 after.
Reproduced with the real sandbox-local provider plus subprocess-local
runtime from source: both modes return 0.
Confinement unchanged: a write inside the workspace succeeds; a write outside
is denied (Access is denied., exit 1).
tsc -b tsconfig.host.json, translation pairing, and the package README
verifiers pass.
Why CI does not catch it
Every test host is console-subsystem (node.exe, vitest workers), so confined
children inherit a console and never exercise the failing path. Only a
GUI-subsystem spawner — the packaged desktop host — forces console creation.
Secondary gap
The Windows chain is a sole rung selected without a probe, so a broken confined
spawn surfaces as a bare NTSTATUS exit code instead of SANDBOX_UNAVAILABLE.
Worth a separate change.
After the DACL fix: HTTPS through Schannel still fails
Fixing process startup does not restore networking. Clients that delegate TLS to
Windows SSPI still fail inside the sandbox, because the low-integrity restricted
token cannot acquire the credentials Schannel asks for. Reproduced on the same
host, read-only mode:
curl.exe(Schannel)schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030E)node -e "fetch(...)"(OpenSSL)git ls-remote(default Schannel)SEC_E_NO_CREDENTIALSgit -c http.sslBackend=openssl ls-remoteSo the boundary is narrower than "processes run again": anything that hands TLS
to Schannel or SSPI — the system
curl, PowerShell'sInvoke-WebRequest, adefault Git — cannot reach HTTPS from inside the sandbox. Clients that carry
their own TLS stack (Node, Python, Git with the OpenSSL backend) work, because
they only read the public CA store.
Which token property blocks credential acquisition is untested; changing the
integrity level and the restricting list one at a time would settle it.
Workarounds:
git config http.sslBackend openssl; a curl build linked againstOpenSSL; or run the Schannel clients unconfined.
All reactions