【问题标题】:Getting `HTTPS security is compromised` in ms-word addin on IE11在 IE11 上的 ms-word 插件中获取“HTTPS 安全性受到威胁”
【发布时间】:2020-10-20 07:20:54
【问题描述】:

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

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

另外,x-frame-options 上的文档在 here 上找到:

# 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 不支持。这是一个安全层,我不想删除它以避免点击劫持。

有什么建议吗?

【问题讨论】:

  • 您能否告诉我们,您在哪里实现这些响应标头?你只尝试过x-frame-options: sameorigin吗?这对IE浏览器有效吗?请尝试检查任何资源文件(如 JS、CSS 或任何其他文件)是否使用 HTTP 协议。它可能会导致此错误。
  • 我设法找到了一个适用于 IE11 并且不影响其他浏览器的解决方案。这些标头是在服务器端添加的。

标签: iframe ms-word internet-explorer-11 x-frame-options clickjacking


【解决方案1】:

正如问题中所解释的,我发现在附加另一个 x-frame-options 标头时,sameorigin 被禁用。

所以我稍微修改了标题,发现以下内容在 IE11 上完美运行,并且不影响其他浏览器:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-11
    • 2012-06-19
    • 2011-07-16
    相关资源
    最近更新 更多