Skip to content

fix(oidc) :: compare logout in constant time - #1423

Open
81reap wants to merge 1 commit into
sqlpage:mainfrom
81reap:mutation/08-oidc-o1
Open

fix(oidc) :: compare logout in constant time#1423
81reap wants to merge 1 commit into
sqlpage:mainfrom
81reap:mutation/08-oidc-o1

Conversation

@81reap

@81reap 81reap commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Logout URLs are signed with an HMAC over the redirect URI so that an attacker can't forge a logout URL. Verification compared the tags with !=, which lowers to a memcmp and leaks the leading correct bytes from the response time. Mac::verify_slice compares every byte before deciding.

We also end up dropping a base64 encode/decode round trip and a now unreachable "Failed to decode expected signature" branch.

Before verification compared the HMACs with an slice comparison. `Mac::verify_slice` removes the base64-encoding and decoding.
@81reap
81reap marked this pull request as ready for review September 2, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant