The only defence is a JavaScript frame-buster that breaks out if the page is framed. But a sandboxed iframe has no top-navigation permission, so the buster cannot break out, the frame survives, and the click is stolen.
The same attacker page with an option to sandbox the iframe. The target is protected only by a JS frame-buster, not a header.
You neutralised the buster with sandbox and stole the click.
Why the solution worked
A JS frame-buster is not a reliable defence; the attacker neutralises it by sandboxing the frame to block top navigation. The only reliable fix is the CSP frame-ancestors header, enforced by the browser, not page JavaScript.
The root cause
Relying on page JavaScript for defence, which the sandbox neutralises. The root is a client-side defence instead of a browser-enforced header.
How the code is fixed
Replace the frame-buster with a browser-enforced frame-ancestors header.
Vulnerable code
<script>if (top !== self) top.location = self.location;</script> // bypassed by sandbox
Safe code
res.setHeader('Content-Security-Policy', "frame-ancestors 'none'"); // browser-enforced
Impact in the real world
Frame-busters have been bypassed many ways (sandbox, event cancellation), leaving clickjacking possible.
How defenders detect it
Defenders replace the buster with frame-ancestors and audit for JS-based framing defences.
Your workspace now has a Server logs tab: your own attack, as the defender saw it, with the alerting lines marked.
Solved with the walkthrough. Put it aside and solve again to earn the feather.