{"id":"XE-16955","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2799,"title":"CLI: XE_API_ADMIN_TOKEN operator token exposed via process environment (/proc, ps, shell history, child processes)","area":"node-api","claimed_tier":"minor","assessed_tier":null,"verdict":"invalid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"invalid","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T08:03:37.425304+00:00","updated_at":"2026-11-23T01:17:05.257119+00:00","source_created_at":null,"told_at":"2026-11-23T01:17:05.259382+00:00","status_changed_at":"2026-11-23T01:01:14.282916+00:00","url":"https://bounty.xe.network/XE-16955","body":"# CLI: XE_API_ADMIN_TOKEN operator token exposed via process environment (/proc, ps, shell history, child processes)\r\n\r\n- Suggested tier: Minor (no funds at direct risk; operator-scope token, same-UID/history readers only)\r\n- Area: Node/API — cmd/xe/main.go, api/handler.go, vm/lima_manager.go, vm/dev_target.go\r\n- Head / commit under test: 8cc209d65c16089158da8fabd392628b71fe0711 (testnet-0006 build, public repo HEAD)\r\n- Found: 2026-11-17, read-only local source review + public read-only API checks. No live testing, no account use.\r\n- Payout address (XE): db4043dea0d12c476c2644a3df09c4ce51fa1ce04617723405916ade3fa3305f\r\n\r\n## Summary\r\n\r\nThe CLI carries the node operator's admin bearer token in the process environment. XE_API_ADMIN_TOKEN is read with os.Getenv in two places and is visible for the whole lifetime of the process to any same-UID reader via /proc/<pid>/environ and ps eww, is inherited by every child process the node spawns, and lands in shell history when typed as export XE_API_ADMIN_TOKEN=<token>. A leaked token authorises the operator-only endpoints on that node.\r\n\r\nThis is the same exposure class as XE-16935 (XE_SEED in the environment) but a different secret with a different blast radius — an operator token, not a wallet seed — so it is filed separately, not as a comment on that ticket.\r\n\r\n## Vulnerable code at HEAD 8cc209d\r\n\r\n- cmd/xe/main.go (cmdLeaseRenew): reads os.Getenv(\"XE_API_ADMIN_TOKEN\"), fatals if empty, then sends it as Authorization: Bearer <token> on POST {XE_NODE}/lease/{hash}/renew.\r\n- cmd/xe/main.go (cmdNode): h.SetAdminToken(os.Getenv(\"XE_API_ADMIN_TOKEN\")) — the token is loaded into the API handler for the node's whole lifetime.\r\n- api/handler.go:115-130 (SetAdminToken / checkAdmin): the token is the sole gate for the operator endpoints — fail-closed when empty, constant-time comparison — so the issue is purely the env carriage, not missing auth. requireAdmin gates POST /lease/request and POST /lease/{hash}/renew (api/handler.go:200-201), plus the chat admin endpoints.\r\n- Child inheritance: vm/lima_manager.go:298 (cmd.Env = append(os.Environ(), ...) when spawning limactl) and vm/dev_target.go:77 (same pattern for the interactive /bin/bash -l dev shell) — any secret in the node's environment is inherited by those children.\r\n\r\n## Worst case\r\n\r\nAn operator who exports the token when starting xe node leaves it readable in /proc/<node-pid>/environ for the node's entire uptime (days to weeks on a provider node), and in shell history indefinitely. Anyone with that read — another process running as the same UID, or anyone who later reads the operator's shell history file — recovers the operator token and can call the node's operator-only endpoints: request leases as the operator and renew any accepted lease on that node. The token is per-node operator scope, not account funds, which bounds the impact to that node's operator surface.\r\n\r\n## Bounds, stated honestly\r\n\r\n- Same-UID /proc readers are the main vector; there is no remote vector in this finding (contrast XE-10982, where the token is sent over the wire to XE_NODE, which defaults to a third-party public node — a different vector; an operator renewing against their own node is unaffected by XE-10982 but still exposed here).\r\n- XE-7136 covers only the variable name leaking in a 403 error message, not the token value. XE-8599 covers help text omitting the variable. Neither covers value exposure via /proc / ps / history.\r\n- The short-lived xe lease renew process exposes the token only briefly; the long window is xe node plus history persistence.\r\n\r\n## Suggested fix\r\n\r\nRead the operator token from a file with 0600 permissions (e.g. XE_API_ADMIN_TOKEN_FILE, or the existing wallet-file pattern), or prompt for it on stdin at startup, instead of the process environment; never print the variable name's value in help/errors (already the case for the value).","patch_refs":[],"thread":[{"id":19647,"source":"desk","source_ref":"reply:17323","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-16955 and says what; it is read like any other.","created_at":"2026-11-23T01:17:05.257119+00:00"}]}