Uninitialized FeaturePolicy in transient about:blank
A transient about:blank document does not initialise its FeaturePolicy, so it remains unrestricted. An attacker can use this to bypass feature restrictions such as fullscreen and hijack the top-level context's permission.
Originally disclosed on Mozilla
- Fixed in 27 days
- Paid in 32 days
- Disclosed after 27 days
A transient placeholder about:blank document never initializes its FeaturePolicy. This can be used to bypass feature restrictions with the same attack scenarios and impact as bug 1771685.
The bug occurs because a transient about:blank doesn't call Document::StartDocumentLoad() where the policy would usually be set up. The FP also isn't among the security properties that are explicitly initialized in nsDocShell::CreateAboutBlankContentViewer().
Proof of concept
This iframe contains two blank sub frames, one of which is stopped immediately with window.stop(), so it never starts loading to replace the initial transient about:blank. Thus, the document holds an unrestricted FeaturePolicy and can hijack the top-level context's fullscreen permission, whereas the other frame has loaded regularly and is denied fullscreen as expected.
(I'm using srcdoc only to keep the PoC self-contained - the cross-origin examples from bug 1771685 apply here as well.)
<iframe allow="fullscreen 'none'" srcdoc="
<button onclick='regular.document.firstChild.requestFullscreen()'>fullscreen regular</button>
<button onclick='transient.document.firstChild.requestFullscreen()'>fullscreen transient</button>
<iframe name='regular'></iframe>
<iframe name='transient'></iframe>
<script>transient.stop()</script>
"></iframe>
Also, sorry for reporting this right after the patch for bug 1771685 has already landed. When I filed that one I hadn't been aware there's another FeaturePolicy initialization bug.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could bypass feature restrictions and hijack the top-level context's fullscreen permission, with the same attack scenarios and impact as bug 1771685.
What the attacker needed
Victim visits a malicious page; browser supports FeaturePolicy
How it was found
- Create an iframe with allow="fullscreen 'none'" containing two blank sub-frames.
- Stop one sub-frame immediately with window.stop() so it never starts loading to replace the initial transient about:blank.
- Trigger requestFullscreen() on the transient frame's document and observe it succeeds, while the regularly loaded frame is denied.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
FeaturePolicy is a browser mechanism that lets a page restrict which features (like fullscreen) its embedded frames can use. Normally, a blank page created inside a frame inherits those restrictions, but here a special kind of blank page skipped the setup step, so it had no restrictions at all. That let it request fullscreen even when the parent page said no.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.