Notification permission / push hijack
Trigger Notification.requestPermission so the attacker domain can later push notifications.
Behavior by sandbox policy
| Policy | Expected result |
|---|---|
| No sandbox | works |
sandbox="allow-scripts" | works |
sandbox="" (strictest) | blocked |
Embed snippet
This snippet uses the dedicated embed page. Paste it into your own service and check rendering or blocking behavior.
<iframe src="https://xss-playground.com/embed/notification-permission?lang=en" 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 이라면 절대 부여하면 안 됩니다.