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=zh" 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 로 신뢰 도메인만 허용하는 것.