[Bug] Windows: the workspace Low integrity label also lowers the user's own launches from that tree, silently degrading the toolchain inside it #7709
Replies: 2 comments
|
Adding a data point from 0.1.7-rc.1 (the What we saw
This is different from #6544: that one is Chromium started inside the confined child; here it is the user's own launch, outside DSH, and it persists after the session. Recovery that worked here The README says $root = 'C:\path\to\workspace'
$acl = (Get-Item $root).GetAccessControl('Access')
$acl.PurgeAccessRules([Security.Principal.SecurityIdentifier]'S-1-4-<x>-<y>') # the capability SID icacls shows on the root
$everyone = [Security.Principal.SecurityIdentifier]'S-1-1-0'
foreach ($r in @($acl.GetAccessRules($true, $false, [Security.Principal.SecurityIdentifier]))) {
if ($r.AccessControlType -eq 'Deny' -and $r.IdentityReference -eq $everyone) { [void]$acl.RemoveAccessRuleSpecific($r) }
}
(Get-Item $root).SetAccessControl($acl)
icacls $root /setintegritylevel '(OI)(CI)M'Afterwards Suggestion It would help to list "executables inside the workspace start at Low integrity; Chromium / Electron apps fail with 中文补充 我们在 0.1.7-rc.1 上遇到同一问题(
恢复办法见上面的 PowerShell:用 建议在已知限制里写明「工作区内的程序会以低完整性启动,Chromium / Electron 会以 |
|
Thanks for the report. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows,
workspace-writegives the workspace root an inheritable Low mandatory integrity label (README, Known Limitations: "A standing Low label outlives DSH and widens the tree for other Low-integrity processes"). That entry documents one consequence — other Low-integrity processes can now write inside the workspace.There is a second consequence it does not mention: any process the user launches from inside the labeled workspace starts at Low integrity, even when the launching shell is Medium. Once a workspace is labeled, the toolchain that lives in it (
uv,.venv\Scripts\python.exe,node, built executables) runs at Low. Because a Low token cannot write the security descriptor of an object that is not labeled Low, those tools silently lose the ability to modify anything outside the labeled tree.This is distinct from the documented cost. The documented cost is the workspace becomes writable by other Low processes. This report is about the user's own Medium-integrity launches being lowered.
Environment
@deepseek-ai/dsh-sandbox-windows-acl0.1.7-alpha.2 (the label code is byte-identical in 0.1.7-rc.1 per the hash comparison in [Bug] Windows: after upgrading to 0.1.7-rc.1 every shell command fails at the ACL grant with `SetNamedSecurityInfoW failed (Win32 5): grantWrite(<workspace>)` / 升级到 0.1.7 后所有 shell 命令在沙箱授权阶段立即失败(粘性,需手工修 ACL) #7646)Minimal reproduction (no DSH required)
Same shell, same parent process, same working directory. The only difference is that the copied image file carries the Low label while the System32 original does not.
Observed:
C:\Windows\System32\whoami.exeS-1-16-8192)C:\probe\whoami_probe.exe(copy)S-1-16-4096)S-1-16-4096)The same effect on a real workspace: a shell reports Medium, but
uv run python— whose interpreter lives under the workspace tree — reports Low, while a system-wide interpreter in an unlabeled location reports Medium. A livewhoami(not a library call) was used for every measurement.Mechanism: the image file's mandatory integrity label appears to participate in the new process's integrity level at creation time. I am stating that as the likely cause from the observations above; I have not verified it against Microsoft documentation.
Why this matters
%LOCALAPPDATA%, provisioning, ACL edits) start failing withAccess is deniedfar from the original cause.icacls <dir> /setintegritylevel Mediumfrom the lowered process is denied (this matches the "self-healing" probe in Windows: workspace-write sandbox fails with SetNamedSecurityInfoW Win32 5 when the workspace directory DACL lacks WRITE_OWNER #7504, which found the same denial from inside the confined child).ERROR_ACCESS_DENIED (Win32 5)— the same signature reported in Windows: workspace-write sandbox fails with SetNamedSecurityInfoW Win32 5 when the workspace directory DACL lacks WRITE_OWNER #7504 / [BUG REPORT] Windows 沙箱无法在用户自建目录上 provision 工作区 ACE → 该目录下所有 shell 命令失败 #7538 / [Bug] Windows: `windows-acl` rung is auto-selected without a probe, but its host-side write grant always fails without SeSecurityPrivilege #7622 / [Bug] Windows: after upgrading to 0.1.7-rc.1 every shell command fails at the ACL grant with `SetNamedSecurityInfoW failed (Win32 5): grantWrite(<workspace>)` / 升级到 0.1.7 后所有 shell 命令在沙箱授权阶段立即失败(粘性,需手工修 ACL) #7646, but reached by a different route. (In my case this was a third-party tool reusing this package's grant primitives; the mechanism is the one above.)Relationship to the existing report #7504
#7504 identifies the gate for first-time provisioning as
WRITE_OWNERon the directory, and documents the one-timeicacls <dir> /grant "<user>:(OI)(CI)(WO)"workaround. That analysis is about a Medium-integrity host. The failure mode here is different: the host itself is Low because it was launched from a labeled tree, so no amount of DACL work on the target directory helps — the caller cannot write the SACL at all.Open questions
OI|CIinheritance onto executables, so the tree stays writable by the confined child but images inside it do not get lowered? (OIis needed for files created later; I do not know whether a narrower combination is viable.)中文要点
Windows 的
workspace-write会给工作区根打上可继承的 Low 完整性标签。README 的 Known Limitations 只说明了一个后果:其他 Low 完整性进程因此能写入工作区。本文报告另一个未记录的后果:用户在工作区里直接启动的任何进程都会变成 Low,即使父 shell 是 Medium。工作区里的工具链(
uv、.venv的 python、node、编译产物)全部降级;而 Low 令牌改不了未标 Low 对象的安全描述符,于是这些工具无法再修改工作区外的任何东西,且无法自行恢复(改写标签会被拒)。最小复现不需要 DSH:把 System32 的
whoami.exe复制到一个标了 Low 的目录,同一 shell 下原件报 Medium、副本报 Low。与 #7504 的区别:#7504 讨论的是 Medium 宿主首次 provision 缺
WRITE_OWNER;这里宿主本身就是 Low(因为它从被标 Low 的目录启动),改目标目录的 DACL 无济于事。All reactions