Repository navigation
Replies: 1 comment
|
Your variant 6 is the one that isolates it, and the code says why that SID is there.
setTokenDefaultDaclGrant(api, restrictedToken, this.tempWriteSidPtr ?? this.writeSidPtr ?? worldSid)In Two things worth adding before this goes in as a root cause.
I read the source at |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows 10 22H2 (10.0.19044) every child process started under the
workspace-writesandbox dies in DLL initialization with0xC0000142(STATUS_DLL_INIT_FAILED) and no stdout/stderr, so every agent shell command fails.read-onlyanddanger-full-accessare unaffected.The trigger is the ACE that
setTokenDefaultDaclGrantadds to the restricted token's default DACL: when it names the derived capability SID (S-1-4-x-y) instead of a well-known SID, creating the child's image section fails the second access check. Naming the logon SID instead fixes it while keeping workspace confinement.Environment
sandbox-windows-acltoken comments record verification on Win11 26200.@deepseek-ai/dsh0.2.1-rc.3, Desktop Host (apps/desktop-host), default desktop profile.workspace-write.pwsh(PowerShell 7) is not installed; the executor falls back topowershell.exe(5.1). The failure is not specific to the target:powershell.exe,cmd.exeandwhoami.exeall die the same way.Reproduction
workspace-write).cmd /c echo hello.(no output)/[exit code: 3221225794].Evidence from the session store (
job/settledevents):"detail":"exit code: 3221225794", no stderr. Last known-good run on this machine was 2026-10-28T16:31Z under the same preset — its stderr carriedCannotCreateTypeConstrainedLanguage, i.e. the restricted token was in effect and working.Isolated cause (controlled experiments, same machine, same code)
CreateProcessW+ Job +CREATE_SUSPENDED(no sandbox)subprocess-localrunner path (IPC + fd 4/5/6)AclSandboxread-only token → powershell / cmdAclSandboxworkspace-write token (real capability SID) → powershell / cmd / whoamiS-1-5-11C:\Windows\TempSo: not the Job, not
CREATE_SUSPENDED, not stdio inheritance, not cwd, not the workspace ACE/Low label, not administrator/High-IL — it is the capability SID in the default DACL.One observation we could not explain: the same token built from a plain node process (same user, same integrity level, identical
TokenDefaultDacl, identicalTokenIntegrityLevel, zero restricting SIDs on the source token) starts children normally; only tokens built inside the Desktop Host fail. We did not isolate whether it is a token property we did not dump (owner/primary group/session/capabilities) or something about the host's process creation. The fix below works regardless, but the mechanism is not fully closed.Proposed fix (validated end to end)
packages/sandbox/sandbox-windows-acl/src/index.ts, ininit():Why this is safe:
read-only, which already grants this ACE toEveryone.Verified after the change on this machine:
cmd /c echoreturns exit 0 in aworkspace-writesession;cmd /c "echo x > C:\Users\...\Desktop\escape.txt"returns access denied and creates nothing; an in-workspace write succeeds.Questions
All reactions