Repository navigation
Upstream report : workspace-write makes every confined command exit 0xC0000142 #10483
Replies: 1 comment
|
Reproduces on DSH Desktop 0.2.1-rc.2 (Windows x64), default Every
A nonexistent This build appears to predate the Electron console trampoline fix (a1caef3,
Consistent with that, the failure is a bare child exit OS: Windows 10 19045.6466. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On the Windows desktop build, when the file policy is
workspace-write, every command executed throughthe sandbox is terminated during DLL initialization with exit code
0xC0000142(
STATUS_DLL_INIT_FAILED), producing no output at all.I isolated the failure out of DSH entirely and reproduced it 1:1 with raw P/Invoke:
In other words: the root cause is that the
WRITE_RESTRICTEDtoken's restricting SID list lacks a SID thatcarries write access to some resource the process needs during initialization. It is unrelated to
windowsHide,to console inheritance, or to the target program. The failure also hits a minimal, IO-free executable, so it
is on the generic initialization path.
Reproduction
A. Inside DSH
workspace-write.pwshtool, e.g.echo ok.3221225794(0xC0000142).The result is identical whether DSH was launched from the desktop GUI or from a PowerShell terminal.
B. Minimal reproduction, without DSH (best for root-causing)
A single self-contained file reproduces it.
csc repro.cs, then pass the restricting SIDs as one comma-separated argument(the logon SID comes from
whoami /logonid):Observed on the affected host (
<logon>fromwhoami /logonid):Dropping
WRITE_RESTRICTEDfrom the flags makes every combination exit7, which is why the flag — not the SID valuesalone — is the switch this report is about.
Current behavior
The target process is created (a PID is returned) but dies during DLL initialization, always with
0xC0000142, and emits no output.Matrix:
WRITE_RESTRICTED+ Low integrity +cmd.exe /c exit 7(key evidence):[](empty)0xC0000142[Everyone]0xC0000142[Users]0xC0000142[Authenticated Users]0xC0000142[Everyone, user SID]0xC0000142[Administrators]alone0xC0000142[Users, Administrators]0xC0000142[Everyone, logon SID](≈ currentworkspace-write)0xC0000142exit 7exit 7exit 7;powershell.exealso ✅exit 9exit 7Hypotheses already ruled out, each with a controlled test:
windowsHide/CREATE_NO_WINDOWdwCreationFlags = 0 or 4and never sets that flag; I also patchedwindowsHideinlaunchWindowsJoband tested it in the real buildAppInit_DLLsinjectionAppInit_DLLsempty,LoadAppInit_DLLs=0, noAppCertDllsWRITE_RESTRICTED, Low integrity spawns fine (exit 7)Mainonly returns42) also dies with0xC0000142Expected behavior
Confined child processes should start and run normally under
workspace-write— the documented promise ofworkspace-writeis a write boundary, not "processes cannot initialize".Even if initialization genuinely cannot succeed in some environments, I would expect a diagnosable error
(e.g. classify
0xC0000142as a sandbox startup failure with guidance) rather than no output plus a bare exitcode. The current shape makes users misattribute the failure to the target program or to their own command.
Environment
D:\Program Files\dsh\version)@deepseek-ai/dsh-sandbox-windows-acl0.2.1-rc.2,@deepseek-ai/dsh-subprocess-local0.2.1-rc.2FSGDZ0067\Administrator; token holdsSeImpersonatePrivilege, does not holdSeAssignPrimaryTokenPrivilegeQAXClientSvc/QaxEngManager/TQDefender, all running) and TEC OCular (C:\ProgramData\Ocular)danger-full-access→pwshworks;workspace-write→ always0xC0000142One hypothesis, and questions
This machine runs enterprise endpoint-security agents. My hypothesis is that during process initialization they
need write access to a resource of their own that is granted only to SYSTEM / Administrators, and the
workspace-writerestricting list does not carry that authority — so initialization fails.I would appreciate guidance on:
WRITE_RESTRICTEDtokens?instead of adding
Administrators/SYSTEMwholesale to the restricting list (which would materiallyweaken the write boundary)?
WRITE_RESTRICTEDfor a diagnostic run)?
I have not yet captured the exact
ACCESS DENIEDtarget with Process Monitor. I can do that and follow up hereif it would help.
Additional forensics: what was ruled out, and what remains unknown
I tried to capture the exact denied object. Summary of the attempts:
/AcceptEula /Quiet /BackingFile:...)Microsoft-Windows-Kernel-Registry0xC0000022) for other processes — but there are zero denials for the failing child. Its registry writes (SetValueKeyinto the BAM/AppCompat keys) all succeed. ⇒ not a registry write.Microsoft-Windows-Kernel-File0xC0000022anywhere in 55k events).\Device\CNG,\Device\Null,\Device\KsecDD,\Device\Beep:GENERIC_READandGENERIC_WRITEsucceed for both tokens; onlyGENERIC_ALLdiffers. ⇒ CNG is not the blocker.0,CREATE_NEW_CONSOLE,CREATE_NO_WINDOWall fail identically;CREATE_SUSPENDEDstays alive until resumed. ⇒ console allocation is not the discriminator.auditpol /resourceSACL)ERROR_INVALID_PARAMETER), so file-level failure auditing could not be enabled.Behavioural narrowing (ETW
Kernel-Fileevent counts): the failing child emits 40 file events and stops immediately after touchingC:\WINDOWS\System32\Conhost.exe, while a succeeding child emits 318. The failing child also reads...\qianxin\ifl\fcEng\QaxComInj\Avoid.txt, i.e. QI-ANXIN's kernel injection driver (QaxComInj64.sys) is active inside the process.Still not pinned down: the exact object. The blocker is the same endpoint-security stack that is itself the prime suspect —
it prevents the kernel-mode tracing that would name the object.
What would close it
Any of the following would let me (or you) name the object in one run:
0xC0000142(e.g. run the child under a controlled
CreateProcesswith a debugger-attached "last chance" handler,or simply log
GetLastErrorfrom the sandbox runner's own setup steps).I can test that specific object with both tokens and confirm in minutes.
(our IT must approve; this is the only remaining way to prove agent involvement on this host).
All reactions