Replies: 3 comments
同一个缺陷,另一半入口:非系统盘(不需要"所有者是 Administrators")/ Same defect, the other half of the trigger: non-system drive我们独立撞上了同一个 bug( We hit the same bug independently ( 我们这边的前提和你的不同 / Our precondition differs from yours你的场景是「目录所有者是 Your case is "the directory is owned by
⇒ 结论:只要工作区在 ⇒ Net: any workspace on a non-system volume ( 最小复现(不需要装 DSH)/ Minimal reproduction (no DSH needed)用系统自带 New-Item -ItemType Directory -Force F:\probe | Out-Null
(Get-Acl F:\probe).Access | Where-Object IdentityReference -match $env:USERNAME # → 无输出 / no output
icacls F:\probe /setintegritylevel Low
# → Access is denied. (exit 5) ← 与 DSH 报的 Win32 5 同源 / same source as DSH's Win32 5
icacls F:\probe /grant "$env:USERNAME:(OI)(CI)F" # 补上含 WRITE_OWNER 的完全控制 / grant FullControl incl. WRITE_OWNER
icacls F:\probe /setintegritylevel Low
# → Successfully processed 1 files. (exit 0)(在 立刻可用的修复(用户侧)/ Immediate workaround (user side)icacls <workspace> /grant "<user>:(OI)(CI)F" # 全树传播约 3~4 分钟 / propagates across the tree, ~3–4 min
# 回滚 / rollback:
icacls <workspace> /remove:g "<user>"授权后 After the grant, 给上游的两条(与你那条的建议同向,但更强调"降级")/ Two suggestions (same direction as yours, with more emphasis on degradation)
—— 我们那边写成了一份更细的报告(含 —— We wrote this up in more detail (the four-step 本评论由 DSH agent 整理、经人工复核后提交;上面的命令在 Windows 11 + NTFS 非系统盘上可直接复现。 |
A plugin-layer stopgap for this exact shape — and a correction to what it printed before todayI maintain Why 0.5.0 exists: the previous version's one-liner cannot run here0.4.0 printed a single unconditional fix: That line is correct where the caller owns the directory — the owner's implicit rights include WRITE_DAC, so So 0.5.0 forks the remedy on a check the user runs —
It also states plainly that On your four suggestions
Scope, honestlyThis is a stopgap, not a fix: the plugin never edits an ACL and never elevates, and the upstream gap — a failure that names neither the missing right nor a remedy, under a precondition that is not pre-flighted — remains open in One thing you were right about that needs no fix:
|
先道谢、也道歉,然后是两处更正与一处场景澄清谢谢跟进,也为我们报告里两条站不住的建议道歉。我们复核了源码,你的两处更正都对:① 另外澄清一处对我们那条补充的归属:我们说的是非系统盘 + 目录所有者就是调用者本人(不是本贴的 English versionThanks, apologies, two corrections, and one scope clarification Thanks for following up — and apologies for the two suggestions in our report that do not hold. We re-checked the source: both of your corrections hold. (1) One clarification on the scope of our addition: we mean non-system drive + the caller is the directory owner (not this thread's |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
我在vibe我的预设的时候ds向我报告了如下的问题:
环境
web)workspace-write(approval: ask)D:\ZQH260619\repos\DshAgentPresetForPlugin—— 目录所有者是BUILTIN\Administrators,对当前用户只有继承来的 Modify现象
workspace-write下任何 shell 命令都不执行,直接失败:没有命令输出、没有退出码 —— 命令从未被 spawn,因此也无法用“先跑个 echo 看看”绕过。
对照:同一工作区切到
danger-full-access一切正常;切到read-only也正常(只读模式不授予可写根,因此不会走到这个调用)。复现
BUILTIN\Administrators、且当前用户只继承到 Modify」的目录作为工作区(例如由提升权限的安装程序/解压工具创建,或位于管理员所有的父目录之下);workspace-write开会话;pwsh -Command "echo hi")。诊断
另外该目录上残留一条非继承的 capability ACE
S-1-4-…:(W,D,DC),说明历史上曾成功授权过——即该目录并非永远不可授权,只是当前令牌不具备条件。结论:合并应用 capability ACE + 删除拒绝 + Low 标签需要
WRITE_DAC(写 SACL 标签还需要WRITE_OWNER)。当前令牌既不是所有者(所有者是对它 deny-only 的 Administrators 组),也没有SeTakeOwnership,因此SetNamedSecurityInfoW返回ERROR_ACCESS_DENIED (5)。我理解这正是
sandbox-windows-aclREADME「已知限制」里写的 fail-closed 前提(“被授权目录必须由调用者拥有并授予 WRITE_OWNER … DACL 只授予 Modify 的目录现在会大声失败”)。本 issue 不是要求放弃 fail-closed,而是希望改善这个前提在 Windows 上的可达性与可诊断性:建议
icacls "D:\ZQH260619\repos\DshAgentPresetForPlugin" /grant "PC-20260130TXZG\Administrator:(OI)(CI)F",或icacls "D:\ZQH260619\repos\DshAgentPresetForPlugin" /setowner "PC-20260130TXZG\Administrator"%USERPROFILE%\repos\...)现状是只抛
SetNamedSecurityInfoW failed (Win32 5): grantWrite(D:\ZQH260619\repos\DshAgentPresetForPlugin),用户完全不知道下一步做什么。WRITE_OWNER依赖的来源。能否在无法写 SACL 时提供明确的降级/opt-out(例如只授予 capability ACE 而不打标签,并在界面标注隔离强度下降),或至少在错误里区分“DACL 写入失败 / 标签写入失败”两个分支?版本核对
@deepseek-ai/dsh-sandbox-windows-acl与 rc.1 逐字节相同(4 个文件大小一致;含该调用点的lib/types-DxezulnA.js均为 61058 B、SHA-256E6014E93…7E0098),故 rc.2 未修复。相关但不同的讨论(供去重)
#401 / #423(子目录 ACE 永不补授)、#2287(临时目录 ACL 重施后失去创建者权限)、#469 / #3430(workspace-write 冻结)、#3919(Google Drive VFS,Win32 87)、#4290(mkdir 0700 空 DACL)。
本问题是工作区根目录本身不可被当前令牌修改 ACL,与上述成因不同,请勿按重复关闭。
临时绕过
提权
icacls改所有者/补完全控制;或把工作区移到用户自有目录;或临时把该会话权限设为danger-full-access。English summary
On Windows, when the workspace directory is owned by
BUILTIN\Administratorswhile DSH runs from a UAC-filtered (Medium integrity) token, everyworkspace-writecommand fails before spawning:The token has only inherited
Modifyon that directory (theAdministratorsACE is deny-only for it, and there is noSeTakeOwnership), so it cannot write the DACL/SACL that the capability grant requires — a documented fail-closed precondition in thesandbox-windows-aclREADME, but one with a very common Windows trigger and a non-actionable error message. Requested: a preflight check with the exacticacls/setownerremediation (or a documented "unsupported layout" error), user-facing troubleshooting docs, and possibly a labeled degradation path when the SACL label cannot be written.read-onlyis unaffected (no writable root, no grant). Same failure in 0.1.7-rc.2: the sandbox package is byte-identical to rc.1.All reactions