Replies: 1 comment
|
沙箱外独立复现(dsh 0.1.5-rc.1,bubblewrap 0.12.0,bwrap 非 setuid、无 file capability): bwrap --ro-bind / / --dev /dev --unshare-pid --proc /proc --die-with-parent \
--tmpfs /tmp --bind "$WS" "$WS" -- \
sh -c 'cat /proc/self/uid_map; stat -c "%u:%g %n" /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf'不套 bwrap 时同一文件是 影响面不止 ssh,而是「root 拥有的一切」: 顺带排除一个方向:bwrap 本身 规避的边界: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
环境
/usr/bin/bwrap0.11.1 非 setuid;dsh 0.1.2-rc.176fda729..c291e796):下述相关文件零变化,问题仍在线现象
workspace-write 会话内(danger-full-access 同命令正常——该模式完全绕过 bwrap):
根因
bwrapProfileArgs(packages/sandbox/sandbox-local/src/profiles.ts)不含任何 user namespace 参数;但 bwrap 非 setuid 时创建 mount namespace 必须先创建 user namespace(man bwrap: "the user namespace is required if bwrap is not installed setuid root"),默认单行 uid_map 仅映射当前 uid(bubblewrap.cwrite_uid_gid_map:"%d %d 1", sandbox_uid, parent_uid)。宿主 root(kuid 0)落无映射区间 → stat 呈现 65534,OpenSSH 要求配置属主为 root 或当前用户 → 检查失败。即:uid namespace 隔离是 bwrap 非 setuid 形态的隐式副作用,不在 profile 声明中,也不在 mode 词汇表的任何轴上。
为什么提权通道帮不上
bwrap 档
denialSignatures仅['read-only file system'](DENIAL_SIGNATURES,sandbox-local/src/index.ts);此失败 stderr 不匹配 →denied=false→ 无 marker、无 escalation hint(tool-bash/src/render.ts仅在 denied 时注入)。同时工具描述要求 "Never escalate speculatively: ground the request in a real denial"(tool-bash/src/index.ts)→ 按契约模型无正规入口申请更宽模式。失败在模型视角与"命令自身 bug"不可区分,诱发无谓诊断。同族影响:git
dubious ownership、一切依赖"属主=root 或本人"安全检查的 CLI;--unshare-pid亦使跨调用进程管理脚本假成功(stop/status 报成功、服务实际存活)。相关
建议(按侵入性递增)
Bad owner or permissions、gitdubious ownership)扩展与denialSignatures/RunnerFailureRule同构的签名归因,注入类 marker 让模型可识别"这是沙盒引起的"临时规避
ssh -F ~/.ssh/config <host>(显式-F跳过系统配置链的属主检查);部署类任务改用 danger-full-access 会话。All reactions