Replies: 4 comments
补充:根因已定位(模式对照 + 手工运行真实 runner)决定性的模式对照
⇒ 是否改写 已排除项(全部实测)
根因让真实 runner 在
为什么此前"手工跑 runner 成功":手工调用时由复现方自行创建 temp 目录,且子进程只执行 建议修复方向
|
On the follow-up: the private-TEMP grant is the seam's job, and the manual runner is the one invocation that grants nothingYour localization is checkable against the shipped code, and the measurement in it points at the reproduction rather than at the product. Three facts, then the discriminator they imply. 1. The build you run does contain the private-TEMP grant. const tempDir = mkdtempSync(join(tmpdir(), "dsh-"));
const tempSid = tempWriteSid(tempDir);
grant = AclWriteGrant.create(tempSid);
grant.add(tempDir); // ← the ACE your probe found missing(measured in the published 2. Who grants depends on the invocation, and one of the three combinations grants nothing.
Your manual run — "手工调用时由复现方自行创建 temp 目录", with SIDs you computed yourself — is the third row. That row is the one combination in which the directory the child is pointed at carries no capability ACE and nothing reports it, and it predicts exactly what you measured: 3. That does not yet convict production, and the difference is testable. Two checks separate the rows:
One more prediction worth having in hand: if the child's Your four questions
On your suggested fixes
On the
|
|
Cross-referencing a bisection result that differs from the env-var theory in this thread (details and the full experiment table in #8130):
|
|
补充一条可能对排错文档有用的观察:本仓库自带的 本机环境(独立复现)
关键点:自检通过并不能排除本 issue在同一台机器上,对工作区根目录及其全部祖先运行该自检脚本,输出为: 判定依据是:工作区根及其各级祖先均具备有效的 问题在于该工具的检查面:它只覆盖「文件权限不足」这一类成因,而对本 issue 涉及的链路——受限令牌的默认 DACL(见本线程 comment 8)与私有 TEMP 目录的授权(见 comment 6)——在结构上不可见。 因此建议在排错文档中显式标注:
否则排查者很容易在「权限看起来完全正常」这一步被误导,而真正的炸点在进程创建阶段。 明确划定我没能确认的部分
供他人复核的最小判别探针我准备了一个可复用探针,思路是:把同一份托管入口分别编译成两种 PE 子系统,再逐条件运行比对退出码。
脚本内含一条防呆,这里单独提一下,因为我自己就踩了:
也就是说,这个实验必须在受限会话内运行才有意义;在 |
Uh oh!
There was an error while loading. Please reload this page.
TL;DR
从 Web 端换到官方桌面客户端后,所有
pwsh工具调用都返回:echo hello、cmd.exe /c ver、不存在的程序,全部同一个码);windows-acl-run: <detail>并exit 127,实测从未出现);CreateProcessAsUserW造出的子进程;danger-full-access后,同一台机器、同一个 pwsh 立刻正常(dsh-pwsh-sandbox在该模式下return super.execute(spec),整条沙箱链被绕过)。环境
0.2.0-rc.2(desktop-runtime.json内清单)desktop(此前 Web 端为web)elevated = True)workspace-writeC:\Program Files\PowerShell\7\pwsh.exe症状与关键观测
1. 全部命令同一退出码
Get-Date[exit code: 3221225794]echo hello[exit code: 3221225794]cmd.exe /c ver(绝对路径、真实存在)[exit code: 3221225794]notepad-xyzzy /?(不存在的程序)[exit code: 3221225794]Error: invalid command: expected a non-empty string✅ 参数校验正常2. 同一台机器、同一个 pwsh,不受限时完全正常
在用户自己的窗口(管理员)里:
⇒ pwsh 可执行、别名可解析、PATH 正确。
3. 与
pwsh安装方式无关C:\Program Files\PowerShell\7\pwsh.exepwsh工具0xC00001420xC0000142(依旧)⇒ 排除了"解析到 Store 别名"这一假设:即使解析器首选的 MSI 路径已就绪,故障不变。
4. PATH / 缓存 / 重启全部排除
candidatePwshPaths()第 ① 候选位%ProgramFiles%\PowerShell\7\pwsh.exe已存在;C:\Program Files\PowerShell\7\;dsh-pwsh-local的resolvedPwshPath缓存问题。根因分析
执行链(来自
@deepseek-ai/dsh-pwsh-sandbox+dsh-sandbox-windows-acl源码)关键源码事实:
runner.js的失败契约是stderr: "windows-acl-run: <detail>"+exit 127;dsh-pwsh-sandbox会把具名 runner 失败归类为SANDBOX_UNAVAILABLE;3221225794(子进程退出码),不是 127、也不是SANDBOX_UNAVAILABLE。⇒ runner 正常起来了、也成功造出了子进程句柄,但那个被降为 Low IL 的子进程在 DLL 初始化阶段就死了。
官方报错文案本身已提示该场景
@deepseek-ai/dsh-sandbox中:为什么"换客户端"是分水岭
web,未挂载dsh-pwsh-sandbox,命令以 harness 自身权限运行;desktop,bundles: [@deepseek-ai/dsh-base, @deepseek-ai/dsh-web-app],挂载了沙箱链(dsh-sandbox-local → dsh-sandbox-windows-acl+dsh-pwsh-sandbox);未确定的部分(诚实声明)
未能进一步确定受限令牌链在本机失败的具体内部原因,候选包括:
S-1-15-2-*包 SID 项);CreateProcessAsUserW的令牌构造与降级路径可能与该上下文相关;绕过方案(已验证)
会话「访问模式」选择器 → 切换为「完全权限 (Full access)」(机器值
danger-full-access)。切换后立即验证:
进程链验证(证明沙箱链已被绕过):
(限制模式下这里应出现
runner.js中间层;实际没有。)同时确认:文件写/读/删 ✅、网络
api.github.com→HTTP 200✅。复现步骤
desktop;workspace-write(或read-only);pwsh工具命令(例如echo hello);[exit code: 3221225794];danger-full-access,重试同一条命令 ⇒ 正常返回。建议 / 提问
SANDBOX_UNAVAILABLE这类具名错误上报,而不是把子进程的0xC0000142原样透传给模型/用户?当前表现容易被误读为"pwsh 没装"。dsh-sandbox-windows-acl的自检入口? 随包发布的diagnose-windows-sandbox-acl技能针对的是工作区写入类 ACL 拒绝,与本例(进程创建期 DLL 初始化失败)不匹配,无法据其定位。附:本次使用的诊断手段(可复用)
cmd.exe/ 不存在的程序对照Start-Process直接起 pwshdsh-pwsh-local/lib/index.js的candidatePwshPaths/resolvePwshPathdsh-pwsh-sandbox/lib/index.js、dsh-sandbox-windows-acl/lib/runner.js%LOCALAPPDATA%\npm-cache\_npx\*\node_modules\@deepseek-ai\找到解包源码树app.asar即可读源码app.asar提取工具源码ParentProcessId追溯报告由会话内排障过程整理;SID/用户名为脱敏占位(
<USER>),其余数值均为实测原文。All reactions