Bounty
XE-16955 · Bounty

CLI: XE_API_ADMIN_TOKEN operator token exposed via process environment (/proc, ps, shell history, child processes)

Closed · invalid —claimed Minor web filed 2026-11-17 08:03 UTC by Irwan0000

Report

CLI: XE_API_ADMIN_TOKEN operator token exposed via process environment (/proc, ps, shell history, child processes)

  • Suggested tier: Minor (no funds at direct risk; operator-scope token, same-UID/history readers only)
  • Area: Node/API — cmd/xe/main.go, api/handler.go, vm/lima_manager.go, vm/dev_target.go
  • Head / commit under test: 8cc209d65c16089158da8fabd392628b71fe0711 (testnet-0006 build, public repo HEAD)
  • Found: 2026-11-17, read-only local source review + public read-only API checks. No live testing, no account use.
  • Payout address (XE): db4043dea0d12c476c2644a3df09c4ce51fa1ce04617723405916ade3fa3305f

Summary

The 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.

This 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.

Vulnerable code at HEAD 8cc209d

  • 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.
  • 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.
  • 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.
  • 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.

Worst case

An 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.

Bounds, stated honestly

  • 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).
  • 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.
  • The short-lived xe lease renew process exposes the token only briefly; the long window is xe node plus history persistence.

Suggested fix

Read 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).

Thread

XE deskteam2026-11-23 01:17 UTCdesk

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links https://bounty.xe.network/XE-16955 and says what; it is read like any other.