# Bypassing SOP with Iframes - 1 {{#include ../../banners/hacktricks-training.md}} ## Iframes in SOP-1 In hierdie [**uitdaging**](https://github.com/terjanq/same-origin-xss) geskep deur [**NDevTK**](https://github.com/NDevTK) en [**Terjanq**](https://github.com/terjanq) moet jy 'n XSS in die kode benut. ```javascript const identifier = "4a600cd2d4f9aa1cfb5aa786" onmessage = (e) => { const data = e.data if (e.origin !== window.origin && data.identifier !== identifier) return if (data.type === "render") { renderContainer.innerHTML = data.body } } ``` Die hoofprobleem is dat die [**hoofblad**](https://so-xss.terjanq.me) DomPurify gebruik om die `data.body` te stuur, so om jou eie html data na daardie kode te stuur, moet jy **bypass** `e.origin !== window.origin`. Kom ons kyk na die oplossing wat hulle voorstel. ### SOP bypass 1 (e.origin === null) Wanneer `//example.org` in 'n **sandboxed iframe** ingebed is, sal die bladsy se **origin** **`null`** wees, d.w.s. **`window.origin === null`**. So net deur die iframe in te bed via `