popup / window.open 垃圾弹窗
通过 window.open 打开新窗口,检查 popup 阻止、allow-popups、opener 和 tabnabbing 边界。
按 sandbox 策略的行为
| 策略 | 预期结果 |
|---|---|
| 无 sandbox | 通过 |
sandbox="allow-scripts" | 阻止 |
sandbox="" (最严) | 阻止 |
Embed 代码
此代码使用专用嵌入页面。粘贴到您的服务后检查渲染或拦截行为。
<iframe src="https://xss-playground.com/embed/popup-spam?lang=zh" title="XSS Playground - popup / window.open 垃圾弹窗" width="600" height="420" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"></iframe>
执行
// 无日志
说明
- 浏览器会阻止没有用户手势的 window.open,但用户刚点击过 iframe 区域后通常可能通过。
- 如果
sandbox中没有allow-popups,popup 会被阻止。允许任意主机 iframe 时,应去掉该关键字。 - 如果弹窗与 opener 同源,也可能发生 opener-based tabnabbing。cross-origin 父页面直接影响较小,但
opener.location写入即使 cross-origin 也可能被允许。