xarmian
cdc5b301e2
fix(server): minting or rotating an API token requires an interactive session (BUG-2890) ( #1267 )
...
A PAT that could reach POST /auth/tokens minted further tokens with
independent names and expiries. Those survive the revocation of the token
that created them, and nothing in the token list records which token
minted which -- so revoking a leaked credential did not end the access it
had been used to establish.
Ruled on the item's trail day 57: create and rotate require session auth
and refuse a PAT-authenticated call with 403 session_required; list and
revoke stay PAT-reachable.
Population is THREE doors, not the two the filing named. Enumerating every
route that reaches store.CreateAPIToken / RotateAPIToken turns up the
workspace-scoped mint at POST /workspaces/{ws}/tokens, which had only
requireMinRole("owner") in front of it -- and a user-owned PAT held by an
owner satisfies that. Measured, not read: with the fixture's owner also
written into workspace_members, that door returned 201 with a live token
on the unfixed tree. All three doors are gated; list and revoke on both
the user and workspace routes are deliberately untouched, because neither
extends access and revocation is the compromised-credential response.
The gate is on the CREDENTIAL, not on the door: isAPITokenAuth is false
for a session cookie AND for a padsess_ CLI bearer, a distinction that
predates this fix (see ctxValidatedSessionBearer's note in
middleware_auth.go) because a CLI session IS an interactive session. At
the workspace door the check runs before requireMinRole, so a PAT-borne
caller cannot learn its own membership status from the difference between
the two 403s.
Five mutants run, each detected by its own leg: dropping the gate at each
of the three doors fails that door's test; gating on Authorization != ""
instead of the credential kind fails the CLI-session leg AND NOTHING ELSE;
over-applying the gate to list and revoke fails both PAT-still-works
controls. The fourth is why the CLI leg exists -- a header-shaped gate
passes every PAT assertion and breaks every logged-in CLI.
Also documents the refusal on the CLAUDE.md route line: the routes were
listed without saying anything about credential kind, so an agent holding
a PAT would have met an unexplained 403.
Claude-Session: https://claude.ai/code/session_01HeChkgZVYb3NTgTcckF5KR
2026-09-06 22:02:05 -04:00
..
2026-08-18 12:26:00 -04:00
2026-08-15 08:22:09 -04:00
2026-09-06 13:36:22 -04:00
2026-09-06 13:36:22 -04:00
2026-08-30 21:30:19 -04:00
2026-08-17 08:16:02 -04:00
2026-07-30 20:15:00 +00:00
2026-07-31 02:35:53 +00:00
2026-05-06 08:40:11 -04:00
2026-05-06 13:27:12 -04:00
2026-06-15 14:44:58 -04:00
2026-05-18 00:43:46 -04:00
2026-05-18 00:43:46 -04:00
2026-08-15 19:18:55 -04:00
2026-08-19 08:13:29 -04:00
2026-08-19 08:13:29 -04:00
2026-07-14 20:37:03 -04:00
2026-09-05 19:01:57 -04:00
2026-09-01 13:57:07 +00:00
2026-04-25 11:35:19 -04:00
2026-08-25 22:40:58 -04:00
2026-08-20 23:33:26 -04:00
2026-08-20 23:33:26 -04:00
2026-04-25 11:35:19 -04:00
2026-07-10 23:56:59 -04:00
2026-07-10 23:56:59 -04:00
2026-07-05 20:47:30 -04:00
2026-07-04 14:38:01 -04:00
2026-07-05 20:47:30 -04:00
2026-07-05 19:58:07 -04:00
2026-08-25 14:28:29 -04:00
2026-07-08 16:26:41 -04:00
2026-07-15 01:30:12 -04:00
2026-04-28 12:26:39 -04:00
2026-04-28 12:26:39 -04:00
2026-04-28 16:21:43 -04:00
2026-07-01 17:44:43 -04:00
2026-07-04 04:15:09 -04:00
2026-07-04 04:15:09 -04:00
2026-08-30 21:30:19 -04:00
2026-04-28 12:26:39 -04:00
2026-08-20 13:26:05 -04:00
2026-09-05 10:07:44 -04:00
2026-09-05 10:07:44 -04:00
2026-08-30 21:30:19 -04:00
2026-08-02 00:55:20 +00:00
2026-08-08 20:37:39 +00:00
2026-04-29 15:41:12 -04:00
2026-08-30 21:30:19 -04:00
2026-08-01 23:27:34 +00:00
2026-08-19 08:13:29 -04:00
2026-08-18 12:26:00 -04:00
2026-08-01 23:05:26 +00:00
2026-04-29 15:02:07 -04:00
2026-08-30 21:30:19 -04:00
2026-08-02 00:55:20 +00:00
2026-08-30 21:30:19 -04:00
2026-07-14 20:37:03 -04:00
2026-05-06 13:27:12 -04:00
2026-05-06 08:40:11 -04:00
2026-06-22 20:58:50 -04:00
2026-04-21 19:33:47 -04:00
2026-04-21 20:52:03 -04:00
2026-04-22 12:21:34 -04:00
2026-07-05 18:44:26 -04:00
2026-08-20 19:07:59 -04:00
2026-05-27 10:37:30 -04:00
2026-06-27 21:42:52 -05:00
2026-07-08 13:09:26 -04:00
2026-09-04 11:36:11 -04:00
2026-08-19 08:13:29 -04:00
2026-04-25 11:53:31 -04:00
2026-05-18 15:25:27 -04:00
2026-07-05 12:05:24 -04:00
2026-04-22 09:27:45 -04:00
2026-06-20 23:51:43 -04:00
2026-07-04 11:33:18 -04:00
2026-08-30 21:30:19 -04:00
2026-07-15 01:30:12 -04:00
2026-08-31 22:45:46 -04:00
2026-07-03 18:12:35 -04:00
2026-08-20 13:26:05 -04:00
2026-09-05 20:43:43 -04:00
2026-08-24 08:24:34 -04:00
2026-07-03 03:27:04 -04:00
2026-09-05 20:43:43 -04:00
2026-07-03 18:24:36 -04:00
2026-05-30 12:38:57 -04:00
2026-08-30 21:30:19 -04:00
2026-05-18 08:33:39 -04:00
2026-05-18 03:32:42 -04:00
2026-08-30 21:30:19 -04:00
2026-05-21 13:08:02 -04:00
2026-07-11 09:38:14 -04:00
2026-09-04 11:36:11 -04:00
2026-05-14 22:10:12 -04:00
2026-08-27 22:45:27 -04:00
2026-08-30 21:30:19 -04:00
2026-09-06 13:36:22 -04:00
2026-09-06 13:36:22 -04:00
2026-08-24 08:24:34 -04:00
2026-08-27 00:13:04 -04:00
2026-07-21 09:43:05 -04:00
2026-07-14 23:43:19 -04:00
2026-08-22 19:15:12 +00:00
2026-04-28 12:26:39 -04:00
2026-08-22 01:31:33 +00:00
2026-09-06 13:36:22 -04:00
2026-04-29 18:30:43 -04:00
2026-07-04 13:54:08 -04:00
2026-07-04 13:54:08 -04:00
2026-07-21 09:43:05 -04:00
2026-07-03 20:18:29 -04:00
2026-07-03 14:40:54 -04:00
2026-06-08 18:13:10 -04:00
2026-08-17 14:26:09 -04:00
2026-08-30 21:30:19 -04:00
2026-09-02 14:53:31 +00:00
2026-05-15 00:36:41 -04:00
2026-05-15 00:36:41 -04:00
2026-07-03 23:47:06 -04:00
2026-04-28 12:26:39 -04:00
2026-08-20 23:33:26 -04:00
2026-08-17 19:02:53 -04:00
2026-08-24 08:24:34 -04:00
2026-08-20 23:33:26 -04:00
2026-09-06 13:36:22 -04:00
2026-08-13 16:21:10 -04:00
2026-08-24 08:24:34 -04:00
2026-09-05 10:07:44 -04:00
2026-07-21 15:21:57 -04:00
2026-08-02 04:54:31 +00:00
2026-07-31 14:43:40 +00:00
2026-08-24 08:24:34 -04:00
2026-09-06 15:48:22 -04:00
2026-09-06 15:48:22 -04:00
2026-08-17 16:34:46 -04:00
2026-08-24 08:24:34 -04:00
2026-09-05 10:07:44 -04:00
2026-09-03 12:49:33 +00:00
2026-07-08 16:47:34 -04:00
2026-05-16 10:15:59 -04:00
2026-07-30 20:15:00 +00:00
2026-05-30 19:57:45 -04:00
2026-05-27 13:21:57 -04:00
2026-08-25 22:40:58 -04:00
2026-08-17 03:42:08 -04:00
2026-08-25 20:16:18 -04:00
2026-08-31 12:59:14 -04:00
2026-08-19 23:17:24 -04:00
2026-07-13 22:46:55 -04:00
2026-09-05 10:07:44 -04:00
2026-09-06 13:36:22 -04:00
2026-05-21 16:59:57 -04:00
2026-05-21 16:59:57 -04:00
2026-05-02 22:56:10 -04:00
2026-05-02 22:56:10 -04:00
2026-08-16 12:33:12 -04:00
2026-06-24 22:45:32 -04:00
2026-08-16 12:33:12 -04:00
2026-05-05 08:52:05 -04:00
2026-05-05 08:52:05 -04:00
2026-07-04 14:39:33 -04:00
2026-07-04 14:39:33 -04:00
2026-05-18 00:43:46 -04:00
2026-05-18 00:43:46 -04:00
2026-05-02 13:33:53 -04:00
2026-07-04 11:33:18 -04:00
2026-08-16 18:25:23 -04:00
2026-08-30 21:30:19 -04:00
2026-05-21 13:08:02 -04:00
2026-07-08 15:28:21 -04:00
2026-08-20 13:26:05 -04:00
2026-08-18 10:44:50 -04:00
2026-08-18 10:44:50 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 22:32:01 -04:00
2026-08-24 09:45:48 -04:00
2026-08-21 20:43:20 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-04-28 12:26:39 -04:00
2026-07-03 15:31:17 -04:00
2026-07-30 12:20:38 +00:00
2026-09-04 11:36:11 -04:00
2026-09-04 11:36:11 -04:00
2026-05-29 08:24:05 -04:00
2026-08-30 21:30:19 -04:00
2026-04-28 12:26:39 -04:00
2026-07-14 20:37:03 -04:00
2026-08-17 01:59:02 -04:00
2026-08-21 20:43:20 -04:00
2026-08-18 12:26:00 -04:00
2026-08-18 12:26:00 -04:00
2026-08-18 12:26:00 -04:00
2026-07-10 23:48:59 -04:00
2026-07-13 22:46:55 -04:00
2026-08-18 12:26:00 -04:00
2026-05-02 21:31:48 -04:00
2026-06-27 21:42:52 -05:00
2026-08-02 01:50:34 +00:00
2026-04-29 17:44:12 -04:00
2026-08-02 01:50:34 +00:00
2026-08-24 22:32:01 -04:00
2026-05-29 23:43:02 -04:00
2026-06-01 21:25:42 -04:00
2026-08-24 18:09:02 -04:00
2026-08-25 16:11:47 -04:00
2026-09-01 21:16:17 +00:00
2026-08-26 04:01:55 -04:00
2026-08-17 12:58:09 -04:00
2026-08-30 21:30:19 -04:00
2026-09-06 22:02:05 -04:00
2026-09-06 22:02:05 -04:00
2026-08-24 08:24:34 -04:00
2026-04-21 22:53:27 -04:00
2026-04-28 12:26:39 -04:00
2026-07-04 03:32:48 -04:00
2026-04-28 12:26:39 -04:00
2026-05-16 10:15:59 -04:00
2026-07-13 22:46:55 -04:00
2026-07-13 22:46:55 -04:00
2026-08-12 15:50:41 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 22:32:01 -04:00
2026-08-24 09:45:48 -04:00
2026-08-17 01:59:02 -04:00
2026-08-25 15:31:16 -04:00
2026-08-21 20:43:20 -04:00
2026-08-17 01:59:02 -04:00
2026-08-30 21:30:19 -04:00
2026-08-30 21:30:19 -04:00
2026-07-14 23:24:55 -04:00
2026-07-26 23:56:34 +00:00
2026-08-20 23:33:26 -04:00
2026-06-24 22:28:34 -04:00
2026-05-02 18:36:55 -04:00
2026-05-25 11:46:41 -04:00
2026-08-26 13:23:56 -04:00
2026-09-02 15:15:11 +00:00
2026-08-27 23:56:55 -04:00
2026-07-06 10:07:34 -04:00
2026-09-02 16:24:25 +00:00
2026-09-02 16:24:25 +00:00
2026-07-07 16:51:48 -04:00
2026-07-30 12:20:38 +00:00
2026-07-30 12:20:38 +00:00
2026-07-03 10:15:49 -04:00
2026-07-03 12:17:03 -04:00
2026-05-27 10:09:30 -04:00
2026-05-07 20:01:34 -04:00
2026-08-15 19:18:55 -04:00
2026-07-04 11:33:18 -04:00
2026-07-04 11:33:18 -04:00
2026-05-06 08:40:11 -04:00
2026-05-06 08:40:11 -04:00
2026-08-30 21:30:19 -04:00
2026-08-30 21:30:19 -04:00
2026-05-18 00:03:20 -04:00
2026-05-18 00:03:20 -04:00
2026-08-30 21:30:19 -04:00
2026-05-03 17:40:18 -04:00
2026-05-03 17:40:18 -04:00
2026-04-28 12:26:39 -04:00
2026-04-28 12:26:39 -04:00
2026-08-27 10:35:39 -04:00
2026-07-11 14:30:32 -04:00
2026-07-10 23:48:59 -04:00
2026-04-25 11:35:19 -04:00
2026-04-21 19:33:47 -04:00
2026-08-27 10:35:39 -04:00
2026-09-01 12:54:19 +00:00
2026-04-25 11:35:19 -04:00
2026-04-21 23:59:54 -04:00
2026-04-28 12:26:39 -04:00
2026-07-10 23:32:22 -04:00
2026-07-04 02:06:58 -04:00
2026-07-04 02:06:58 -04:00
2026-09-01 12:06:08 +00:00
2026-09-02 16:24:25 +00:00
2026-08-25 22:40:58 -04:00
2026-05-09 18:19:33 -04:00
2026-07-08 11:58:41 -04:00
2026-08-17 09:03:44 -04:00
2026-08-17 14:26:09 -04:00
2026-08-20 23:33:26 -04:00
2026-09-02 12:33:08 +00:00
2026-09-02 12:05:57 +00:00
2026-09-04 11:36:11 -04:00
2026-09-04 11:36:11 -04:00
2026-04-22 12:21:34 -04:00
2026-04-22 12:21:34 -04:00
2026-08-21 20:43:20 -04:00
2026-08-15 08:22:09 -04:00
2026-08-22 03:43:15 +00:00
2026-08-22 05:09:29 +00:00
2026-09-05 10:07:44 -04:00
2026-09-05 10:07:44 -04:00
2026-09-06 15:48:22 -04:00
2026-09-04 11:36:11 -04:00
2026-07-08 11:49:01 -04:00
2026-09-04 11:36:11 -04:00
2026-08-17 01:59:02 -04:00
2026-08-17 01:59:02 -04:00
2026-08-22 01:41:31 +00:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-08-22 05:09:29 +00:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-08-24 09:45:48 -04:00
2026-08-17 05:19:25 -04:00
2026-08-22 05:09:29 +00:00
2026-08-22 05:21:01 +00:00
2026-08-23 02:32:43 +00:00
2026-08-23 02:16:35 +00:00
2026-04-29 14:35:49 -04:00
2026-04-29 14:35:49 -04:00
2026-07-08 11:58:41 -04:00
2026-07-08 11:58:41 -04:00
2026-05-02 13:33:53 -04:00
2026-07-14 20:37:03 -04:00
2026-07-14 20:37:03 -04:00
2026-04-08 20:30:39 +00:00
2026-04-10 23:12:59 +00:00
2026-07-05 22:23:12 -04:00
2026-07-08 11:58:41 -04:00