security: openclaw writes OPENCLAW_GATEWAY_TOKEN into world-readable /tmp log filename #264

Closed
opened 2026-06-19 08:42:58 +00:00 by coilyco-ops · 1 comment
Member

Recovered from a local session transcript (2026-06-19) - a drive-by security finding deferred as out-of-scope, never filed. Anchor: "putting $OPENCLAW_GATEWAY_TOKEN into a /tmp log filename" - agentic-os session e0681134 L884.

Problem (security)

.openclaw/start.sh and .openclaw/msg.sh embed the secret $OPENCLAW_GATEWAY_TOKEN into a world-readable /tmp log filename (/tmp/openclaw_${TOKEN}_log.txt). Any local user or process can read the token via filesystem/process enumeration - the filename itself leaks the secret, regardless of file contents.

Fix

Stop putting the token in the path. Use a fixed log filename under a 0700 per-user state dir (e.g. ${XDG_STATE_HOME:-$HOME/.local/state}/openclaw/ or a mktemp -d-created 0700 dir), never the token. Check shell/common.sh for the same pattern (it also references OPENCLAW_GATEWAY_TOKEN).

Location

Files live in agentic-os: .openclaw/start.sh, .openclaw/msg.sh, shell/common.sh.

**Recovered from a local session transcript (2026-06-19)** - a drive-by security finding deferred as out-of-scope, never filed. Anchor: "putting `$OPENCLAW_GATEWAY_TOKEN` into a `/tmp` log filename" - agentic-os session `e0681134` L884. ## Problem (security) `.openclaw/start.sh` and `.openclaw/msg.sh` embed the secret `$OPENCLAW_GATEWAY_TOKEN` into a world-readable `/tmp` log **filename** (`/tmp/openclaw_${TOKEN}_log.txt`). Any local user or process can read the token via filesystem/process enumeration - the filename itself leaks the secret, regardless of file contents. ## Fix Stop putting the token in the path. Use a fixed log filename under a `0700` per-user state dir (e.g. `${XDG_STATE_HOME:-$HOME/.local/state}/openclaw/` or a `mktemp -d`-created `0700` dir), never the token. Check `shell/common.sh` for the same pattern (it also references `OPENCLAW_GATEWAY_TOKEN`). ## Location Files live in agentic-os: `.openclaw/start.sh`, `.openclaw/msg.sh`, `shell/common.sh`.
Author
Member

🔒 Reserved by ward agent --driver claude — container ward-agentic-os-issue-264-claude-20604256 on host kais-macbook-pro-2.local is carrying this issue (reserved 2026-06-24T06:33:18Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (2h0m0s TTL); --force overrides.

— Claude (she/her), via ward agent

<!-- ward-agent-reservation --> 🔒 Reserved by `ward agent --driver claude` — container `ward-agentic-os-issue-264-claude-20604256` on host `kais-macbook-pro-2.local` is carrying this issue (reserved 2026-06-24T06:33:18Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (2h0m0s TTL); `--force` overrides. <!-- ward-agent-signature --> — Claude (she/her), via `ward agent`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/agentic-os#264
No description provided.