From c72abf536dad876157f51f90e542b3e9bca599d1 Mon Sep 17 00:00:00 2001 From: HackTricks News Bot Date: Tue, 25 Nov 2025 08:37:43 +0000 Subject: [PATCH] Add content from: Research Update: Enhanced src/pentesting-web/postmessage-vul... --- .../bypassing-sop-with-iframes-2.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/pentesting-web/postmessage-vulnerabilities/bypassing-sop-with-iframes-2.md b/src/pentesting-web/postmessage-vulnerabilities/bypassing-sop-with-iframes-2.md index 3fd0f317444..8467c69f71c 100644 --- a/src/pentesting-web/postmessage-vulnerabilities/bypassing-sop-with-iframes-2.md +++ b/src/pentesting-web/postmessage-vulnerabilities/bypassing-sop-with-iframes-2.md @@ -83,6 +83,49 @@ The final solution by [**@terjanq**](https://twitter.com/terjanq) is the [**foll ``` +### 2025 Null-Origin Popups (TryHackMe - Vulnerable Codes) + +A recent TryHackMe task (“Vulnerable Codes”) demonstrates how OAuth popups can be hijacked when the opener lives inside a sandboxed iframe that only allows scripts and popups. The iframe forces both itself and the popup into a `"null"` origin, so handlers checking `if (origin !== window.origin) return` silently fail because `window.origin` inside the popup is also `"null"`. Even though the browser still exposes the real `location.origin`, the victim never inspects it, so attacker-controlled messages glide through. + +```javascript +const frame = document.createElement('iframe'); +frame.sandbox = 'allow-scripts allow-popups'; +frame.srcdoc = ` +