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
[Bug] Windows ACL sandbox: MSYS binaries die at NtCreateDirectoryObject(\BaseNamedObjects\...) with 0xC0000022 — git push misreports it as a remote error
#11523
Follow-up to #8209 (and #7877, #1613, #8485, #9195). Those threads establish that MSYS/Cygwin binaries cannot initialise under workspace-write and that the native Windows OpenSSH is the workaround. This adds the exact failing API and the object involved, which pins down why a native named-pipe server succeeds while MSYS dies — the open question in #8209 — and records that the current release still ships no denial signature for it.
Environment
DSH desktop 0.2.0-rc.2, Windows 11 x64, workspace-write confinement
Git for Windows 2.55.0.windows.3, install path C:\Program Files\Git
Measured 2026-10-30
Reproduction
PS> git ls-remote origin
0 [main] ssh (11916) C:\Program Files\Git\usr\bin\ssh.exe: *** fatal error -
NtCreateDirectoryObject(\BaseNamedObjects\msys-2.0S5-1888ae32e00d56aa): 0xC0000022
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
(The msys-2.0S5-<hash> suffix is per boot; git push produces the same output, and git -c core.sshCommand=... changes nothing because git reaches the transport through the same MSYS binary.)
What is actually denied
The failing call is not a named pipe. MSYS initialises by creating a directory object plus shared-memory sections under \BaseNamedObjects, i.e. inside the object-manager namespace. Creating an entry under that existing container is gated by the container's own DACL; the restricted token's second (restricting-SID) pass needs an ACE there, and none of the workspace/temp capability SIDs holds one, so NtCreateDirectoryObject fails with STATUS_ACCESS_DENIED.
That is consistent with the asymmetry reported in #8209 — a native System.IO.Pipes.NamedPipeServerStream starts fine under the same confinement while MSYS cannot. Pipes live on the \Device\NamedPipe device path; MSYS needs \BaseNamedObjects, which is a different object and a different access check.
setTokenDefaultDaclGrant cannot help here, and this matches what packages/sandbox/sandbox-windows-acl/src/token.ts on master documents: it merges an ACE into the token's default DACL, i.e. the descriptor that new objects receive. Permission to create under an existing container is not part of that.
Why it costs time to diagnose
The sandbox is never named in the output; the failure surfaces as fatal: Could not read from remote repository, i.e. it reads as an auth/remote problem. The natural first moves (re-auth, re-issue token, check the remote URL) all waste time.
It disables every MSYS binary shipped with Git for Windows (sh, scp, tar, bundled ssh), which tool-using agents reach for routinely — not just git push.
Verified workaround
Point git at the native OpenSSH with a bare path, so git execs it directly and never loads an MSYS binary:
git config core.sshCommand 'C:/Windows/System32/OpenSSH/ssh.exe'# bare path: no spaces, no shell
git remote set-url origin git@github.com:<owner>/<repo>.git
Measured inside the confined session, no escalation:
Same conclusion as #8209; this run confirms it still holds on 0.2.0-rc.2 desktop.
Suggested fixes, cheapest first
Add a denial signature for this output (NtCreateDirectoryObject / msys-2.0 / couldn't create signal pipe) so the tool layer can render something like "the sandbox blocked an MSYS runtime initialisation — use the native Windows OpenSSH (core.sshCommand)" instead of propagating a git error. As of master and the shipped 0.2.0-rc.2 packages I could not find such a signature (searching the installed packages for BaseNamedObjects / msys-2.0 / NtCreateDirectoryObject returns nothing).
One line in the sandbox README's Known Limitations, next to "Console isolation is unavailable" and "Piped stdio capture is impossible for confined grandchildren": MSYS/Cygwin binaries cannot initialise under the restricted token; the failure is 0xC0000022 on a \BaseNamedObjects creation.
Granting a capability SID CREATE on the per-session \BaseNamedObjects would "fix" it functionally, but that namespace is machine-wide, so the permission would apply to every confined child and every name in it. I assume that is a deliberate boundary rather than an oversight; documentation plus the signature is likely the right end state, unless an allowlist for the msys-* name prefix is considered acceptable.
Happy to test a signature PR or provide more measurements.
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.
Follow-up to #8209 (and #7877, #1613, #8485, #9195). Those threads establish that MSYS/Cygwin binaries cannot initialise under
workspace-writeand that the native Windows OpenSSH is the workaround. This adds the exact failing API and the object involved, which pins down why a native named-pipe server succeeds while MSYS dies — the open question in #8209 — and records that the current release still ships no denial signature for it.Environment
workspace-writeconfinement@deepseek-ai/dsh-sandbox-windows-acl0.2.0-rc.2C:\Program Files\GitReproduction
(The
msys-2.0S5-<hash>suffix is per boot;git pushproduces the same output, andgit -c core.sshCommand=...changes nothing because git reaches the transport through the same MSYS binary.)What is actually denied
The failing call is not a named pipe. MSYS initialises by creating a directory object plus shared-memory sections under
\BaseNamedObjects, i.e. inside the object-manager namespace. Creating an entry under that existing container is gated by the container's own DACL; the restricted token's second (restricting-SID) pass needs an ACE there, and none of the workspace/temp capability SIDs holds one, soNtCreateDirectoryObjectfails withSTATUS_ACCESS_DENIED.That is consistent with the asymmetry reported in #8209 — a native
System.IO.Pipes.NamedPipeServerStreamstarts fine under the same confinement while MSYS cannot. Pipes live on the\Device\NamedPipedevice path; MSYS needs\BaseNamedObjects, which is a different object and a different access check.setTokenDefaultDaclGrantcannot help here, and this matches whatpackages/sandbox/sandbox-windows-acl/src/token.tson master documents: it merges an ACE into the token's default DACL, i.e. the descriptor that new objects receive. Permission to create under an existing container is not part of that.Why it costs time to diagnose
fatal: Could not read from remote repository, i.e. it reads as an auth/remote problem. The natural first moves (re-auth, re-issue token, check the remote URL) all waste time.sh,scp,tar, bundledssh), which tool-using agents reach for routinely — not justgit push.Verified workaround
Point git at the native OpenSSH with a bare path, so git execs it directly and never loads an MSYS binary:
Measured inside the confined session, no escalation:
Same conclusion as #8209; this run confirms it still holds on 0.2.0-rc.2 desktop.
Suggested fixes, cheapest first
NtCreateDirectoryObject/msys-2.0/couldn't create signal pipe) so the tool layer can render something like "the sandbox blocked an MSYS runtime initialisation — use the native Windows OpenSSH (core.sshCommand)" instead of propagating a git error. As of master and the shipped 0.2.0-rc.2 packages I could not find such a signature (searching the installed packages forBaseNamedObjects/msys-2.0/NtCreateDirectoryObjectreturns nothing).0xC0000022on a\BaseNamedObjectscreation.CREATEon the per-session\BaseNamedObjectswould "fix" it functionally, but that namespace is machine-wide, so the permission would apply to every confined child and every name in it. I assume that is a deliberate boundary rather than an oversight; documentation plus the signature is likely the right end state, unless an allowlist for themsys-*name prefix is considered acceptable.Happy to test a signature PR or provide more measurements.
中文要点:这次抓到了具体的失败 API —— 不是命名管道,而是
NtCreateDirectoryObject(\BaseNamedObjects\msys-2.0S5-…)返回0xC0000022。MSYS 启动要在对象管理器命名空间里建目录对象,该容器的 DACL 不含任何 restricting SID,第二遍校验必然失败;所以「原生命名管道能开、MSYS 不行」是正常的(前者在\Device\NamedPipe,后者在\BaseNamedObjects)。setTokenDefaultDaclGrant改的是新建对象的默认 DACL,管不到「在已存在容器里创建」。core.sshCommand指原生 OpenSSH 的绕法在 0.2.0-rc.2 上仍有效(实测ls-remote、push --dry-run、真实push均通过,无需提权)。建议:加一条 failure signature + README 一行限制;是否放开\BaseNamedObjects的创建权限属于安全边界取舍,我理解那是刻意的。All reactions