<!-- XE-16955 · CLI: XE_API_ADMIN_TOKEN operator token exposed via process environment (/proc, ps, shell history, child processes) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16955>. The page is the record; this is the same page for reading.*

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

Verdict
:   Invalid

Tier
:   —

Claimed
:   Minor

Area
:   Node / API

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-23 01:17 UTC

Told
:   2026-11-23 01:17 UTC

### Patches

None linked.

### History

- [785689](https://bounty.xe.network/log/785689) 2026-11-23 01:17 UTC reply.sent
- [784958](https://bounty.xe.network/log/784958) 2026-11-23 01:01 UTC proposal.adopted
- [784488](https://bounty.xe.network/log/784488) 2026-11-23 01:01 UTC proposal.adopted
- [784487](https://bounty.xe.network/log/784487) 2026-11-23 01:01 UTC ticket.status new → closed
- [783519](https://bounty.xe.network/log/783519) 2026-11-23 01:00 UTC proposal.adopted
- [783518](https://bounty.xe.network/log/783518) 2026-11-23 01:00 UTC proposal.adopted
- [783517](https://bounty.xe.network/log/783517) 2026-11-23 01:00 UTC ticket.facts
- [782299](https://bounty.xe.network/log/782299) 2026-11-23 00:59 UTC note.added
- [782298](https://bounty.xe.network/log/782298) 2026-11-23 00:59 UTC proposal.created
- [782297](https://bounty.xe.network/log/782297) 2026-11-23 00:59 UTC proposal.created
- [782296](https://bounty.xe.network/log/782296) 2026-11-23 00:59 UTC proposal.created
- [782295](https://bounty.xe.network/log/782295) 2026-11-23 00:59 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-16955) · [JSON](https://bounty.xe.network/v1/tickets/XE-16955) · [markdown](https://bounty.xe.network/XE-16955.md)

### 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 desk**team2026-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.
