Repository navigation
fix: a client without a secret cannot authenticate to token introspection (0.5.0-rc71) - #322
Merged
ciresnave-bot merged 1 commit intoOct 27, 2026
Conversation
|
Sorry @ciresnave-bot, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 2 days and 16 hours by commenting |
Reviewer's GuideThis backport centralizes client-secret handling with Argon2id storage and legacy migration, prevents secretless clients from authenticating to introspection, authenticates confidential clients before authorization-code processing while preserving public-client PKCE rules, and adds focused regression tests for the affected OAuth2 flows. Sequence diagram for introspection client authenticationsequenceDiagram
participant Caller
participant Introspection as oauth_advanced
participant Storage
participant Secret as client_secret
Caller->>Introspection: verify_client_credentials
Introspection->>Storage: get_kv
Storage-->>Introspection: client record
Introspection->>Secret: is_confidential
alt Client has hashed or legacy secret
Introspection->>Secret: authenticate
Secret-->>Introspection: true or false
Introspection-->>Caller: introspection response or invalid_client
else Client has no secret
Secret-->>Introspection: false
Introspection-->>Caller: invalid_client 401
end
Sequence diagram for authorization-code client authenticationsequenceDiagram
participant Client
participant Token as oauth2
participant Storage
participant Secret as client_secret
Client->>Token: handle_authorization_code_grant
Token->>Token: authenticate_token_client
Token->>Storage: load_client_record
Storage-->>Token: client record
Token->>Secret: is_confidential
alt Confidential client
Token->>Secret: authenticate
Secret-->>Token: authenticated or rejected
alt Authentication succeeds
Token->>Storage: load authorization code
Token-->>Client: token response
else Authentication fails
Token-->>Client: invalid_client
end
else Public client
Token->>Storage: load authorization code
Token-->>Client: token response or invalid_request without PKCE
end
Flow diagram for hashed and legacy client-secret handlingflowchart TD
Register[POST /oauth/register] --> Hash[hash_secret]
Hash --> HashedRecord[Store client_secret_hash]
Record[oauth2_client record] --> Classify[is_confidential]
Classify -->|hashed secret| Verify[authenticate]
Classify -->|legacy plain secret| Verify
Classify -->|no usable secret| Public[Public client]
Verify -->|success for legacy record| Upgrade[upgrade]
Upgrade --> HashedRecord
Verify -->|success| Allow[Allow confidential-client operation]
Verify -->|failure| Reject[Return invalid_client]
Public --> Reject
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ciresnave-bot
force-pushed
the
fix/introspection-secretless-client-0.5.x
branch
2 times, most recently
from
October 27, 2026 01:25
3e70bfe to
3cc50a9
Compare
…tion (0.5.0-rc71) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013YEhSGGFctL3d4hGevi7tC
ciresnave-bot
force-pushed
the
fix/introspection-secretless-client-0.5.x
branch
from
October 27, 2026 04:25
3cc50a9 to
7b5177b
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.
Backport of #321 to release/0.5.x; stacked on #320 (and so on #319): merge those first.
/oauth/introspectlet a client record with no, an empty or a non-stringclient_secretauthenticate with an empty presented secret; such a client now getsinvalid_client(401). Clients with a secret, and clients fromPOST /oauth/register, are unaffected. Only secret-less (public) clients an operator wrote into storage were affected, and the caller still needs the token it asks about.Red first, in Docker (rust:latest,
--features api-server,axum-integration, jobs=2): with only the new test file,a_client_without_a_secret_cannot_introspectfails on this line's code anda_client_with_a_secret_still_introspectspasses; with the fix both pass, plusauth_flow_tests12,oauth2_client_secret_hash_tests3,oauth2_code_grant_client_auth_tests7,oauth_advanced_tests19;cargo fmt --all -- --checkclean. Not run: the rest of the suite. This line has nointrospection_status_tests.Version 0.5.0-rc71 (PM-allocated). GHSA (Low) and RustSec after the fixed versions are live.
🤖 Generated with Claude Code
Summary by Sourcery
Require a valid client secret for OAuth token introspection while preserving access for properly credentialed clients.
Bug Fixes:
Tests:
Chores: