Skip to content

Add allowed origins config and stronger validation#4

Merged
benbjurstrom merged 1 commit into
mainfrom
origin-validation
Apr 20, 2026
Merged

Add allowed origins config and stronger validation#4
benbjurstrom merged 1 commit into
mainfrom
origin-validation

Conversation

@joetannenbaum

Copy link
Copy Markdown
Collaborator

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_origins config 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.

@benbjurstrom benbjurstrom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is worth keeping as it gives the developer a little more control over the origin then RP_ID alone.

@benbjurstrom benbjurstrom merged commit bce1ca1 into main Apr 20, 2026
28 checks passed
@benbjurstrom benbjurstrom deleted the origin-validation branch April 20, 2026 16:00
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