Harden the authorization-code grant and UserInfo verification
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 37s
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 37s
Closes the local protocol surface of gap G01 from the scope assessment (KEY-WP-0016). The browser grant validated PKCE, client id and scopes but left four bindings unenforced, and UserInfo verified less than the caller CLI does. Authorization-code path: bind the exchange to the redirect URI the code was issued for, refuse clients whose registration does not permit the grant, and authenticate confidential clients with a digest-based constant-time comparison over the same credential sources as the service grant. An empty grantTypes stays an implicit authorization-code client, matching config validation. Code consumption: SessionStore.Consume reads and deletes under one lock. The previous Get/Delete pair spanned JWT signing, and the added test reproduces the race against that version -- 9 of 16 concurrent exchanges succeeded, and a failed exchange left the code replayable. UserInfo: check the JOSE header algorithm before trusting the signature, require the configured issuer, and require an access token rather than accepting an ID token of the right shape. Purpose is decided on the scope claim so the issued token contract, which consumers pin exactly, does not change. SCOPE.md and the assessment record which bindings are now enforced and that the Authelia upstream-trust assumption remains open, so G01 is not fully closed and no profile-conformance claim is made. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NV9oijZukGyGbRQGGKnK4P Assistant: claude-code Assistant-Model: opus Assistant-Process: 713576@bnt-lap001 Assistant-Session: 384c511d-9bce-4cb8-a676-2aef6c0c8df6
This commit is contained in:
parent
217223b4d1
commit
139b6ff351
13 changed files with 644 additions and 25 deletions
|
|
@ -82,6 +82,17 @@ redirect/grant mismatch, issuer/token-purpose mismatch and concurrent code reuse
|
|||
Validate upstream provider tokens or explicitly establish and test the chosen
|
||||
transport/trust contract. This assessment does not claim a demonstrated attack.
|
||||
|
||||
**Status 2026-09-06 (KEY-WP-0016): partially closed.** The local protocol
|
||||
surface is now enforced and covered by negative tests — redirect-URI binding,
|
||||
grant-type eligibility on the browser path, confidential-client authentication
|
||||
with a constant-time comparison, atomic single-use code consumption (the
|
||||
Get/Delete race was reproduced first: 9 of 16 concurrent exchanges succeeded
|
||||
before the fix), and UserInfo algorithm, issuer and access-token-purpose checks.
|
||||
Still open: the Authelia adapter's unverified upstream ID-token claims and its
|
||||
transport-trust assumption, which is a trust-contract decision rather than a
|
||||
local binding. G01 is not fully closed until that is settled, and none of this
|
||||
establishes complete profile conformance.
|
||||
|
||||
### G02 — Machine-readable contract and discovery lag the runtime
|
||||
|
||||
**Priority: high. Kind: contract drift.**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue