【发布时间】:2018-09-22 13:51:28
【问题描述】:
我在我的网站上使用 SockJS,我正在使用端点 /msg
当我转到 mysitename.com/msg/iframe.html 时,它显示了这个页面:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
document.domain = document.domain;
_sockjs_onload = function(){SockJS.bootstrap_iframe();};
</script>
<script src="https://cdn.jsdelivr.net/sockjs/1.0.0/sockjs.min.js"></script>
</head>
<body>
<h2>Don't panic!</h2>
<p>This is a SockJS hidden iframe. It's used for cross domain magic.</p>
</body>
</html>
SockJS 是如何做到这一点的?
【问题讨论】:
-
关于这个问题的任何更新?这是一次安全攻击,我想防止这种情况发生吗?
标签: javascript sockjs