Replies: 1 comment 3 replies
|
Your root cause holds up on the source side, and the failure you are hitting already has a shipped, plugin-shaped answer. The merged write is real. The missing prerequisite already has a carrier. Because the requirement is documented but the error line does not name it, we published On a match it attaches an advisory to the failing tool result — your suggestion 1(b), without waiting for a core change: That is the same one-liner your Workaround that works section verified, plus a discriminator: it has the reader check their own SID's ACE for Honest boundaries, since your suggestion list is about where the fix belongs. The plugin is advice-only: it neither edits ACLs nor elevates — the What this report adds that our advisory does not yet carry — the two things you tried that do not fix it. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows, if the workspace directory's DACL grants the user only Modify
(no
WRITE_OWNER), the ACL sandbox fails at initialization and every shelltool call dies - not just a denied operation. The error message gives no hint of
the requirement.
The package README documents the requirement, but claims FullControl is "the
normal workspace case". On a normal data volume that assumption is wrong, so this
is a very easy trap to fall into right after upgrading.
Environment
<user>- running with a non-elevated token@deepseek-ai/dsh@0.1.7-rc.1(installed from npm,nexttag),dsh webE:\<workspace>- an ordinary folder on a data volumeRemoteSigned; session file policyworkspace-write0.1.5-rc.3before the upgradeReproduction
Create a folder on a data volume (e.g.
E:\<workspace>). It inherits from thedrive root:
Note: no explicit ACE for the user account, and
Modifydoes not includeWRITE_OWNER.Start
dsh webwithout elevation and connect the workspace.Ask the agent to run any shell command.
Current behaviour
Every tool call fails immediately, before the command runs:
Win32 5=ERROR_ACCESS_DENIED. Because the failure is in sandbox init, allshell commands are unavailable (even
netstat,icacls).On
0.1.5-rc.3the same setup worked, because the confinement was silentlyskipped. So this is a regression introduced by the switch to fail-closed.
Root cause
@deepseek-ai/dsh-sandbox-windows-aclapplies the DACL grant and the lowintegrity label in a single
SetNamedSecurityInfoWcall. Because the labellives in the SACL, the call needs both:
WRITE_DAC(or ownership), andWRITE_OWNER, which a Modify-only DACL does not grant.Independently reproduced outside DSH: writing the DACL on
E:\<workspace>from anon-elevated PowerShell fails with the equivalent
UnauthorizedAccessException: Attempted to perform an unauthorized operation.After granting the user explicit FullControl, everything works without elevation.
Things that do NOT fix it
takeown /F E:\<workspace> /R /D Y- makes the user the owner, but the owner'simplicit rights cover only
READ_CONTROL+WRITE_DAC, notWRITE_OWNER.icacls E:\<workspace> /reset /T /C- restores inheritance, which restores theModify-only ACE. Still fails.
Workaround that works
(Or run
dshfrom an elevated terminal.)Expected behaviour
Either it should work on a stock workspace, or the failure should tell the user
exactly what to do.
Proposed improvements
WRITE_OWNERbefore the first tool call and either (a) offer to apply theFullControl grant with consent, or (b) fail with an actionable message that
includes the exact
icaclscommand.only in the package README's "Known Limitations", which nobody reads at the
moment the failure happens. A troubleshooting page for the Windows sandbox
would help.
now fails the grant loudly ... (a Full-control directory, the normal
workspace case, has it)". On a data volume,
Authenticated Users:(M)inherited from the drive root is the normal case, especially for non-admin
accounts with no explicit ACE of their own. The doc reads as if this were an
edge case; in practice it is the default.
Note
Verified on
masterthat this limitation is still documented unchanged, andpushed_atstill equals the0.1.7-rc.1release time, so I'm reporting it asstill open rather than a duplicate of a fix in flight.
概要
Windows 上,如果工作区目录的 DACL 只给用户 Modify(不含
WRITE_OWNER),ACL 沙箱会在初始化阶段失败,导致所有 shell 工具不可用——不是某次操作被拒。
而报错信息完全没有提示这个前提条件。
该约束写在包的 README 里,但其中声称 FullControl 是"工作区的常态"。在普通数据盘上
这个假设是错的,所以升级后极容易踩到。
环境
<user>,以非提权令牌运行@deepseek-ai/dsh@0.1.7-rc.1(npmnext标签安装),dsh webE:\<workspace>,数据盘上的普通文件夹RemoteSigned,会话文件策略workspace-write0.1.5-rc.3复现
在数据盘新建文件夹(如
E:\<workspace>),它从盘根继承:注意:没有针对用户账户的显式 ACE,且
Modify不含WRITE_OWNER。不提权启动
dsh web并连接该工作区。让 agent 执行任意 shell 命令。
实际行为
每次工具调用都在命令真正执行前就失败:
Win32 5=ERROR_ACCESS_DENIED。由于失败发生在沙箱初始化,所有 shell 命令都不可用(连
netstat、icacls都跑不了)。在
0.1.5-rc.3上同样的配置是正常的——因为当时沙箱会静默跳过限制。因此这是切换到 fail-closed 之后引入的回归。
根因
@deepseek-ai/dsh-sandbox-windows-acl把 DACL 授权和低完整性标签放在同一次SetNamedSecurityInfoW调用里提交。因为标签位于 SACL,这次调用同时需要:WRITE_DAC(或属主身份),以及WRITE_OWNER—— 而仅有 Modify 的 DACL 不提供它。在 DSH 之外独立复现:非提权 PowerShell 向
E:\<workspace>写入 DACL,报等价的UnauthorizedAccessException: Attempted to perform an unauthorized operation.。给用户显式授予 FullControl 后,无需提权即可正常工作。
试过但无效的修法
takeown /F E:\<workspace> /R /D Y—— 用户成了属主,但属主只隐含READ_CONTROL+WRITE_DAC,不含WRITE_OWNER。icacls E:\<workspace> /reset /T /C—— 恢复继承,也就恢复了"仅 Modify"的 ACE,依旧失败。有效的绕过
(或在管理员终端里启动
dsh。)期望行为
要么在普通工作区上直接可用,要么报错明确告诉用户该怎么做。
改进建议
WRITE_OWNER,要么(a)征得同意后自动补上 FullControl 授权,要么(b)给出可执行的报错,直接附上那条
icacls命令。发生时没人会去翻那里。建议为 Windows 沙箱加一篇排障文档。
case, has it)" —— 在数据盘上,从盘根继承来的
Authenticated Users:(M)才是常态,尤其是没有自身显式 ACE 的非管理员账户。文档读起来像是边缘情形,实际是默认
情形。
备注
已在
master上确认该限制说明未变,且pushed_at仍等于0.1.7-rc.1的发布时间,因此按"尚未修复"报告,而非重复报告在途修复。
All reactions