fix(oidc): constant-time PKCE code_challenge compare; validate nbf on at+jwt verifier #274
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/bunyip!274
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-263-pkce-constant-time-nbf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
BUNYIP-263: two narrow validation polish items the audit surfaced.
PKCE:
consume_authorization_codecomparedchallenge_computed != row.code_challengewith String!=, which short-circuits per byte. Both sides are deterministic SHA-256 base64url derivatives, so the practical leak surface is small, but constant-time compare is the canonical posture andsubtle::ConstantTimeEqdoes it in two lines.at+jwt verifier:
verify_at_jwt_claimsenabledvalidate_expbut notvalidate_nbf. An at+jwt with a futurenbf(clock-skew replay, mint-side regression) was accepted at userinfo before its intended start time. The 30s leeway already absorbs normal clock drift; anything beyond that is a real signal worth blocking, so flippingvalidate_nbf = truecosts nothing on the happy path and closes the gap.Adds
subtle = "2"as a bunyip-oidc dependency. No schema change, no mint-side change, no UX change.#BUNYIP-263