docs(spec): verify the admin console session JWT against the service JWKS - #18
Draft
antstanley wants to merge 1 commit into
Draft
docs(spec): verify the admin console session JWT against the service JWKS#18antstanley wants to merge 1 commit into
antstanley wants to merge 1 commit into
Conversation
This was referenced Aug 5, 2026
antstanley
force-pushed
the
spec/verify-admin-ui-session-jwt
branch
2 times, most recently
from
August 5, 2026 08:22
42ba77d to
1183460
Compare
antstanley
marked this pull request as draft
August 5, 2026 08:25
This was referenced Aug 5, 2026
antstanley
force-pushed
the
spec/verify-admin-ui-session-jwt
branch
from
August 5, 2026 09:00
1183460 to
fd8765d
Compare
antstanley
force-pushed
the
spec/verify-admin-ui-session-jwt
branch
from
August 5, 2026 11:29
fd8765d to
c6e42a8
Compare
antstanley
changed the base branch from
spec/rotate-refresh-tokens
to
spec/own-outbound-http-boundary
August 5, 2026 11:31
…JWKS Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
antstanley
force-pushed
the
spec/verify-admin-ui-session-jwt
branch
from
August 5, 2026 12:01
c6e42a8 to
84211d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Stacked PR 10 of 16 — part of stack #35, which targets
main.Base: #33 (
spec/own-outbound-http-boundary) · Followed by: #26This PR's diff shows only its own change. Merge the stack bottom-up; do not merge this before its base.
Why it sits at position 10: Declared prerequisite of #26: the admin plane cannot be hardened while the console still authorizes on an unverified JWT.
Scope of this PR
This PR currently carries the change spec. It will also carry the implementation plan and the build work for that spec — plan and code land as later commits on this same branch, so the spec, its plan, and its implementation review and merge as one unit.
Review order within the PR: spec first, then plan, then implementation.
Change spec proposing that the admin console verify the session JWT it authorizes on.
Problem.
apps/admin-uidecodes the session cookie's JWT payload and trusts its claims without verifying the signature (hooks.server.ts), and the publicPOST /loginaction mints a session cookie from a caller-supplied JWT the same way (login/+page.server.ts). A hand-built{"sub":"x","role":"admin","exp":<future>}with arbitrary signature bytes is accepted, after which every request is made withINTERNAL_API_SECRETon the caller's behalf.Proposed delta. Resolve key material through the existing
GET /.well-known/openid-configuration→jwks_urisurface and verify the JWS signature before any claim influences a decision, collapsing the session gate and the login action onto oneverifyAccessTokenhelper and deletingdecodeJwtPayload. Pin the algorithm to the discovery document, select bykid, requireexp/iss/aud/subto be present rather than merely correct when present, replacehasAdminClaim'sString()coercion with an exact type-checked comparison, and set the cookie__Host-admin_sessionwithsecure/httpOnly/sameSite: strict. Every failure path is one fail-closed outcome: no session.Notes.
getJwksalready exists insrc/lib/auth.tswith zero call sites — the verification primitive is present and dead.audmakes[token] audiencea hard deployment prerequisite: the service issuesaud: ""when it is unset (unwrap_or_default()). Recorded as an Assumption.apps/admin-uiis deployed anywhere is unresolved and recorded as an Open question; it is explicitly non-blocking for acceptance.Drafted with the
spec-creatorplugin from a deep security scan of the repository at53cbdec9. Spec only — no source changes.