繁体   English   中英

黑客是否可以从 iframe 外部检查保存到“窗口”的 javascript object?

[英]Is it possible for a hacker to inspect a javascript object saved to `window` from outside of an iframe?

我确信这一定是以前在这里问过的,但不太确定要搜索什么,所以我没有看到任何结果。

我有一个 iFrame 加载一个 HTML canvas 游戏。 该游戏还有一个config object,其中保存了一些数据(点等)。 配置保存到window 假设游戏运行在https://example.com

现在,当我到达那个 URL 并玩它时,我当然可以通过在 JS 控制台上键入config来访问私人游戏数据。

但是当我在另一个页面中运行 iFrame 时(比如在https://the-game.com上),当我在控制台输入config时,我当然无法访问任何内容。

我的问题是这是否安全。 My server-side logic prevents the iframe from being loaded from anywhere other than https://the-game.com so theoretically a hacker should never be able to inspect the config object but I am wondering if there are any security issues here that I应该知道吗?

任何指针将不胜感激!

谢谢

在此处输入图像描述

可以从控制台访问您在 iframe 中的网站

您可以通过单击“框架图标”(右上角)更改控制台的目标框架

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM