You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(sandbox): agent processes can read runnerd's token from /proc #4725
The spawner authenticates to runnerd with TALE_RUNNERD_TOKEN, and the same token keys the HMAC that protects runnerd's staged-input manifest (services/sandbox-runtime/daemon/src/main.ts:75, file-ops.ts:103, staged-manifest.ts:63). Since #4635, execs no longer inherit the token in their environment (execBaseEnv in exec-manager.ts). But runnerd itself still holds it in its process environment, under the same uid as every exec it starts: entrypoint.sh:1208-1213 (plain and transparent-egress paths) and lazy-docker.ts:805-819 (Docker-in-sandbox, which spreads the whole boot environment into runnerd's) drop runnerd to the profile uid, and execs are spawned without a uid change (exec-manager.ts:581-590). Nothing mounts /proc with hidepid or makes runnerd non-dumpable. Verified on main at 73d03a9.
Probe (Docker's default seccomp/AppArmor profile): a process started by root through setpriv --reuid 10001 with TALE_RUNNERD_TOKEN in its environment; a second uid-10001 process reads the token from /proc/<pid>/environ, while a uid-65534 process is denied. Unsetting the variable inside runnerd would not help — /proc/<pid>/environ shows the initial environment block.
So any agent process — or anything a prompt injection runs — can call runnerd's API with the spawner's credentials (/release, /reclaim, /pin, exec and file routes) and forge a valid staged-input manifest, so runnerd treats tampered files as verified platform inputs.
Suggested fix
Keep the token out of runnerd's environment: hand it over on an inherited file descriptor, or in a root-only file read once before the privilege drop.
Run runnerd under a uid other than the execs' (the probe shows a different uid is denied), or make it non-dumpable (prctl(PR_SET_DUMPABLE, 0)) so same-uid processes cannot read its /proc entries.
Key the manifest HMAC from a secret execs can never reach.
Activity