Repository navigation
Replies: 2 comments
|
Thank you — this is the most complete measurement of this shape so far, and your two "Related" sections answer questions the earlier reports left open. It is also the fourth report of it, and nothing in the source has moved between them, so the honest framing is "chronic and unfixed" rather than "new". The same shape, three times before yours
We replied on each of the first three. The timeline is the part worth knowing: the Low-label layer landed 2026-09-19 ( Your source reading, checked against the source rather than the bundleEvery line you cite is accurate. Here is the same code at head (
The permanence has two halves and you found both:
The one place the record contradicts you, and the arm that settles itThe package's own cost line says the opposite of your mechanism sentence. The test suite does not settle it either. The only inheritance assertion in the package ( This matters because it decides which fix is sufficient, and the two are not the same:
Your What is new here, and it is worth more than the confirmation1. 2. The cross-workspace delete, measured. Your reading is the shipped rationale verbatim — the backend's mechanism section: "Windows can also authorize a write or a delete from the parent directory's 3. That is a fourth boundary on the relabel. The whole-tree relabel this family keeps proposing ( On the documentation you asked forThe natural home is the Known Limitations bullet quoted above, which currently prices the propagation as a cost but does not say that a workspace predating an upgrade can be left half-labelled. There is one thing to be plain about if such a note is written: there is no supported repair command to point at. The bundled skill is DACL-only by construction — its Where a fix can and cannot come fromThe fix is core: either the skip predicate in A plugin cannot repair this. Writing the SACL needs Thank you for the before/after evidence and for pushing the repair question as far as you did — the junction numbers in particular are a finding in their own right. |
|
Thanks for the detailed investigation. I independently reproduced the same issue on Windows 10 with DeepSeek Harness 0.2.1-rc.2, and completed a successful local workaround with additional inheritance tests. Environment and reproduction
Initially, sandbox initialization failed with This initial failure is separate from the inheritance issue discussed here. After initialization, only the workspace root received the capability-SID ACE, the The confined shell could create files at the workspace root and inside newly created directories, but could not modify existing files or create files inside existing subdirectories. Additional inheritance findingsI then tested how the existing tree responds to ACL writes performed with
These observations support the conclusion that an The integrity labels appeared later than the DACL entries, but the observations do not establish whether this was delayed propagation or the result of intervening ACL operations. Full per-object labeling was not necessary in this case, although a residual set of objects still required explicit repair. End-to-end verificationAfter the local repair, I tested the confined shell without disabling sandbox restrictions: Test | Result -- | -- Open 4 pre-existing files for writing at different depths | 4/4 passed; SHA-256 unchanged Create, read, and delete temporary files inside 4 pre-existing directories | 4/4 passed Create a file outside the allowed workspace | Denied Create a directory outside the allowed workspace | Denied Read a file outside the allowed workspace | Succeeded Sandbox/runner initialization | SucceededThe external write attempts produced The repair scan found no reparse points. Possible upstream follow-upThe provisioning path uses These are possible investigation paths, not confirmed fixes. A post-provisioning check of pre-existing child directories and files could also help detect missing capability ACEs, directory delete-child deny ACEs, or Low integrity labels before reporting sandbox initialization as successful. Separately, the initial Win32 5 failure resulted from a missing The local workaround has been verified, but I have not confirmed a specific upstream code change as the fix. Hopefully these additional results help narrow down the root cause. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows, after upgrading to
0.2.0-rc.2, every directory that already existed inside aworkspace becomes read-only to confined commands, while the workspace root stays
writable and newly created directories are fine.
The cause is that the workspace-root Low integrity label is inheritable for future
objects only — Windows does not retroactively apply it to existing children. Because
grantWritethen short-circuits on its exact-triple check, the propagation is skippedforever, so the inconsistency never self-heals.
Environment
0.2.0-rc.2, profileweb, policyworkspace-writeD:\Root cause
dsh-sandbox-windows-acllowers the confined token to Low integrity(
lib/types-*.js:1291restrictTokenIntegrity) and marks the workspace root with aninheritable no-write-up label (
buildLowLabelAcl,:425-442), applied together with theDACL in one
SetNamedSecurityInfoW(..., DACL|LABEL)call (:485).The kernel then refuses write-class access from the Low token to any object not labelled
Low. Since the label's
(OI)(CI)inheritance only affects objects created after it isapplied, pre-existing subdirectories stay unlabelled (= Medium) and become unwritable.
Re-provisioning does not fix it, because
grantWriteskips theSetNamedSecurityInfoWcall when the exact triple is already present:
hasExactLabelonly inspects the root's SACL, so the root satisfies the skip while itsexisting descendants remain unlabelled. On this machine the root had all three elements
from an earlier provisioning, so no later run ever relabelled the tree.
Evidence
D:\DSH工作区(I)(OI)(CI)(NW)…\资产,…\记忆…\归档,…\发布…\临时文件,…\.pnpm-store…\_dshprobewhoami /groups→Mandatory Label\Low Mandatory Level S-1-16-4096(
SeChangeNotifyPrivilegeonly).FA,Authenticated UsersM,capability SID
(W,D,DC)) — so this is the integrity check, not a DACL denial.Impact
Any workspace that existed before the upgrade is permanently inconsistent: agents can write
at the workspace root but not into any pre-existing subdirectory. In practice this makes
workspace-writeunusable for real work, because a workspace's useful content lives insubdirectories.
Suggested fix
When provisioning, after the root's grant, walk the workspace once and apply the Low label
to every descendant that lacks it, skipping reparse points (see the
/Tissue below).The exact-ACE/exact-label skip could then be narrowed: it currently treats "root is
correct" as "tree is correct", which is what makes the state permanent.
At minimum, please document the limitation — "upgrading leaves pre-existing workspaces with
unwritable subdirectories; run X to repair" — since the symptom (workspace root writable,
subdirectories denied) is easy to misattribute to user ACL damage.
Related:
icacls /Tin a repair script crosses junctionsNot a DSH bug per se, but worth warning about, because it is the obvious way to repair the
state above and it silently writes outside the workspace.
icacls <dir> /setintegritylevel (OI)(CI)L /T /Cdescends through junctions and labelstheir targets. Controlled repro (link on
D:, target onC:):On this machine the workspace tree contained 1576 junctions pointing outside (an npm
install tree and a plugin tree), so running such a repair labelled 31718 objects outside
the workspace. All were reverted, and no file contents were touched
(
icacls /setintegritylevelonly edits the SACL) — but a repair tool that follows linkscan write outside the sandbox boundary it is supposed to enforce.
Note that
icacls <dir> /grant ...(without/T) does not follow links — theinheritable ACE propagates by normal inheritance, which stops at the junction. So: grant
without
/T, and label with a self-recursive walk that skips reparse points.Related: the repair must apply all three parts, or it opens a cross-workspace delete hole
grantWriteapplies three things together (:608):A hand-rolled repair that applies only the Low label (my first attempt) produces a real
privilege issue:
FILE_DELETE_CHILDis evaluated on the parent directory and, as yourown README notes, does not require a restricting-SID countersignature. With the target
labelled Low (so the integrity check passes) and
D:\grantingModifytoAuthenticated Users, a session confined to workspace A could then delete objects inworkspace B without approval — verified:
Deleting is the sharp edge; the same path also allowed removing whole directory trees.
Since the fix is a one-line ACE, it may be worth exposing a documented "repair recipe" that
includes all three parts, so people repairing the label issue don't accidentally widen
cross-workspace access.
All reactions