Repository navigation
Replies: 1 comment
|
Your reproduction and the source agree on every point, and the last of your three asks is the one that can be satisfied today — so this reply is mostly about making the consequence visible where it happens, plus two corrections in your favour. What the source adds to your account. The three entries are standing by design and nothing revokes them: the backend's own Your A stopgap ships for it. - insert:
- id: sandbox-grant-advisor
name: '@argszero/cordis-plugin-sandbox-grant-advisor'Two corrections, both of them narrowing your report rather than widening it.
On your ask (1) — a supported way to release the standing edits, or at least the user-visible consequence documented — the documentation half is exactly the right minimum, because the consequence is invisible from inside the workspace that causes it. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
环境
0.2.0-rc.2(nightly 通道),Windows 10 22H2(10.0.19045.6456,x64)@deepseek-ai/dsh-sandbox-windows-acl(windows-acl档)摘要
自
d5ad3baeb5("fix(sandbox): confine Windows deletes with a Low integrity label",2026-09-19,首个发布版本dsh-v0.1.7-alpha.1)起,Windows ACL 后端会给每一个被授权的工作区根目录写入可继承的 Low 强制完整性标签,同时把受限子进程的令牌降级为 Low。由于 Windows 是按映像文件自身的强制完整性标签来决定新进程的完整性级别,工作区里所有可执行文件都会被降级为 Low —— 这不仅仅是 DSH 自己拉起的受限子进程,还包括用户自己启动的程序(在资源管理器里双击、自己的构建脚本、编辑器的工具链、游戏客户端)。这些程序随后写不进任何非 Low 的对象,其中就包括
%TEMP%和%LOCALAPPDATA%。该标签是作为常驻(standing)工作区授权写入的,永远不会被撤销,因此这个影响会跨会话、跨 DSH 重启、跨开机持续存在。
改动前后对比(上游证据)
也就是说:Windows 沙箱本身早在
f64ba40f43(2026-08-08)就已存在,按工作区常驻授权的机制早在5fea4b7c4b(2026-08-09)就已存在 —— 但这两次都没有降级用户进程。只有d5ad3baeb5引入了这个行为。复现
W用一个workspace-write会话执行任意一条命令(授权在此物化)。icacls W输出:Mandatory Label\Low Mandatory Level:(OI)(CI)(NW)W(我用的是timeout.exe),然后从普通的、非 DSH 的命令行启动它。用GetTokenInformation(TokenIntegrityLevel)读取子进程令牌:W\_probe.exe(位于被打标签的目录树内)S-1-16-4096C:\Windows\System32\timeout.exeS-1-16-8192同一份字节、同一个父进程 shell,唯一的差别是文件上的强制完整性标签。
在一个真实项目上的后果(一个用于本地开发的游戏客户端/服务端仓库,所有工具链都存放在工作区内):
client/tool/.../luajit-win32.exe位于工作区内。构建过程会用它在%TEMP%目录里编译产物:%TEMP%没有标签(Medium),因此 Low 的luajit无法写入。client/runtime_copy/win64/client.exe位于工作区内。它把本地用户数据持久化到%LOCALAPPDATA%\client\snail.dat,SQLite 写入失败,程序报保存错误。把同一棵目录树复制到被打标签的工作区之外,两者都正常。
为什么现在无法修复
随包发布的诊断技能在设计上就做不到。
SetDacl()只传DACL_SECURITY_INFORMATION,sacl恒为IntPtr.Zero:README 对此有明确说明:"诊断保留完整性标签——它无法修复 Low 标签的可执行文件影响用户在 DSH 外启动程序的问题。"
常驻工作区授权没有任何受支持的撤销路径。 README 说明这些常驻改动在设计上永不撤销,手工
icacls清理无法回收(ERROR_NONE_MAPPED1332),并提示"请通过本模块回收" —— 但这个入口并不存在;开发备注里仍把清理命令列为"尚未决定"。目前找到的唯一绕法是
icacls W /setintegritylevel (OI)(CI)M /T,但它只能撑到下一次workspace-write供给重新物化授权为止(标签一旦不同,"精确标签跳过"就不再命中)。诉求
d5ad3baeb5的安全动机是清楚的,我并不是要求重新打开FILE_DELETE_CHILD那个洞。希望贵方能提供以下之一:AclWriteGrant的撤销接口或一个命令行工具,让一个项目目录能恢复成正常状态;%TEMP%、%LOCALAPPDATA%等 Medium 位置的访问。All reactions