Skip to content

fix(windows): 按实际失败修复工作区沙箱权限,取消启动时强制改 ACL - #150

Merged
freedomkk-qfeng merged 8 commits into
mainfrom
fix/windows-sandbox-access
Oct 13, 2026
Merged

freedomkk-qfeng merged 8 commits into
mainfrom
fix/windows-sandbox-access

Conversation

@freedomkk-qfeng

@freedomkk-qfeng freedomkk-qfeng commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

统筹 #139(JunieXD)和 #148(wf0229),保留两位作者的原始提交。普通启动不再因无法修改运行时 ACL 而阻断本来可用的 Electron;安装与更新仍按原有范围配置权限,升级成功仍取决于实际窗口加载和健康确认。

工作区仅在官方 DSH 沙箱真实报告该工作区的 grantWrite / Win32 5 失败后诊断。确认目录属于当前账户、实际缺少 WRITE_OWNER 且可安全调整后,才征求用户确认并仅给根目录补充此项权限。已能运行、非本人所有、拒绝 ACE、重解析路径和不明故障不自动处理;不授予 Full Control,不修改子目录、所有者或其他应用权限,也不重放失败命令。处理前落盘原权限,检查文件身份与权限指纹,保留验证或回滚结果。

验证:214 项 Node 检查中 204 通过、10 项依环境跳过;Go 内部包和更新器测试通过。两组独立审查已完成,并用官方 DSH 与真实受限进程验证“缺权限失败 → 最小修复后工作区内可写/外部拒绝”;既有 standing grant 无 WRITE_OWNER 时仍正常运行。另实测了非本人 owner、继承拒绝、Low 标签保留和 HTTP 断连取消。独立 Electron 验证确认只读可执行但无 WRITE_DAC 的安装仍能正常启动。补充验证:真实官方 Host/Cordis 的 Tools/SandboxPolicy/WorkspaceRegistry → tools/result → HTTP native bridge → 原生 helper → 受限 Node 的完整服务链通过(只有原生对话框用测试回调确认)。基于已验证 0.4.3 包替换本次编译的组件形成本地候选,由原版 0.4.2 更新器升级、完成健康确认后再启动一次,实际 Electron 页面通过,合成配置/历史/附件/工作区保持不变;此候选仅供验收,并非发行包。最终提交的 9 个执行检查全部通过,1 个按流程条件跳过;包含双平台 Host 装配、Windows 权限/更新器、local-web、macOS 更新器及发布契约检查。

本次不发布新版本。

JunieXD and others added 8 commits October 11, 2026 16:22
DSH 的 Windows 沙箱在受限执行前要改写工作区根的 DACL 与完整性标签,需要
WRITE_DAC 和 WRITE_OWNER。直接建在 C:\ 根目录下的文件夹只继承“修改”,默认
沙箱中的命令全部以 SetNamedSecurityInfoW (Win32 5) 失败。

Windows Electron 版的 Host 在启动和登记新工作区时,以这两项权限打开工作区根
目录来检查(不做修改)。缺少权限时经原生桥请桌面端询问用户,同意后运行 DSH
随包的 diagnose-windows-sandbox-acl 脚本,仅限该工作区根,不提权,改动有备份
和恢复命令。同一路径每次运行只询问一次,对话框依次弹出。
The pre-window runtime ACL repair (b73b5a2) is fatal: it shows a modal
error and exits before the first startup heartbeat. Online updates are
applied by the previous release's updater, which does not grant the
access, so the new app repairs as the current user. When the install
folder was created with administrator rights, that user has no WRITE_DAC
and the repair returns Access is denied; the update rolls back with
'startup health stopped making progress', although the previous release
runs in the same folder without the grant.

Log the failure and continue. Successful repairs, the installer and the
updater grants are unchanged; a renderer that truly cannot start still
fails in the window phases, with this log line as the cause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@freedomkk-qfeng
freedomkk-qfeng merged commit b4cb768 into main Oct 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants