#29429 closed enhancement (fixed)
Support frame-ancestors directive over X-Frame-Options
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Security | Keywords: | dev-feedback has-patch 2nd-opinion |
| Focuses: | Cc: |
Description
According to MDN, X-Frame-Options is deprecated: https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options
frame-ancestors should be used instead.
Previously #12293
Attachments (3)
Change History (17)
#1
@
11 years ago
- Milestone changed from Awaiting Review to Future Release
- Type changed from defect (bug) to enhancement
#7
@
6 years ago
- Keywords has-patch added; needs-patch removed
I looked for any other use of X-Frame-Options - but it only appears in two spots. The customize manager class already provides both headers. This is a change to the send_frame_options_header(). Testing in the WP admin shows both headers being issued, no change to behavior from what I can tell using the latest Chrome. The original header is being kept for continued security benefit in older browsers.
Here is my repo's pull request if needed:
#8
@
5 months ago
- Keywords 2nd-opinion added
Hey Everyone,
I have just taken a look into this, and it looks like the previous PR can be added without any real issues. However to make it clearer I have put this change into a .patch file which I will attach shortly. I think this is a pretty low risk patch, and would definitely be a positive to get merged into core at some point in the coming milestones, but perhaps we need a second opinion here?
This ticket was mentioned in PR #9561 on WordPress/wordpress-develop by @josephscott.
4 months ago
#9
https://core.trac.wordpress.org/ticket/29429
My original concern was the lack of a headers_sent() in the send_frame_options_header() function, but after having found 29429 I think it makes sense to do both at the same time.
#10
@
4 months ago
My original concern regarding the send_frame_options_header() function was the lack of a headers_sent() check. But having found this ticket, and both changes being very small, I think it makes sense to do them both at the same time.
This ticket was mentioned in Slack in #core by josephscott. View the logs.
4 months ago
#12
in reply to:
↑ description
@
4 months ago
- Owner set to SergeyBiryukov
- Status changed from reopened to accepted
Replying to danielbachhuber:
According to MDN,
X-Frame-Optionsis deprecated: https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options
frame-ancestorsshould be used instead.
It appears that X-Frame-Options is no longer marked as deprecated as of January 2025:
- mdn/browser-compat-data: Undeprecate X-Frame-Options #25663
- mdn/content: Tone down X-Frame-Options warning #37774
That said, adding Content-Security-Policy: frame-ancestors still makes sense to me.
We'd need to do at a minimum both to support older browsers.