Repository navigation
Replies: 4 comments
|
Your isolation is the cleanest I have seen for this cause, and the invariant it falsifies is stated in the code itself.
/**
* ... The prefix stays `[node, runner, ...]` — a future native-exe runner keeps
* the same argv contract and only swaps these entries.
*/
private windowsAclRunnerInvocation(): string[] {
const override = this.internals.windowsAclRunnerArgs
if (override !== undefined) return override
const builtEntry = this.internals.windowsAclRunnerEntry ?? fileURLToPath(import.meta.resolve('@deepseek-ai/dsh-sandbox-windows-acl/runner'))
if (existsSync(builtEntry)) return [process.execPath, builtEntry]
...and a test that states the same belief as a comment — Two notes that may help the fix land:
|
|
Adding an independent environment sample. Symptoms and conclusions match the OP's, but the shell, install path and Windows build are all different, so those variables can be ruled out. Environment
Reproduction
Consistent with the OP. Three additions: Same DSH build, different Windows build. This machine is on Shell independence is confirmed further. The OP runs PowerShell 7.6.6; this machine runs PowerShell 5.1. Both fail. That rules out "a specific PowerShell version / .NET Framework failing to initialize under a restricted token." No WER record, consistent with dying inside DLL initialization. Across the four hours surrounding the failures, the Windows Application log contains zero Application Error, .NET Runtime, and SideBySide events. Two further items are also excluded:
One additionThe bundled Node path suggested in the proposed fix exists in this install as well, with the same layout the OP describes. On a more structural fix: a comparable desktop AI product (WorkBuddy) ships its Windows sandbox as a compiled standalone executable ( |
|
独立复现:同一份 runner,只换解释器即可切换这个缺陷的成败 环境(与 OP 及楼下样本都不同,用于排除环境变量)
方法:让两臂执行逐字节相同的 runner
然后只改解释器这一个变量: $runner = '<解包目录>\node_modules\@deepseek-ai\dsh-sandbox-windows-acl\lib\runner.js'
# 臂 A:真实 node(<install>\resources\runtime\primary-runtime\dependencies\node\bin\node.exe, v24.21.0)
& node.exe $runner --workspace <ws> --temp <tmp> --mode workspace-write -- powershell.exe -NoProfile -Command 'exit 7'
# 臂 B:Electron 二进制(ELECTRON_RUN_AS_NODE=1)
& '<install>\DeepSeek Harness.exe' $runner --workspace <ws> --temp <tmp> --mode workspace-write -- powershell.exe -NoProfile -Command 'exit 7'探针用 结果(各重复 2 次,确定性)
在同一个 A/B 里,DSH 版本、runner 字节、沙箱源码、工作区、临时目录、探针命令、令牌配方全部相同,唯一的变量是解释器。 因此本机数据支持本线程提出的机制:打包形态下 两点补充
与另一条候选假设的关系#9621 的评论里提出 站内可用的临时规避(对本机同样有效)把 runner 的解包副本 + 真实 node 作为解释器交给沙箱,即 ( |
|
It shipped. What changed because of your isolation:
npm: https://www.npmjs.com/package/@argszero/cordis-plugin-sandbox-grant-advisor/v/0.23.0 — it mounts as a bundle patch and the advisory attaches to the |
Uh oh!
There was an error while loading. Please reload this page.
[Windows] workspace-write 沙箱下所有受限子进程以 0xC0000142 退出(打包版把 Electron 二进制当作 ACL runner)
环境
C:\Users\Administrator\AppData\Local\Programs\DeepSeek Harness\ELECTRON_RUN_AS_NODE=1,process.execPath=DeepSeek Harness.exe(244 MB)C:\Program Files\PowerShell\7\pwsh.exe),系统 node v24.21.0现象
read-onlyworkspace-write(no output)+[exit code: 3221225794]danger-full-access3221225794=0xC0000142=STATUS_DLL_INIT_FAILED。命令完全没有执行(无输出、无副作用)。根因
@deepseek-ai/dsh-sandbox-local/lib/index.js的windowsAclRunnerInvocation():打包形态下
process.execPath是 Electron 主程序,于是 windows-acl runner 自己就是以 Electron 进程镜像运行的。该 runner 铸造WRITE_RESTRICTED+ Low integrity 的受限令牌,再从该令牌 spawn 受限子进程;在workspace-write下受限子进程死在 DLL 初始化阶段。runner 本身没有失败(它自己的失败签名是 exit 127 + stderr
windows-acl-run:),所以宿主把0xC0000142当作目标进程的退出码上报,最终表现为「空结果」,掩盖了真正的失败位置。证据(同一 token recipe / 授权 / stdio / env,只改 runner 的进程镜像)
ELECTRON_RUN_AS_NODE=1)workspace-writenode.exeworkspace-writeread-only补充对照(都排除了):
--write-sid/--temp-write-sid造成的:workspace-write 不带 SID 参数同样失败。cmd.exe/node.exe/pwsh.exe三种目标全部以 0xC0000142 退出。windowsHide/ CREATE_NO_WINDOW:runner 侧 true/false 都失败。windows-acl-run:签名,与用户看到的错误不同。复现脚本(node,无第三方依赖):直接以
node <runner.js> --workspace <dir> --temp <dir> --mode workspace-write [--write-sid … --temp-write-sid …] -- <cmd>运行 runner,把第一段的解释器换成
DeepSeek Harness.exe(ELECTRON_RUN_AS_NODE=1)即复现 0xC0000142,换成node.exe即恢复正常。建议修复
打包形态下不要用
process.execPath作为 runner 的解释器,改用真实 node 可执行文件。本安装自带:例如在
windowsAclRunnerInvocation()中:当process.versions.electron !== undefined时优先使用该内置 node(注意普通node.exe读不了app.asar内的文件,runner 需要以可读路径提供,或把 runner 及依赖解包到app.asar.unpacked)。临时规避(用户侧)
read-only(有隔离、可执行,但不可写,且 PowerShell 处于 ConstrainedLanguage、非 ASCII 输出可能乱码);ctx.sandbox.internals.windowsAclRunnerArgs = [<real node.exe>, <runner.js 的 asar 外可读副本>](
internals是dsh-sandbox-local自带的 test hook,位置见lib/index.js:259,windowsAclRunnerInvocation()每次执行都会读取它,因此运行期覆写立即生效;不需要改app.asar。)相关背景
app.asar的 Electron fuse 中EnableEmbeddedAsarIntegrityValidation为 enabled,所以「直接改app.asar里的这一行」不是安全的用户侧方案;EnableNodeOptionsEnvironmentVariable为 disabled,因此也不能靠NODE_OPTIONS注入。ELECTRON_RUN_AS_NODE未注入时 runner 退化为启动第二个 GUI 实例、静默自杀)是同一处设计问题的不同分支,但退出码不同:本 issue 是3221225794,那一种是exit 0+ 零输出。All reactions