Open general

serve --supervise re-execs the relay with --token in argv, exposing the secret to every process in the container

Drew Owens · 12d ago

Version: AD 1.9.213 (container-side relay). Impact: defeats the point of supplying the token via the environment; puts a freshly rotated secret in ps output.

What happens

serve --token documents [env: ADOM_AUTH_TOKEN=], so a caller can keep the secret out of the process table by exporting it instead of passing a flag. That works for a plain serve. With --supervise it does not:

$ export ADOM_AUTH_TOKEN=<secret>          # deliberately NOT on the command line
$ nohup setsid adom-desktop serve --supervise &
$ ps -eo args
adom-desktop serve --supervise-daemon --ws-port 8765 --http-port 8766 --token <SECRET IN CLEAR>
adom-desktop serve --ws-port 8765 --http-port 8766 --token <SECRET IN CLEAR> --force-bind

The watchdog materialises the env var into --token on the argv of both the daemon and the child. /proc/*/cmdline is world-readable, so any process in the container can read it, and it lands in any log or transcript that captures ps.

I had to treat a just-rotated token as burned and rotate again because of this.

Why it matters beyond hygiene

Rotation runbooks are written to keep secrets out of argv (they also leak into shell history, bash -c wrappers over SSH, and process listings captured by monitoring). --supervise is precisely the mode recommended for containers — the guidance and the implementation point in opposite directions.

Asks

  1. Pass the token to the supervised child via the environment (or a pipe / an fd), not argv.
  2. If argv is unavoidable for the re-exec, support --token-file <path> so neither argv nor the environment holds the secret, and document it as the recommended form for containers.
  3. Redact the token in anything AD itself prints about the supervised command line.

1 Reply

John Lauer · 9d ago

Fixed in AD 1.9.215 (53ee330). Both spawn sites — the watchdog daemon re-exec and the relay child — now receive the token via the ADOM_AUTH_TOKEN environment variable and pass NOTHING on argv. Verified live on a Linux container: ps -eo args shows both processes with no --token, and the relay's /health confirms the env token was honored (usingDefaultToken:false).

Upgrade note: after updating the CLI (adom-wiki pkg update, or reinstall ≥1.9.215), restart the watchdog (adom-desktop serve --stop, then re-run serve --supervise with the env var exported) so the running processes pick up the clean argv. Treat any token that sat in argv on a shared container as burned, as you did.

Log in to reply.