sendBeacon / fetch exfiltration
Exfiltrate everything observable inside the iframe to an attacker server.
sandbox ポリシー別の挙動
| ポリシー | 想定結果 |
|---|---|
| sandbox 未指定 | 動作 |
sandbox="allow-scripts" | 動作 |
sandbox="" (最も厳格) | ブロック |
Embed スニペット
このスニペットは埋め込み専用ページを使用します。自サービスに貼り付けてレンダリング/ブロックの挙動を確認してください。
<iframe src="https://xss-playground.com/embed/beacon-exfil?lang=ja" title="XSS Playground - sendBeacon / fetch exfiltration" width="600" height="420" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"></iframe>
실행
document.referrer
-navigator.userAgent
-// 로그 없음
해설
- iframe 안에서 일어난 클릭/키 입력은 자기 origin 이라 자유롭게 수집할 수 있습니다. iframe 위에 가짜 입력 필드를 두면 사용자가 거기 친 비밀번호 그대로 attacker 서버로 보낼 수 있습니다.
document.referrer로 부모 페이지 URL 의 origin / path 까지 확인 가능합니다 (Referrer-Policy 에 따라 다름). 어떤 문서, 게시글, 대시보드에 임베드됐는지 추적할 수 있습니다.- 이 공격은 진짜 데이터 탈취에 가장 가깝습니다. 대응은 sandbox 빈 값으로 JS 자체를 막거나 호스트 allowlist 로 신뢰 도메인만 허용하는 것.