postMessage 的第二个参数存在中危漏洞
作者: ZhangXiang521创建于 2025年4月7日更新于 2025年4月9日
postMessage: function(type, data) { if (global.parent !== global) { global.parent.postMessage(JSON3.stringify({ windowId: module.exports.currentWindowId, type: type, data: data || '', }), '*'); } else { debug('Cannot postMessage, no parent window.', type, data); } 使用代码安全卫士扫描出 postMessage 第二个参数 * 存在中危漏洞,如何整改,我可以传 window.location.origin 吗,会不会影响源代码的正常功能
内容来源: sockjs/sockjs-client