ration status (the single most-run command in this repo, per round 13's
own framing)'s printTenantHeader printed tenant.Name completely raw, with
no sanitization at all. Same gap, same root cause, across the TUI: the
Tenants tab table, the Activity tab's per-row TenantName, and the card
form's tenant picker + adjust-limit infoLine all rendered a Tenant's own
Name raw too. services/tenant-registry's Create only validates name
non-emptiness, no charset check — round 16 already proved a raw ESC byte
survives into a persisted Tenant record via "tenant create --name".
Rounds 13/16/23 sanitized CardholderName, the CLI's own tenant-create
echo, and the Activity feed's Summary, but never Tenant.Name as read
back through these five separate call sites.
Reproduced live against the real bare-metal 8-service stack
(scripts/start-individually.sh): created a tenant with
--name $'Evil\x1b[31;1mINJECTED\x1b[0m Status Co', then byte-counted real
stdout — `ration status --tenant <id>` carried 2 raw ESC bytes pre-fix,
0 after. Drove the real bin/tui through a tmux pty: Tenants tab and the
card-issue form's tenant picker both rendered the literal bracket text
pre-fix verification showed was otherwise a live ANSI escape (confirmed
via `tmux capture-pane -e` byte inspection, distinguishing it from tmux/
lipgloss's own legitimate styling codes).
Fix: sanitizeControlChars(tenant.Name) in status.go's printTenantHeader;
format.SanitizedCell(t.GetName(), ...) in tui/view/tenants.go;
textsanitize.StripControlChars on ActivityRow.TenantName in
tui/view/activity.go; and on both the tenant picker's display name and
newAdjustLimitForm's tenantName param in tui/model/cardform.go — all via
the same helpers this repo's prior sanitization rounds already
established.
go build/go vet/go test clean for services/cli and services/tui (0
regressions), gofmt clean, full make build-go (10 binaries) clean.