Keep env values off the bwrap command line
This commit is contained in:
@@ -23,3 +23,7 @@ Later bwrap arguments override earlier ones for the same path. This has caused m
|
||||
- User `--rw`/`--ro` escape hatches must come **after** mode setup so they can override sandbox restrictions.
|
||||
|
||||
Take extreme care when reordering any arguments in `sandbox.rs` or refactor things and test thoroughly.
|
||||
|
||||
### Env values must never become bwrap arguments
|
||||
|
||||
`/proc/<pid>/cmdline` is world-readable, and the same string is exposed inside every sandbox at `/run/agent-sandbox/bwrap-args`. `--setenv KEY VALUE` therefore publishes every secret the user puts in `env = [...]`. `set_sandbox_env` in `sandbox.rs` sets the whole child environment on the bwrap process instead, and bwrap passes its own environment on. Do not "simplify" it back to `--setenv`; `tests/e2e/env.rs` guards this.
|
||||
|
||||
Reference in New Issue
Block a user