Desk CLI `keys init` / `keys show` accept the signer passphrase as a `--passphrase` command-line option — the XE-2213 class, fixed in the DAO CLI and the Go CLI but still open here
Report
Relationship to XE-2213 (read before filing)
XE-2213 is the DAO CLI instance of this defect class: a secret
taken on the command line is readable by every local user for as long
as the process runs (ps, /proc/<pid>/cmdline) and is kept in shell
history. It was fixed in the DAO CLI (repos/dao/dao/cli.py:
_secret() — "No command takes one as an option... This is the only
function that reads one, so a new command cannot grow its own") with a
regression test (repos/dao/tests/test_dao_core.py,
test_no_command_takes_a_secret_as_an_argument) that walks the DAO
command tree and asserts zero secretish parameters — and explicitly
asserts keys show --passphrase x exits 2 (rejected) on the DAO CLI.
The same class was fixed in the Go CLI: repos/xe/cmd/xe/main.go:130
fatals with "sign-block no longer takes a seed argument (it leaks via
ps/proc/shell history): rotate this seed and set XE_SEED instead", and
seeds now arrive only via the XE_SEED environment variable or key
files (:1252, :269, :1580).
This report is the desk CLI instance — a third, separate codebase
(repos/desk/desk/cli.py) with its own fix location. The desk CLI has
no XE-2213 regression test (grep: zero mentions of XE-2213 anywhere
under repos/desk), and its keys init / keys show commands accept
exactly the option the DAO test forbids.
Nearest neighbours, all different defects: XE-10207 (dao/desk
.env.example ships a publicly-known signer passphrase — about the
example file's default value, not about a CLI option); XE-0915
(Windows: --passphrase unusable, prompt hardcodes /dev/tty — about
the prompt transport, not about a cmdline option existing). Neither
names the desk CLI's --passphrase option.
Note: XE-2213 itself is absent from the public ticket dataset
(refreshed for this filing; neighbours XE-2157 and XE-2216 present;
GET /v1/tickets/XE-2213 returns 404 "no such ticket"), so its body
could not be re-read here. Its scope is established from the in-repo
evidence instead: both citations of XE-2213 in the tree are in
repos/dao (dao/cli.py comments + the DAO regression test), and the
fix it drove is DAO-CLI-only. Nothing in the tree suggests XE-2213
covered the desk CLI.
Summary
The desk CLI takes the service signer passphrase on the command line:
desk keys init --passphrase <secret> and desk keys show --passphrase <secret> are accepted options
(repos/desk/desk/cli.py:55,72), and _passphrase() (:33-34)
prefers the explicit value over the environment or the prompt. The
passphrase decrypts the desk keyfile, which holds the log-signing key
and the vault key — the vault key seals every private report body and
attachment on the desk. Any local user on the operator's machine or
container can read the passphrase from /proc/<pid>/cmdline while the
command runs, and it persists in shell history afterwards. This is the
exact failure XE-2213 named, on the one CLI that was never fixed.
Evidence (repo desk @ ab9df7f)
desk/cli.py:52-69—keys_initdeclarespassphrase: str = typer.Option(None)(:55);keys_show(:71-77) declares the same (:72)._passphrase(explicit)(:33-34) returnsexplicit or os.environ.get("DESK_SIGNER_PASSPHRASE") or getpass.getpass(...)— the command-line value wins over both safe paths.- The rest of the desk CLI is clean, which makes these two options
the whole finding: a full parameter walk of the command tree (same
method as the DAO XE-2213 regression test) finds exactly two
secretish parameters in the entire CLI — these two. The GitHub
token arrives via settings/env only (
import-github,import-internal,github-labelsrefuse to run withoutGITHUB_TOKEN);import-triagereads private bodies from a file. - What the passphrase protects (
docs/DEPLOY.md:36,.env.example:32): "it encrypts the keyfile that holds the log key and the vault key"; the vault (desk/vault.py) seals private ticket bodies and attachments with SecretBox under that key. A leaked passphrase + a keyfile copy (or container access) opens every private report. - Contrast with the two fixed siblings: the DAO CLI refuses the
option entirely (regression test asserts exit 2 for
keys show --passphrase x); the Go CLI fatals if a seed is passed as an argument. The desk CLI is the only one of the three that still takes a secret on its command line.
Reproduction (executed against the desk CLI at HEAD)
Walked the real desk.cli Typer app (typer only; the CLI imports
lazily, so no desk runtime deps were needed) and invoked it with
CliRunner — the same two assertions the DAO XE-2213 test makes:
secretish params: [('keys init', 'passphrase', ['--passphrase']),
('keys show', 'passphrase', ['--passphrase'])]
keys show --passphrase x -> exit_code: 1 (DAO XE-2213 test demands 2)
control --no-such-option -> exit_code: 2
D5 PROVEN: desk CLI accepts --passphrase on keys init/show
Exit 1 (not 2) means the option was accepted and parsed — the command
proceeded past option parsing into execution (it then failed in this
minimal environment on a missing unrelated import, httpx, long past
the point where an unknown option would have been rejected with exit
2, as the control shows).
Why this is Minor, not higher
Disclosure is local-only: it needs a second local user (or a reader of
the operator's shell history) on the machine or container where the
operator runs desk keys. The passphrase alone is not sufficient —
the attacker also needs the keyfile (or equivalent access) to use it.
And the exposure requires the operator to actually pass
--passphrase; nothing in the docs tells them to, though the option
is discoverable via --help and is the path of least resistance for
scripted key management. Local secret disclosure with a narrow trigger
and a partial payoff is Minor.
Suggested fix
Mirror the DAO CLI fix (XE-2213): delete the passphrase option from
keys_init and keys_show, read the passphrase only from
DESK_SIGNER_PASSPHRASE or getpass.getpass, and port the DAO
regression test (test_no_command_takes_a_secret_as_an_argument) to
the desk test suite so no future command can grow a secret option.
Dup-check record
- Dataset refreshed immediately before filing (1,828 tickets, max
XE-11557): title greps for
passphrase,desk CLI,command line,cmdline,secret,history,show_locals,traceback,retained,keys init/show,signer— no desk-CLI--passphraseticket. Nearest: XE-10207 (.env.example default passphrase), XE-0915 (Windows --passphrase prompt transport). - Live
q=checks in the same session (passphrase, desk keys, command line, cmdline, XE-2213, --passphrase, secret history, show_locals, traceback, retained, desk CLI, ps /proc): no match.q=XE-2213total=0; GET /v1/tickets/XE-2213 → 404. - Own 29 tickets: none on the desk CLI or passphrase handling.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-11573 and says what differs; it is read like any other.