Repository navigation
Replies: 1 comment
|
This is the label half of the same shape, measured on its own — and your experiment is the decisive form of it, which is why it is worth separating from the sibling report rather than folding into it. Why your reading is the right one. Your distinction is exactly the one that matters: Windows propagates DACL changes into existing children, and does not back-fill a newly added SACL label onto children that already exist. That is why the root is writable, a directory created afterwards is writable, and every pre-existing child is denied — and it is the same conclusion a sibling report reached on a Why it is permanent, from the source. The label goes out in the same single Your token experiment is the strongest evidence in the thread. Low-integrity only and Low + On the bundled skill. Your finding matches the report in the sibling thread: Shipped form. - insert:
- id: sandbox-grant-advisor
name: '@argszero/cordis-plugin-sandbox-grant-advisor'On your suggested fixes: (1) recursive label application at provision time is the direct answer to this cell, and (2) the "existing, partially labelled workspace" detection is what turns a silent half-provisioned tree into a decision the user can make — both are core changes, and the plugin is the stopgap that tells the model what it is looking at in the meantime. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
The Windows ACL sandbox backend writes its Low mandatory integrity label onto the workspace root only, and relies on inheritance to cover the tree. Windows propagates DACL changes to existing child objects, but it does not back-fill a newly added SACL label onto children that already exist.
Consequence: in a workspace that already contained directories and files before the label was written, every pre-existing directory and file stays unwritable to confined processes, while the root itself and anything created afterwards are writable. On the reporter's machine that is ~124,600 directories and ~925,000 files.
This originates from the same change as #8412 (
d5ad3baeb5, "fix(sandbox): confine Windows deletes with a Low integrity label", first shipped indsh-v0.1.7-alpha.1), but it is a different failure mode:%TEMP%/%LOCALAPPDATA%.Environment
DeepSeek Harness.exefile version 0.2.0-rc.2, nightly channelDSH_HOMEon a non-system volume; profiledesktopworkspace-write, approvalaskSymptom
Under
workspace-write, a confined child process (pwsh) cannot create or delete files anywhere in a pre-existing subdirectory of the workspace, while reads / listing / stat all work:write/edittools)danger-full-accessRoot cause
grantWrite()in@deepseek-ai/dsh-sandbox-windows-aclwrites three things onto the workspace root:S-1-4-<sha256(canonicalPath)-derived>) — DACLEveryoneFILE_DELETE_CHILDDeny — DACLS-1-16-4096,MandatoryPolicy = NO_WRITE_UP) — SACLgrantWrite()is invoked once, on the workspace root, and relies on inheritance to cover the tree. DACL entries are inherited by existing children; the SACL label is not. So:Measured:
The confined child is created with its token lowered to Low integrity (
restrictTokenIntegrity();CreateRestrictedTokenflags = 13 =DISABLE_MAX_PRIVILEGE | LUA_TOKEN | WRITE_RESTRICTED).Decisive experiment
Using a self-built token that reproduces DSH's exact combination:
WRITE_RESTRICTEDThe only variable that differs between the two targets is the integrity label ⇒ the label, not the DACL, is what blocks the write.
This is a regression relative to 0.1.5 (consistent with the upstream history in #8412)
A 0.1.5 runtime is still present on the reporter's machine:
...\app-0.1.5-rc.1\node_modules\@deepseek-ai\dsh-sandbox-windows-acl, version0.1.5-rc.1(3 files)S-1-16-4096|buildLowLabel|lowLabel|LowLabel|LABEL_SECURITY_INFORMATION→ zero matches0.1.5-rc.1predatesdsh-v0.1.7-alpha.1, the first release containingd5ad3baeb5— matching the upstream history quoted in #8412. The older sandbox only wrote DACL entries (which are inherited), so pre-existing workspaces kept working.Any user who points DSH at an existing directory tree hits this immediately after upgrading. A fresh install never reproduces it, because a workspace created by DSH has all of its subdirectories created after provisioning, so they inherit the label. This is probably why it is hard to see in testing.
The bundled diagnostic skill cannot repair this
diagnose-windows-sandbox-aclperformsSetDaclonly (repairsWRITE_DAC/WRITE_OWNER, removes AppContainer package ACEs).$LOW_LABEL_SIDis used for detection/reporting only — the script never writes a SACL / label. Running it against a failing subdirectory reportsverification: verifiedand changes nothing. (This matches the "cannot be fixed by the shipped skill" conclusion in #8412.)Separately, running it on the workspace root did fix a real, distinct problem: the root lacked explicit
WRITE_OWNER, which made every confinedpwshinvocation fail withSetNamedSecurityInfoW failed (Win32 5): grantWrite(<workspace-root>). That part is resolved; this label-coverage problem is not.Suggested fix
diagnose-windows-sandbox-aclto detect and repair missing integrity labels (it currently only reports them).If #8412 leads to the standing label being narrowed or dropped, please make sure this coverage gap is handled in the same design pass — otherwise "workspace-write works on a fresh workspace but silently fails on an existing one" will remain.
Impact
Any user whose workspace is a pre-existing directory tree loses the ability to run any shell command that writes files (downloads, builds, code generation,
npm install) in the defaultworkspace-writemode. All workarounds are user-side: switch todanger-full-access, work inside a newly created directory, or use the fs capability channel instead of a shell.All reactions