history.pushState pollution
Push a flood of history entries to wreck the parent's back-button behavior.
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/history-pollution?lang=en" title="XSS Playground - history.pushState pollution" width="600" height="420" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"></iframe>
실행
// 로그 없음
해설
- iframe 의 pushState 는 자기 origin URL 만 변경하지만, 부모 탭의 뒤로가기 동작에 누적됩니다. 사용자가 서비스의 이전 화면으로 돌아가려고 뒤로가기를 눌러도 iframe history 만 돌아가게 될 수 있습니다.
- 공격 가치는 annoyance / 사용자가 사이트를 떠나지 못하게 가두는 용도입니다.
- sandbox 빈 값(
sandbox="") 이면 JS 가 막혀 이 공격도 차단됩니다.allow-scripts만 줘도 history API 자체는 자유롭게 호출됩니다.