WeKnora/internal
wizardchen adcb9fc10d fix(sandbox): 产物目录 bootstrap 降权,堵住 chown 跟随符号链接的容器内提权
会话级容器让「产物目录 bootstrap 以 root 执行」变成一条可复现的提权链:
沙箱账号拥有 /workspace,可以把产物目录换成指向 /etc 的符号链接;下一次
执行时 root 跑的 chown/chmod 会跟随链接,把 /etc 的属主交给沙箱账号,随后
删除重建 passwd 即可让该账号在下一次 exec 时解析成 uid 0——本 PR 刚做的
shell_exec 降权和文件操作降权会一并失效。一次性 docker run --rm 下两次执行
不共享文件系统,这条链走不通。真机验证过完整链路。

修法是让 bootstrap 和其它 exec 一样以沙箱账号运行:chown 对自己刚建的目录
是 no-op,对不属于自己的目标被内核拒绝。同时把 dockerExecUser 的空值兜底
从 root 改成 DefaultSandboxExecUser,漏传账号只会失去权限而非拿到权限,
也让三个后端对「空 User」的语义一致。

顺带订正若干过强的声明:find 只对路径最后一段不跟随符号链接,中间层的链接
仍由内核展开,因此 read_sandbox_file 的「拒绝符号链接」只覆盖路径本身指向
链接的情况;对应单测原先 mock 了一个真实 find 不会产生的返回值,改为断言
它实际覆盖的场景。文件头注释仍写着文件操作走 archive 接口,也一并更新。
2026-08-24 12:22:58 +08:00
..
agent fix(sandbox): 产物目录 bootstrap 降权,堵住 chown 跟随符号链接的容器内提权 2026-08-24 12:22:58 +08:00
application feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
config fix(config): 补齐 WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS 的 env 读取 2026-08-10 19:40:09 +08:00
container feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
database feat(agent): report and attribute per-turn LLM token usage 2026-08-24 10:36:19 +08:00
datasource feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
errors refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
event feat(agent): report and attribute per-turn LLM token usage 2026-08-24 10:36:19 +08:00
handler feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
im feat(agent): report and attribute per-turn LLM token usage 2026-08-24 10:36:19 +08:00
infrastructure feat(docreader): add XMind outline parsing (#2713) 2026-08-20 19:49:48 +08:00
logger refactor(context): replace middleware.EmbedChannelContextKey with types.EmbedChannelContextKey 2026-08-13 18:00:02 +08:00
mcp fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
middleware refactor(context): replace middleware.EmbedChannelContextKey with types.EmbedChannelContextKey 2026-08-13 18:00:02 +08:00
modelcontext feat(memory): introduce long-term memory feature with i18n updates 2026-08-13 18:00:02 +08:00
models feat(agent): report and attribute per-turn LLM token usage 2026-08-24 10:36:19 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
router feat(system-admin): add endpoint for creating users (#2722) 2026-08-20 19:51:10 +08:00
runtime fix(redis): harden TLS tests and surface TLS config at startup 2026-07-06 23:04:52 +08:00
sandbox fix(sandbox): 产物目录 bootstrap 降权,堵住 chown 跟随符号链接的容器内提权 2026-08-24 12:22:58 +08:00
searchutil fix(retrieval): 分段中删除的图片不再被检索到 2026-08-20 12:01:28 +08:00
storageallowlist fix(storage): align default provider fallback with STORAGE_ALLOW_LIST 2026-07-15 11:05:00 +08:00
storageurl fix(api): address resource_urls review follow-ups 2026-08-05 14:42:51 +08:00
stream feat(redis): support TLS for Redis connections (#1930) 2026-07-06 23:02:02 +08:00
tracing/langfuse feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
types feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
utils feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00