Notification permission / push hijack
Trigger Notification.requestPermission so the attacker domain can later push notifications.
sandbox ポリシー別の挙動
| ポリシー | 想定結果 |
|---|---|
| sandbox 未指定 | 動作 |
sandbox="allow-scripts" | 動作 |
sandbox="" (最も厳格) | ブロック |
Embed スニペット
このスニペットは埋め込み専用ページを使用します。自サービスに貼り付けてレンダリング/ブロックの挙動を確認してください。
<iframe src="https://xss-playground.com/embed/notification-permission?lang=ja" title="XSS Playground - Notification permission / push hijack" width="600" height="420" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"></iframe>
실행
// 로그 없음
해설
- 최신 크롬은 사용자 제스처 + 메인 프레임 + 안전한 origin 을 요구해서 iframe 안의 자동 호출은 보통 차단됩니다. 사파리/파폭은 정책이 더 느슨할 수 있습니다.
- 위험성은 즉시 정보 탈취가 아니라 이후 사용자가 다른 페이지를 보고 있을 때 attacker 도메인이 푸시 알림으로 피싱 가능 해진다는 점입니다.
- iframe 에서 권한 프롬프트가 뜨려면
allow="notifications"가 필요한 브라우저도 있습니다. 임의 호스트 iframe 이라면 절대 부여하면 안 됩니다.