fabro/lib/crates/fabro-hooks/src
Bryan Helmkamp 077469d0c6
refactor(auth): scrub FABRO_WORKER_TOKEN from worker env at startup
The worker subprocess is spawned with env_clear+allowlist by the server, so
the only sensitive value in its env is FABRO_WORKER_TOKEN itself. Read the
token and remove_var it from the process env in main() before Tokio starts
worker threads, then thread it explicitly through runner::execute(&str).

Every descendant (hooks, local sandbox, devcontainer initializeCommand,
MCP stdio, etc.) now inherits a worker env with no bearer in it, so an
unscrubbed spawn site cannot leak the token. This makes the prior denylist
scrub in fabro-hooks and fabro-sandbox redundant — delete it and the shared
WORKER_SECRET_ENV_DENYLIST constant. The sandbox keeps its _api_key/_secret/
_token/_password/_credential suffix heuristic for user-supplied env_vars
hygiene.

Extend the server-dispatched-worker env-leak integration test to also
assert a Bash stage running in the worker does not observe FABRO_WORKER_TOKEN.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 15:10:58 -04:00
..
bridge.rs fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
config.rs fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
executor.rs refactor(auth): scrub FABRO_WORKER_TOKEN from worker env at startup 2026-04-23 15:10:58 -04:00
lib.rs Rename SessionConfig to SessionOptions and McpServerConfig to McpServerSettings 2026-04-02 06:47:42 -07:00
runner.rs fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
types.rs fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00