Repository navigation
workspace-write leaves a persistent Low integrity label on the workspace root, breaking installers launched from that folder #10270
Replies: 3 comments
|
The label surviving the session is deliberate, not a missed cleanup, and the design comment says so outright.
What is not obviously intended is the blast radius. The standing edit is a root edit with object and container inheritance, so everything created under that folder afterwards inherits Low — including an executable the user downloads days later, and then the files that executable writes. The cache is justified as "this directory is a workspace for this user", but its effect outlives that claim and applies to unrelated files. That is the gap worth reporting: not "you forgot to revoke", but "the cache is keyed to a directory that can be general-purpose". Dropping inheritance is not a fix, which is probably why nobody has done it: the confined child runs at Low with no-write-up, so a file created in a Medium directory would be unwritable by the very process that created it. The options I can see, none free:
Your NSIS failure follows from the mechanism rather than from the installer: a Low process writing to a Medium |
|
补充同一根因下的第二种症状——这一种连一句报错都没有。 环境与本帖一致:DSH 0.2.1-rc.2(桌面版),Windows 11 26H2 10.0.26300.9711,workspace-write。工作区根目录是一个普通项目文件夹,里面有个 .bat 启动本地 Python HTTP 服务(端口 7861),启动完调用 webbrowser.open 打开本机地址 http://127.0.0.1:7861/ 。 现象:服务本身完全正常(端口可监听、接口可用),但浏览器就是不出现——没有窗口、没有报错、没有弹窗,而 webbrowser.open() 返回 True。把地址手动粘进浏览器一切正常。 原因:工作区根目录带 Mandatory Label\Low Mandatory Level:(OI)(CI)(NW)。根目录上没有 I,说明是直接设置在该目录上的,子项靠继承。于是从这个目录树里启动的任何 exe 都以 Low 运行。Chromium 系浏览器启动时要拉起崩溃上报进程 crashpad,这一步是「向 Medium 对象写入」,mandatory 策略在任何文件权限判断之前就拒了: crashpad_client_win.cc:430] OpenProcess: 拒绝访问。(0x5) crashpad_client_win.cc:144] crash server failed to launch, self-terminating 浏览器随即立刻退出:Chrome 2147483651(0x80000003,STATUS_BREAKPOINT)、Edge 21。Chrome 155.0.8059.80、Edge 155.0.4283.62、第三方 Chromium 内核浏览器(豆包 147.0.7727.149,作为系统默认浏览器)三者都复现。 对照实验: · 同样的 exe 从无标签目录(D:\、%APPDATA%)启动 → 完全正常; · 同一个工作区执行 icacls "<工作区路径>" /setintegritylevel (OI)(CI)M 之后 → 立刻恢复; · 标签在 DSH 完全重启后没有回贴(约 20 分钟后用 SACL 直读复查确认)。 给设计讨论的两点补充: 第一点,影响面比安装器更宽。Electron 应用、Playwright/Selenium 拉起的浏览器、以及任何「启动后自动开页面」的脚本都会以同样方式失败——而且是静默失败,用户会先怀疑自己的程序、浏览器或杀毒软件(我们为此花了约 4 小时,排除了 6 个错误假设才去读 SACL)。 第二点,行为实验在这里会骗人。有效完整性级别 = min(父进程令牌, 对象标签),所以一个 High/Medium 的父进程会掩盖 Low 标签,子进程看起来完全正常。只有直接调 GetNamedSecurityInfoW(..., LABEL_SECURITY_INFORMATION) 读 SACL 才可靠。 最小复现:在工作区里放一个 .bat,启动任意 HTTP 服务并调用 webbrowser.open(),页面不会出现;把同一个 .bat 复制到 D:\ 根目录再跑,页面正常出现。 如果对诊断路径有用,我可以提供那段读取 LABEL ACE 的 ctypes 代码(约 60 行,仅标准库)。 |
|
Adding a second broad-folder datapoint, plus three things that may save others time. Scale (Desktop as workspace; 26H2 build 26300.9711; DSH 0.2.1-rc.2): the root got 1) Running as administrator does not work around it. Elevation raises the token to High, but the process is still capped at Low by the image's own mandatory label, so the installer fails identically (measured: same exit code). The same exe copied to a Medium directory installs fine, exit code 0. This is the first workaround most users try, so it is worth stating explicitly. 2) Repair that worked on the whole tree, without icacls "<dir>" /setintegritylevel (OI)(CI)MSince the Low entry is inherited, changing the root label is propagated by Windows to every child - 16028 objects fixed in one call; afterwards 3) Removing the leftover $acl = Get-Acl -LiteralPath "<dir>"
$acl.Access | Where-Object { $_.IdentityReference.Value -eq 'S-1-4-...' } |
ForEach-Object { $acl.RemoveAccessRuleSpecific($_) | Out-Null }
Set-Acl -LiteralPath "<dir>" -AclObject $acl4) Not contamination: On the design question: the standing-edits cache is intentional, but when the workspace is a broad user folder (Desktop, Downloads) every later download/installer there is silently crippled and there is no supported undo. A sandbox-private shadow root, or a documented |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Using a broad user folder (e.g.
C:\Users\<user>\Downloads) as the workspace inworkspace-writemode causes the Windows ACL sandbox to apply its standing security descriptor to that folder, including an inheritable Low integrity label. The label survives the session and propagates to files created later. Any executable launched from that folder then runs at Low integrity (measured: Low, 0x1000) and cannot write to the Medium-integrity%TEMP%, so NSIS installers fail with:The same executable copied to a normal folder runs at Medium integrity (0x2000) and works normally.
Environment
workspace-write@deepseek-ai/dsh-sandbox-windows-aclReproduction
C:\Users\<user>\Downloadsinworkspace-write(observed: session of 2026-10-17, title "ScholarTools.exe malware analysis").install-tl-windows.exeinto that folder (the new file inherits the Low label).Process integrity level, same file / same user / same TEMP:
C:\Users\<user>\DownloadsC:\TempFix(copy)Additional check: the failing process's own environment has
TEMP=C:\Users\<user>\AppData\Local\Temp(the normal path), and a write probe to that folder succeeds at Medium integrity. The temp path is valid; only the integrity mismatch fails.Expected behavior
icaclsmay hitERROR_NONE_MAPPED1332 when removing theS-1-4-…ACE).Root cause
As documented in the backend README:
That trade-off is reasonable for a dedicated project workspace, but when the workspace is a mixed-content folder such as Downloads, Desktop, or the user profile, it silently downgrades ordinary host programs. The failure surfaces inside an unrelated installer, so users cannot connect it to DSH.
Impact
Everyone:(DENY)(DC)also affects deletes through the parent directory.Suggestions
dsh sandbox cleanup <path>(or fix the diagnosis skill) to remove theS-1-4-…ACE, theEveryone:(DENY)(DC), and the Low label, handlingERROR_NONE_MAPPED.Workaround
Copy the installer out of the folder before running it. To repair the folder (admin PowerShell):
All reactions