PPT-2536: introspection + OIDC id_token specs (IR-01/02/07, OI-01/02/03/07) - #17
Merged
Merged
Conversation
Implements PPT-2536 test-matrix rows IR-01, IR-02, IR-07 and OI-01, OI-02, OI-03 plus the issuer half of OI-07. 26 examples, 3 pending. IR-02 is the security regression test for the empty-client-id introspection bypass fixed in 67114b2: before that commit `authenticate_introspection_caller` handed back an empty string as the caller's client id and the cross-client guard skipped itself, so any holder of any valid access token could read back another application's token state, client_id, scope and exp. The new example asserts the exact rejection (401 / `invalid_token`), asserts the rejection body carries none of those four fields and never contains the victim's client id, and runs the owner's successful introspection in the same example as a positive control so the 401 cannot pass vacuously. Companion examples cover the two literal empty-identity shapes (`client_id=` in the body, HTTP Basic with an empty user part). IR-01 enumerates the three caller-authentication failures Doorkeeper distinguished - no credentials -> 400 invalid_request, bad client -> 401 invalid_client, bad bearer -> 401 invalid_token - with the WWW-Authenticate and Cache-Control headers each carries. IR-03 was already fully covered by token_meta_spec.cr and is not duplicated. OI-01/OI-02 assert claim *values*, not presence: `iss` is exactly the legacy POS issuer, `aud` is exactly the requesting client_id, and `sub` is the resource owner's user id and provably not the jti, the client id or the audience - the invariant the Code#jwt and Grant#generate_id_token adapter patches exist to preserve. The same subject is asserted across the id_token, the access token and userinfo. OI-03 forges alg=none and RS256-as-HS256 (keyed on the published public key) variants of a live access token and asserts every JWT-consuming surface rejects them, with the genuine token accepted at those same surfaces as the control. Two known gaps are recorded as pending rather than asserted as correct: revocation does not cascade between an access token and its refresh token in either direction (IR-07), and the id_token carries no exp/iat (OI-02). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
P1 coverage for introspection/revocation and OIDC id_token. Test-only.
IR-02 — the introspection bypass is ABSENT from current code. It was real (
authenticate_introspection_callerreturned""for bearer callers and the guard short-circuited on the empty string, letting any bearer holder read any token'sactive/client_id/scope/exp) and was fixed in67114b2. The new spec pins it from the attacker's side: exact401+invalid_token, none of the four disclosed fields present, and the victim app's own successful introspection run in the same example as a positive control so the 401 cannot pass vacuously.OI-03 — no defect. Both
Authly.jwt_decodeandUserJWT.decodepin RS256 explicitly. Verified by forgingalg=noneand RS256→HS256 (keyed on the published public key) variants of a live token and asserting rejection at four surfaces, with the genuine token accepted at the same four.IR-03 was already fully covered in
token_meta_spec.cr(lines 99, 142, 157, 175) — reported, not duplicated. The matrix's ◐ should be ✅.Defects pinned as
pending, not silently skippedvalidate_code!never consults the token store and the refreshjtiis never persisted, soPOST /auth/revokeand logout do not end a session; the token keeps minting access tokens for 30 days. Doorkeeper had no such gap. Naive enforcement would break RF-05 (P0 double-submit tolerance), so it needs the refresh jti linked to the access-token row.id_tokencarries noexp/iat, both REQUIRED by OIDC Core §2. Interop only; nothing in PlaceOS consumes the id_token.201 examples, 0 failures, 4 pending— green on crystal latest and unstable.🤖 Generated with Claude Code