Repository navigation
Replies: 1 comment
|
结论先说:机制你描述得准确,而且我一字不差地核到了 README 与源码。但它的定性是「有意设计」,不是「未处理的缺陷」 —— 这个区别决定它会被当 bug 修还是当功能做。同时,「没有 reclaim 路径」这一半是真缺口,值得单列。 1. 一次
|
|
结论先说:机制你描述得准确,而且我一字不差地核到了 README 与源码。但它的定性是「有意设计」,不是「未处理的缺陷」 —— 这个区别决定它会被当 bug 修还是当功能做。同时,「没有 reclaim 路径」这一半是真缺口,值得单列。 1. 一次
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
When the Windows ACL sandbox provisions a workspace (workspace-write mode), it applies three standing entries to the workspace root: the workspace capability-SID grant, an
Everyonedelete-deny, and aMandatory Label\Low Mandatory Levelwith(OI)(CI)propagation. The Low integrity label inherits down the entire tree — including intobin\build output and onto the built.exeitself.Windows sets a process's integrity level from the mandatory label on its image file. So any executable built inside a DSH workspace and launched outside the sandbox (double-click, Visual Studio F5,
dotnet run) starts at Low integrity, and Mandatory Integrity Control then denies every write to normal Medium-IL locations —%TEMP%,%LOCALAPPDATA%, anywhere. The failure looks like randomUnauthorizedAccessExceptions in an unrelated app and is extremely hard to trace back to the harness.Environment
@deepseek-ai/dsh-sandbox-windows-acl0.2.0-rc.2 (via npx)net10.0-windows), built with Visual Studio 2022 inside the DSH workspaceSymptoms
System.UnauthorizedAccessException: Access to the path 'C:\Users\<user>\AppData\Local\Temp\WPF\<random>.rzf' is denied.— thrown during WPF measure, right afterwindow.Show()%LOCALAPPDATA%\<app>\(.tmpwrite + move)bin/objand rebuilding does not help (the fresh exe re-inherits the label)Everyone:(CI)(DENY)(S,DC)Evidence
Workspace root (
icacls, entries explicit, not inherited):The parent folder (one level up, outside the workspace) is clean — the trio was applied to the workspace root itself. The
S-1-4-…SID matches the deterministicworkspaceWriteSid, tying it to this workspace path.Inherited all the way onto the built image:
The
diagnose-windows-sandbox-aclskill run on the failing path returned verdictNOT_THIS_CLASS/nextAction=stop(the Temp\WPF chain is clean — correctly, since the problem is the process IL, not the target ACL). The module README itself notes the diagnostic deliberately preserves integrity labels and cannot fix Low-labeled executables affecting programs launched outside DSH — which is exactly this failure class, and there is no supported user-facing reclaim path for the workspace label (manualicaclsremoval of the capability ACE also fails withERROR_NONE_MAPPEDunless the*SIDform is used).How it happened here
An agent session was modifying files in the workspace; the harness provisioned the root on its first workspace-write command. The session was interrupted mid-stream (context full). The entries are standing by design (cached, never revoked), so they persisted — and the app, rebuilt many times since, kept inheriting the Low label.
Reproduction
icacls <workspace-root>→ observe explicitMandatory Label\Low Mandatory Level:(OI)(CI)(NW)+ capability grant +Everyonedelete-deny.dotnet build.%TEMP%/%LOCALAPPDATA%fail withUnauthorizedAccessException.Workaround used
Clean copy of the project to a non-workspace folder (copy creates fresh files with clean inheritance; rename would keep the label). Additionally hardened with a post-build event so the guard survives future provisioning:
Suggested mitigations
All reactions