mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-09 09:13:02 +03:00
FIDO2 WebAuthn frame no longer loads in Web Vault #1026
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Originally created by @ducmthai on GitHub.
FIDO2 WebAuthn prompt frame does not load
The iframe is saying
my-selfhost-vault.comrefused to connect.my-selfhost-vault.comis served through CloudflareDeployment environment
Install method: docker
Clients used: web vault
Reverse proxy and version: nginx 1.18
MySQL/MariaDB or PostgreSQL version: N/A
Other relevant details: Cloudflare -> nginx -> vaultwarden docker
Steps to reproduce
Setup a Yubikey as FIDO2 WebAuthn 2fa, then login via webvault
Expected behaviour
The FIDO2 WebAuthn page should prompt for a toutch/tap the security key.
Actual behaviour
The iframe where
/images/u2fkey.webpis usually showed just saysmy-selfhost-vault.comrefused to connect.Troubleshooting data
1.25.0-alpineworks with/webauthn-connector.html?data=<token>hasx-frame-options: SAMEORIGINin its response header.1.26.0-alpinedoes not have this header.1.26.0
1.25.0
@ducmthai commented on GitHub:
Adding
add_header X-Frame-Options "SAMEORIGIN";to nginx.conf fixed the issue.@BlackDex commented on GitHub:
Just as a follow-up.
All the correct headers are already sent by Vaultwarden, including that one. There are probably other headers which you may overrides out not. I suggest to not override any header and keep most of these as is.
Also, using this setting will probably break the desktop client.
@ducmthai commented on GitHub:
Hmm, if so, I wonder why 1.25 works and 1.26 doesn't.
Update: I just tried 1.25/1.26 without the header override and Desktop client still does not load the frame. This time I also skipped Cloudflare through DNS rewrite.
Additional errors in DevTools of the Desktop Client:
For 1.25:
Refused to frame 'https://my-selfhosted-vault.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'For 1.26 (Same error with webvault)
Refused to display 'https://my-selfhosted-vault.com/' in a frame because it set 'X-Frame-Options' to 'deny'.Update 2: I do have this in my nginx.conf.
I gave this header value "ALLOW" for vaultwarden so that the client would ignore it and it works.