Repository navigation
Replies: 3 comments
|
Thank you — this is the third report of the same code on a third Windows build (#8990 26100, #8991 22631, yours 28000), and the first one that varies a single input. I took your A/B to the shipped source and it maps onto the token construction exactly. Your isolation, against the source
const restrictingSids = buildRestrictingSids(mode === 'read-only'
? [logonSid, known.world] // logon SID + Everyone: 0 capability SIDs
: [logonSid, known.world, ...writeSids]) // + the capability SIDs
Two corrections to the surrounding hypotheses that the source does support: 1. The runner does not die — the confined child does. Your framing in #8991 ("the runner process itself dies at load time") is inconsistent with the backend's own failure contract: the windows-acl runner reports every runner-side failure as 2. Why the user only ever sees the number. The same rule set is why nothing classifies it: the code is only recognized as a runner failure at exit 127, so One thing worth knowing before the root cause is hunted
So: too few entries in the restricting list kills early init, and — per your measurement — too many (a Your What I can offer from this sideI maintain a plugin that recognizes exactly this failure family at the tool-result seam ( For the immediate session: Thanks again for doing the elimination work rather than reporting the symptom — the |
|
Released this as What the plugin now says about your case. Why the text hands that comparison over instead of naming the cause. The restricted-token layer records the opposite direction of the same code: a token built without the logon-SID + EVERYONE keep-alive pair also dies in early DLL init with exactly Two corrections your control arm supplies, both now in the advisory:
Also corrected in the same release, because a reader who sees a bare Where this sits in the family. Package: https://www.npmjs.com/package/@argszero/cordis-plugin-sandbox-grant-advisor — |
|
感谢两条详细的回复——runner 正常完成而死的是被限制的子进程、以及裸 补一点可能有用的信息:我这台机器(build 28000)是稳定复现机——单 capability SID 脚本 100% 必现 官方修复前我这边继续用 |
Uh oh!
There was an error while loading. Please reload this page.
关联 #8991:同样的
workspace-write沙箱失败。本帖补充精确定位到单个 restricting SID、可直接运行的最小复现脚本,以及"非 .NET 进程同样失败"的对照证据。现象描述
workspace-write档位下,agent 调用pwsh工具时 PTY 启动失败,UI 只显示:绕过 DSH UI、用
AclSandbox/runner API 直接测试,底层真实表现是:任何被 windows-acl runner 包装启动的子进程都在 DLL 初始化阶段立即死亡,与被启动的命令无关:read-only模式workspace-write+whoami0xC0000142,零输出workspace-write+cmd /c echo0xC0000142,零输出workspace-write+pwsh0xC0000142(inherit stdio 下为0xC000013A)关于 #84(anywhere-labs)"
.NET self-containedDLL init 失败"结论的修正:纯原生的whoami.exe、cmd.exe同样死亡,说明问题不在 .NET,而是该受限 token 配置下任何进程都无法完成 DLL 初始化。最小变量定位(本帖核心贡献)
直接调用
AclSandboxAPI(不经 DSH UI、不改任何目录 ACL),只变 restricting SID 列表一项:[logon SID, Everyone](read-only,0 个 capability SID)→whoami正常输出r9000p\administrator,exit 0[logon SID, Everyone, S-1-4-…](1 个 capability SID,manageDacls: false)→0xC0000142必死即:只要
CreateRestrictedToken的 restricting 列表包含 1 个S-1-4-…capability SID,子进程必死——与目录 DACL 改动、Low 完整性标签、命令内容、stdio 形态(inherit/piped)均无关。workspace-write恰好必含该 SID(workspaceWriteSid/tempWriteSid),故该档位全灭;read-only不含,故可用。电脑环境
0.2.0-rc.2desktop(win-x64)C:\Program Files\PowerShell\7\pwsh.exe)runas /trustlevel:0x20000(标准受限 token)运行 cmd 正常 → Windows 受限 token 基础机制无问题做了哪些尝试
read-only正常 /workspace-write必死0xC000013A)与 piped(0xC0000142)都死(排除控制台句柄因素)manageDacls: false(不改任何目录 DACL)仍死 → 排除目录 ACL 改动与 Low 标签传播runas /trustlevel受限 token 正常 → 排除系统级不支持受限 tokendanger-full-access后pwsh工具立即恢复(与 [Bug] workspace-write sandbox: every confined pwsh command exits with 0xC0000142 (STATUS_DLL_INIT_FAILED), no stderr #8991 一致);read-only也可用但不可写工作区最小复现脚本
用 DSH 自带 Electron 以 node 模式运行(不经过 DSH UI)。保存为
repro.mjs后执行:本机实际输出:
期望
S-1-4-…capability SID 进入 restricting 列表后导致子进程 DLL 初始化失败的根因(是否为特定 build 上的 Windows 行为,或与第三方安全软件注入交互);runnerFailureRules输出可读的沙箱诊断,而非裸0xC0000142/ UI 上的PTY shell exited during startup(与 [Bug] workspace-write sandbox: every confined pwsh command exits with 0xC0000142 (STATUS_DLL_INIT_FAILED), no stderr #8991 的诉求一致)。All reactions