Add allowed origins config and stronger validation#4
Merged
Conversation
benbjurstrom
approved these changes
Apr 20, 2026
benbjurstrom
left a comment
Member
There was a problem hiding this comment.
I think this is worth keeping as it gives the developer a little more control over the origin then RP_ID alone.
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.
I'll be honest, not totally sure about this one. I think it's helpful, but it also might be noisy, so let me know what you think.
The WebAuthn ceremony factory was being configured with
setAllowedOrigins([]), which routed origin checking through a path that could silently fall through for non-matching HTTPS origins. In practice we were relying on the RP ID hash check to catch mismatches, but the allow-list check itself wasn't doing anything useful.Adds a new
allowed_originsconfig key (defaults to[config('app.url')]) and pipes it into the ceremony factory. Empty configuration now throws instead of silently degrading, so misconfiguration is loud.