首页 > 解决方案 > 在 IE11 上的 ms-word 插件中获取“HTTPS 安全性受到威胁”

问题描述

正如标题所述,我在使用 iframe 显示我的页面时遇到问题x-frame-options: sameorigin

看着可能的解决方案,我遇到了x-frame-options: allow-from url,这没有任何区别。我的所有资源也通过 https 提供。当同时使用x-frame-options: sameoriginX-Frame-Options: allow-from url时,sameorigin 标头被禁用。

此外,在此处x-frame-options找到的文档:

# ALLOW-FROM uri 
This is an obsolete directive that no longer works in modern browsers. Don't use it. In 
supporting legacy browsers, a page can be displayed in a frame only on the specified origin 
uri. Note that in the legacy Firefox implementation this still suffered from the same problem 
as SAMEORIGIN did — it doesn't check the frame ancestors to see if they are in the same origin.
The Content-Security-Policy HTTP header has a frame-ancestors directive which you can use 
instead.

我目前已经为其他浏览器的支持实现了上述frame-ancestors功能,例如。Chrome、Safari 或 Firefox,但 IE11 不支持。这是一个安全层,我不想删除它以避免点击劫持。

有什么建议吗?

标签: iframems-wordinternet-explorer-11x-frame-optionsclickjacking

解决方案


如问题中所述,我发现在附加另一个x-frame-options标头时,sameorigin已禁用。

所以我稍微修改了标题,发现以下内容对 IE11 非常有效,并且不影响其他浏览器:

res.set("X-Frame-Options", "SAMEORIGIN, ALLOW-FROM url");

推荐阅读