Skip to content
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

X-Frame-Options header is deprecated #5977

Open
albinkc opened this issue Nov 17, 2024 · 3 comments
Open

X-Frame-Options header is deprecated #5977

albinkc opened this issue Nov 17, 2024 · 3 comments

Comments

@albinkc
Copy link

albinkc commented Nov 17, 2024

Environment

  • Elixir version (elixir -v):
    Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
    Elixir 1.17.3 (compiled with Erlang/OTP 27)

  • Phoenix version (mix deps): phoenix 1.7.14

  • Operating system: MacOS 15.1 ARM

  • Firefox 132.0.2

Actual behavior

From MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
X-Frame-Options

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Warning: Instead of this header, use the frame-ancestors directive in a Content-Security-Policy header.

@josevalim
Copy link
Member

We should probably starting setting a content-security-policy header. I would at least set it to frame-ancestors 'none'; base-uri 'self'; object-src 'none'; although the base-uri is debatable.

An other option is to set this as a meta tag. It gives more visibility to users instead of hidden behind a function.

@albinkc
Copy link
Author

albinkc commented Nov 19, 2024

looks like the frame-ancestors directive is not supported in the <meta> element

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors

@josevalim
Copy link
Member

Thanks for double checking. That's one fewer question to ask then. :)

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

No branches or pull requests

2 participants