Skip to content

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

Merged
lovasoa merged 1 commit into
sqlpage:mainfrom
81reap:mutation/08-oidc-o1
Sep 2, 2026
Merged

fix(oidc) :: compare logout in constant time#1423
lovasoa merged 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
@lovasoa
lovasoa marked this pull request as draft September 2, 2026 21:26
@lovasoa
lovasoa marked this pull request as ready for review September 2, 2026 21:28
@lovasoa
lovasoa merged commit 05a9fe3 into sqlpage:main Sep 2, 2026
51 checks passed
@lovasoa

lovasoa commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

thanks!

@lovasoa

lovasoa commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

leaks the leading correct bytes from the response time is still not demonstrated though. Probably better worded as "could theoretically leak ... in ideal conditions"

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.

2 participants