Skip to content

chore: update iframe doc #2263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions docs/troubleshooting/30_iframes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,26 @@ sidebar_label: Troubleshooting iframes
---

Iframes can pose a significant security risk for authentication services due to many attack vectors such as clickjacking, iframe
injection, iframe phishing, and many others.
injection, iframe phishing, and many others. Most browsers have implemented measures to block cookies in iframe contexts, which
breaks authentication, CSRF-prevention, and sessions.

Safari has additionally implemented a feature called
[Intelligent Tracking Prevention](https://webkit.org/blog/7675/intelligent-tracking-prevention/) that blocks third-party cookies
by default in iframe contexts, which breaks authentication, CSRF-prevention, and sessions. Chrome is planning on rolling out the
same changes in 2024.
- Safari has implemented [Intelligent Tracking Prevention](https://webkit.org/blog/7675/intelligent-tracking-prevention/) that
blocks third-party cookies by default.
- Firefox has implemented
[Total Cookie Protection](https://blog.mozilla.org/en/mozilla/firefox-rolls-out-total-cookie-protection-by-default-to-all-users-worldwide/)
by default. This gives third-party cookies a separate cookie jar per site, preventing cross-site tracking.
- Google Chrome only blocks third-party cookies in Incognito mode by default, but users can set it to block all third-party
cookies. As alternative Google implemented FedCM, which Ory supports as well, read more about
[FedCM](../kratos/social-signin/fedcm.mdx).
- Edge blocks trackers by default. Microsoft are also exploring blocking third-party cookies in Edge by default.
- Brave browser blocks third-party cookies by default.

We therefore discourage use of iframes when using Ory and have implemented HTTP headers (`X-Frame-Options: DENY`) indicating to
browsers that iframes can not be used with the Ory Account Experience.
:::danger

Authentication flows Login, registration, MFA and other identity flows must not be embedded inside an iframe! Embedding these
flows increases risk of phising, session hijacking, and click jacking.

:::

Ory has implemented HTTP headers (`X-Frame-Options: DENY` and `Content-Security-Policy: frame-ancestors 'none'`) to indicate to
browsers that iframes can't be used with the Ory Account Experience.
Loading