Skip to content

resetadmin cannot revoke API tokens, and says access has ended #718

Description

@rainmanjam

From the poka-yoke audit of 2026-09-04. Lens: fixed-value. Today: rung 0. Device reaches: rung 2 (Warning).

The mistake available

Be locked out — which is the compromise case — reset the password from the CLI,
and believe access is ended.

cmd/polyemesis/resetadmin.go:41-58 bumps users.token_epoch and prints
"every existing session has been signed out". API tokens are untouched, and
nothing lists them.

The HTTP handler for the same gesture (handleChangePassword) takes a
RevokeAPITokens flag, revokes on request, and reads back and discloses the
surviving tokens
so the operator can see what still has access. The CLI does
neither.

What happens

The path an operator reaches for precisely when they cannot sign in is the one
that cannot revoke the credential most likely to have been taken — and it
reports success in words that imply otherwise.

Today

Rung 0.

Device → rung 2, Warning

--revoke-api-tokens, plus always printing the surviving-token inventory,
mirroring the disclosure the HTTP handler already performs.

Why not Control (always revoke): it would be wrong for the routine-rotation
case, which is the common one — the HTTP handler's own comment makes this
argument and it holds here too. The device is that the operator is told what
survives, every time, rather than being left to assume.

Related: #706 — a revocation through this path would also need to reach live
WebSockets, which the in-process revoked set cannot do from a separate CLI
process. Fixing #706 by having the socket ask the store makes this work for free.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions