sendBeacon / fetch exfiltration
Exfiltrate everything observable inside the iframe to an attacker server.
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/beacon-exfil?lang=en" 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 로 신뢰 도메인만 허용하는 것.